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

openai[patch]: add disabled_params #25591

Closed
wants to merge 3 commits into from
Closed

Conversation

baskaryan
Copy link
Collaborator

@baskaryan baskaryan commented Aug 20, 2024

  • enable json schema mode in azure openai
  • add ability to disable different params

@efriis efriis added the partner label Aug 20, 2024
@efriis efriis self-assigned this Aug 20, 2024
@baskaryan baskaryan requested a review from ccurme August 20, 2024 18:31
Copy link

vercel bot commented Aug 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 6:52pm

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 20, 2024
@baskaryan baskaryan requested a review from efriis August 20, 2024 18:31
@dosubot dosubot bot added the 🤖:improvement Medium size change to existing code to handle new use-cases label Aug 20, 2024
@@ -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"])
Copy link
Collaborator

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.

Copy link
Collaborator Author

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

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Aug 20, 2024
@baskaryan
Copy link
Collaborator Author

outdated given latest azure oai api versions, will open new pr

@baskaryan baskaryan closed this Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases lgtm PR looks good. Use to confirm that a PR is ready for merging. partner size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants