Skip to content

fix(types): ERROR, name shouldn't be optional for response's structured outputs #1404

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

Conversation

davidchicano
Copy link

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

In src/resources/responses/responses.ts make the ResponseFormatTextJSONSchemaConfig parameter not optional:

/**
 * JSON Schema response format. Used to generate structured JSON responses. Learn
 * more about
 * [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
 */
export interface ResponseFormatTextJSONSchemaConfig {
...
  /**
   * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
   * and dashes, with a maximum length of 64.
   */
  name?: string; -->  name: string;
...
}

Not setting this parameter generates an error.

Additional context & links

Error example:

{
  status: 400,
  headers: {
    ...
  },
  error: {
    message: "Missing required parameter: 'text.format.name'.",
    type: "invalid_request_error",
    param: "text.format.name",
    code: "missing_required_parameter"
  },
  code: "missing_required_parameter",
  param: "text.format.name",
  type: "invalid_request_error",
  request_id: "req_ebdf4e9d8c4819718be076dabf1f6316"
}

@davidchicano davidchicano requested a review from a team as a code owner March 20, 2025 12:23
@RobertCraigie
Copy link
Collaborator

Thanks for the PR! Looks like this has since been fixed.

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

Successfully merging this pull request may close these issues.

2 participants