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

@azure/openai - Set response_format for GPT-4 Turbo #27860

Closed
joshje opened this issue Nov 21, 2023 · 11 comments
Closed

@azure/openai - Set response_format for GPT-4 Turbo #27860

joshje opened this issue Nov 21, 2023 · 11 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. OpenAI

Comments

@joshje
Copy link

joshje commented Nov 21, 2023

Now that GPT-4 Turbo is available, it would be great to be able to specify the response_format={"type": "json_object"} when making calls to @azure/openai client.getChatCompletions.

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 21, 2023
@xirzec xirzec added Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved. OpenAI and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 21, 2023
@github-actions github-actions bot removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Nov 21, 2023
@deyaaeldeen
Copy link
Member

Thanks for opening this report! This work is in progress and I will share once we make a release.

@YvesZelros
Copy link

YvesZelros commented Nov 22, 2023

@deyaaeldeen Same for the new seed parameter ;-)

@tverdohleb
Copy link

Hey @deyaaeldeen! Do you have any ETA on this matter?

@deyaaeldeen
Copy link
Member

Tentative release date is 12/7. I'll share here once the release happens.

@SumeetGohil
Copy link

Hoping this gets released today.

@joshje
Copy link
Author

joshje commented Dec 7, 2023

This is great to see! Right now we're blocked from using GPT-4 Turbo until this feature is available. Any chance it'll be available today @deyaaeldeen?

@SumeetGohil
Copy link

Our major application stopped working due GPT-4 is not giving json response as it used to give post 30th, Nov.

@deyaaeldeen
Copy link
Member

Thanks for your patience. Please checkout @azure/openai@1.0.0-beta.8 with support for tools, vision, DALL-E v3, and enhanced content filtering!

@deyaaeldeen
Copy link
Member

Also, to answer the original question, you can do this with v1.0.0-beta.8, given a capable deployed model:

client.getChatCompletions(
    deploymentName,
    [
      {
        role: "user",
        content:
          "Answer the following question in JSON format: What are the capital cities in Africa?",
      },
    ],
    { responseFormat: { type: "json_object" } }
);

@deyaaeldeen deyaaeldeen added the issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. label Dec 8, 2023
Copy link

github-actions bot commented Dec 8, 2023

Hi @joshje. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

@joshje
Copy link
Author

joshje commented Dec 11, 2023

Thanks @deyaaeldeen, I'm very happy to report that this has done the trick, and we can now use gpt-4 turbo, with JSON responses!

@joshje joshje closed this as completed Dec 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. OpenAI
Projects
None yet
Development

No branches or pull requests

6 participants