Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description getting doubled up in system prompt #172

Open
ionflow opened this issue Apr 26, 2024 · 0 comments
Open

Description getting doubled up in system prompt #172

ionflow opened this issue Apr 26, 2024 · 0 comments

Comments

@ionflow
Copy link

ionflow commented Apr 26, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant