Open
Description
The following GenAIScript configuration leads to a 400 Error
when making a request to OpenAI:
import { dialog } from "./schema-magnolia.mts";
script({
model: "openai:gpt-4o",
system: ["system.schema"],
responseSchema: dialog,
responseType: "json_schema",
});
defSchema("DIALOG_SCHEMA", dialog);
$`
Generate a dialog for Magnolia CMS respecting DIALOG_SCHEMA
`;
The OpenAI API returns the following error:
- Invalid schema for response_format 'result': In context=('properties', '0'), 'default' is not permitted.
The reason is that responseSchema
is equal to the string value "dialog"
instead of the imported js object
This is due to parsePromptScriptMeta
turning the code inside script({...}) into JSON
Do you have a lead to fix that ?
Metadata
Metadata
Assignees
Labels
No labels