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

[C#] fix: Map tokens config to max_tokens when non-o1 model is used. #2150

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

singhk97
Copy link
Collaborator

Linked issues

closes: #minor

Details

The OpenAI sdk automatically maps the max_tokens configuration to the MaxOutputTokenCount property (i.e max_completion_tokens). However this does not work with Azure OpenAI service as it expects max_tokens for non-o1 models.

Change details

  • In OpenAIModel.cs if the model is not in the o1 series, then use max_tokens field by default.

Attestation Checklist

  • My code follows the style guidelines of this project

  • I have checked for/fixed spelling, linting, and other errors

  • I have commented my code for clarity

  • I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient)

  • My changes generate no new warnings

  • I have added tests that validates my changes, and provides sufficient test coverage. I have tested with:

    • Local testing
    • E2E testing in Teams
  • New and existing unit tests pass locally with my changes

@singhk97 singhk97 merged commit 92d4aef into dotnet-dev Oct 31, 2024
9 checks passed
@singhk97 singhk97 deleted the kavin/c#-o1-fix branch October 31, 2024 20:01
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