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 'any' tool_choice handling in bind_tools #27

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

B-Step62
Copy link
Collaborator

@B-Step62 B-Step62 commented Oct 17, 2024

LangChain bind_tools accept any but OpenAI API does not recognize it. ChatOpenAI handles this by replacing any with required. This PR adds that handling to be compatible with OpenAI spec.

Test

  • Unit test
  • Ran integ test from local machine.

Copy link
Collaborator

@serena-ruan serena-ruan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix!

Copy link
Contributor

@prithvikannan prithvikannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Yuki!

@B-Step62 B-Step62 merged commit 469adc0 into langchain-ai:main Oct 17, 2024
8 checks passed
@B-Step62 B-Step62 deleted the fix-tool-choice branch October 17, 2024 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants