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

feat(structured outputs): support accessing raw responses #1058

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

RobertCraigie
Copy link
Collaborator

@RobertCraigie RobertCraigie commented Sep 11, 2024

closes #1057

You can now do this:

  const { data: completion, response } = await client.beta.chat.completions
    .parse({
      model: 'gpt-4o-2024-08-06',
      messages: [
        { role: 'system', content: 'You are a helpful math tutor.' },
        { role: 'user', content: 'solve 8x + 31 = 2' },
      ],
      response_format: zodResponseFormat(MathResponse, 'math_response'),
    })
    .withResponse();

@RobertCraigie RobertCraigie requested a review from a team as a code owner September 11, 2024 09:20
@RobertCraigie RobertCraigie changed the base branch from master to next September 11, 2024 10:13
@RobertCraigie RobertCraigie merged commit af17697 into next Sep 11, 2024
3 checks passed
@RobertCraigie RobertCraigie deleted the robert/structured-outputs-raw-response branch September 11, 2024 10:14
@stainless-app stainless-app bot mentioned this pull request Sep 11, 2024
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.

Support withResponse() for Parse Completion
1 participant