-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
openai[patch]: add disabled_params #25591
Conversation
baskaryan
commented
Aug 20, 2024
•
edited
Loading
edited
- enable json schema mode in azure openai
- add ability to disable different params
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -529,6 +521,7 @@ class Joke(BaseModel): | |||
Distinct from the Azure deployment name, which is set by the Azure user. | |||
Used for tracing and token counting. Does NOT affect completion. | |||
""" | |||
disabled_params: List[str] = Field(default_factory=lambda: ["parallel_tool_calls"]) |
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.
As a class attribute this seems somewhat mysterious, as it only applies to with_structured_output
. My first thought is to add a bind_kwargs: Optional[dict]
kwarg to with_structured_output, e.g.,
if bind_kwargs is None:
bind_kwargs = {
"tool_choice": tool_name,
"parallel_tool_calls": False,
"strict": strict,
}
then Azure can override with_structured_output
and pass this in to the parent class method.
Alternatively, can update the naming here / clarify in documentation.
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.
i think disabled_params is something we're gonna find useful beyond structured output if/when azure and openai apis diverge again
if it works well could generalize it to others integrations like bedrock (where apis are model-specific) and vertexai
outdated given latest azure oai api versions, will open new pr |