prompty icon indicating copy to clipboard operation
prompty copied to clipboard

Fix for issue 69 when using structured output for AOAI

Open vincentgiraud opened this issue 1 year ago • 4 comments

Fix for issue 69 when using structured output for AOAI: 'You tried to pass a BaseModel class to chat.completions.create(); You must use beta.chat.completions.parse() instead. Basically an upgrade of AOAI client library to cover version 2024-08-06 of gpt-4o model supporting structured outputs.

vincentgiraud avatar Oct 02 '24 09:10 vincentgiraud

@vincentgiraud please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree company="Microsoft"

vincentgiraud avatar Oct 02 '24 09:10 vincentgiraud

Makes total sense - is this backward compatible (i.e. the older things work too?)

sethjuarez avatar Oct 02 '24 17:10 sethjuarez

I run all tests successfully including the new one for the structured output prompty file with the gpt-4o model 2024-08-06 (api version 2024-08-01-preview) Screenshot 2024-10-09 211304

vincentgiraud avatar Oct 09 '24 20:10 vincentgiraud

As discussed @sethjuarez, I have created a separate invoker (azure_beta with alias azure_openai_beta) for the beta command in charge of the structured output and whetever will come next as beta. So the "older things" are left untouched.

Both invokers share the same processor (under azure). I reran all tests on gpt-35-turbo and gpt-4 (including the new one on gpt-4o-2024-08-06 with structured output) with real calls succesfully.

Will you take care of updating the prompty.yaml vscode extension with the new azure_openai_beta configuration type?

vincentgiraud avatar Oct 13 '24 15:10 vincentgiraud

Any ETA for this?

vincentgiraud avatar Oct 18 '24 12:10 vincentgiraud

Any date for a final review? It's additional work to merge and retest as it diverges over time from the upstream. This is a functionality asked by customers. Thanks!

vincentgiraud avatar Oct 29 '24 07:10 vincentgiraud