Fix token budget + Clarify code#839
Merged
glahaye merged 3 commits intomicrosoft:mainfrom Mar 9, 2024
glahaye:fix_budget
Merged
Fix token budget + Clarify code#839glahaye merged 3 commits intomicrosoft:mainfrom glahaye:fix_budget
glahaye merged 3 commits intomicrosoft:mainfrom
glahaye:fix_budget
Conversation
glahaye
commented
Mar 6, 2024
glahaye
commented
Mar 6, 2024
glahaye
commented
Mar 6, 2024
glahaye
commented
Mar 6, 2024
|
@glahaye when I try your PR changes with my large prompt, the chatcompletion endpoint returns me the folowing choices : "choices": [
{
"finish_reason": "tool_calls",
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_1pn6T4POraqkRVYODVYjYXEK",
"type": "function",
"function": {
"name": "ChatPlugin-Chat",
"arguments": "{\"message\": \"The candidate has strong sales experience and has worked internationally, which aligns with the job posting. However, they lack specific SDR experience in a SaaS environment.\", \"userId\": \"RecruitmentAnalysis\", \"userName\": \"HR Specialist\", \"chatId\": \"recruitment_analysis\", \"messageType\": \"text\"}"
}
},
{
"id": "call_OrXJOYstW7Iudz7Mon9VgT2S",
"type": "function",
"function": {
"name": "ChatPlugin-ExtractChatHistory",
"arguments": "{\"chatId\": \"recruitment_analysis\", \"tokenLimit\": 2000}"
}
}
]
},
"content_filter_results": {}
}
]And in the |
teresaqhoang
reviewed
Mar 6, 2024
teresaqhoang
reviewed
Mar 6, 2024
Contributor
Author
I don't believe this is related. |
teresaqhoang
approved these changes
Mar 9, 2024
teamleader-dev
pushed a commit
to vlink-group/chat-copilot
that referenced
this pull request
Oct 7, 2024
### Motivation and Context The user message is not added to the GPT completion request when the token count of the prompt exceeds 50% of the configuration. This fix is inspired by microsoft#836 ### Description Fix budget calculation and clarify / simplify code. ### 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 😄
kb0039
pushed a commit
to aaronba/chat-copilot
that referenced
this pull request
Jan 8, 2025
### Motivation and Context The user message is not added to the GPT completion request when the token count of the prompt exceeds 50% of the configuration. This fix is inspired by microsoft#836 ### Description Fix budget calculation and clarify / simplify code. ### 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The user message is not added to the GPT completion request when the token count of the prompt exceeds 50% of the configuration.
This fix is inspired by #836
Description
Fix budget calculation and clarify / simplify code.
Contribution Checklist