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

[BUG] Unsupported parameter 'max_tokens' with o1-mini and o1-preview #42490

Open
3 tasks done
JackMatthewRimmer opened this issue Oct 21, 2024 · 5 comments
Open
3 tasks done
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. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@JackMatthewRimmer
Copy link

Describe the bug
When calling either o1-mini or o1-preview we can only set maxTokens on the ChatCompletionsOptions object however upon calling the model this error is returned

Status code 400, "{ "error": { "message": "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.", "type": "invalid_request_error", "param": "max_tokens", "code": "unsupported_parameter" } }"

To Reproduce
Steps to reproduce the behavior:
Set maxTokens when calling o1-mini or o1-preview

Code Snippet

            .setMaxTokens(config.maxTokens())

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. labels Oct 21, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kushagraThapar @pjohari-ms @TheovanKraay.

@TheovanKraay
Copy link
Member

I believe this is an issue related to Azure OpenAI Java API and not Java SDK for Cosmos DB? @JackMatthewRimmer I think your issue has been tagged incorrectly - can you please help clarify with more context on how you are making this call (i.e. provide a full code snippet, reference the client library you are using, etc)?

@JackMatthewRimmer
Copy link
Author

@TheovanKraay Yes your right this issue is for the Open AI java API within the azure sdk. The code is quite simple if you try and send a request to o1-mini or o1-preview and set maxTokens on the ChatCompletionsOptions object it will fail as the API expects a json field of max_completion_tokens not max_tokens

@alzimmermsft
Copy link
Member

Thanks for reporting this @JackMatthewRimmer, @mssfang and @jpalvarezl could you follow-up on this.

@mssfang
Copy link
Member

mssfang commented Nov 11, 2024

@JackMatthewRimmer
maxTokens is not available in o1-preview and p1-mini models. We haven't added the support for max_completion_tokens yet. But it will be in the next service API version, 2024-09-01-preview.

Will keep you posted when we release next SDK version (ETA, before end of year).

@mssfang mssfang removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 11, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants