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

Fix token budgeting #824

Merged
merged 2 commits into from
Mar 1, 2024
Merged

Fix token budgeting #824

merged 2 commits into from
Mar 1, 2024

Conversation

glahaye
Copy link
Collaborator

@glahaye glahaye commented Feb 29, 2024

Motivation and Context

OpenAI inserts a message under the hood for which we don't account, and thus throwing off our token budgeting. This causes us to sometimes send too many tokens when we approach a model's token limit. This results in errors.

Description

Account for the OpenAI message inserted in our requests.

Contribution Checklist

@github-actions github-actions bot added the webapi Pull requests that update .net code label Feb 29, 2024
@glahaye glahaye added this pull request to the merge queue Mar 1, 2024
Merged via the queue into microsoft:main with commit e018f90 Mar 1, 2024
7 checks passed
@glahaye glahaye deleted the token_budget branch March 1, 2024 00:04
glahaye added a commit that referenced this pull request Mar 1, 2024
### Motivation and Context
OpenAI inserts a message under the hood for which we don't account, and
thus throwing off our token budgeting. This causes us to sometimes send
too many tokens when we approach a model's token limit. This results in
errors.

### Description
Account for the OpenAI message inserted in our requests.

### Contribution Checklist
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
webapi Pull requests that update .net code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants