Given the following schema and response model the system prompt is given the schema description twice:
export const ResponseSchema = z
.object({
property: z
.string()
.describe(
"A string property"
),
})
.describe(
"This a description of the schema."
);
export const ResponseModel = {
schema: ResponseSchema,
name: "ResponseModel",
};
System prompt ends up being:
Given a user prompt, you will return fully valid JSON based on the following description and schema.
You will return no other prose. You will take into account any descriptions or required parameters within the schema
and return a valid and fully escaped JSON object that matches the schema and those instructions.
description: This a description of the schema.
json schema: {"name":"ResponseModel","description":"This a description of the schema.","type":"object","properties":{"property":{"type":"string","description":"A string property"}},"required":["property"],"additionalProperties":false}
Considering token costs, it would be nice if the description ("This a description of the schema.") only was used once. Especially if the description is long.
Given the following schema and response model the system prompt is given the schema description twice:
System prompt ends up being:
Considering token costs, it would be nice if the description ("This a description of the schema.") only was used once. Especially if the description is long.