-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add o1 support with structured output #1025
base: main
Are you sure you want to change the base?
Conversation
File Changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 6 changed files in this pull request and generated no suggestions.
Comments skipped due to low confidence (3)
patchwork/common/client/llm/openai_.py:32
- The line contains a tab character which should be removed.
gpt-4
patchwork/common/client/llm/openai_.py:115
- The line is unreachable due to the preceding return statement.
return self.client.chat.completions.create(**NotGiven.remove_not_given(input_kwargs))
patchwork/common/client/llm/openai_.py:177
- The string concatenation should use f-string formatting for consistency.
"content": f"Given the following data, format it with the given response format: {o1_choice.message.content}"
PR Checklist
PR Type
What is the current behavior?
Currently o1 models are not supported due to outdated
tiktoken
version. Current tiktoken version is0.7.0
In addition, o1 models do not support structured outputs.
Issue Number: N/A
What is the new behavior?
I have bumped our own fork of
code2prompt
to depend on version^0.8.0
oftiktoken
which adds encoding mapping of o1 models.I have opted to always follow the recommendation here when structured output is required of o1 models.
Other information