Skip to content

fix(tavily): convert search/extract API parameters to snake_case in request body #8048

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

Merged

Conversation

abogacki
Copy link
Contributor

Summary

While using the TavilySearch tool, I noticed that the provided options were not being applied correctly. Upon investigation, I identified a mismatch between the camelCase keys used in the API wrapper and the snake_case format expected by the Tavily API.

Changes

  • Introduced an abstract base class to:
    • Unify apiKey handling for both search and extract wrappers.
    • Add a private utility method that converts camelCase option keys to snake_case before making API requests. This ensures compatibility with Tavily's expected format without introducing breaking changes.

@michaelgriff if you have spare second, please take a look.

Copy link

vercel bot commented Apr 21, 2025

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

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Apr 23, 2025 0:57am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Apr 23, 2025 0:57am

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. auto:improvement Medium size change to existing code to handle new use-cases labels Apr 21, 2025
Copy link
Collaborator

@benjamincburns benjamincburns left a comment

Choose a reason for hiding this comment

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

Good catch, and thanks for the fix!

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Apr 23, 2025
@benjamincburns benjamincburns changed the title (langchain/tavily) Convert search/extract API parameters to snake_case fix(tavily): convert search/extract API parameters to snake_case in request body Apr 23, 2025
@benjamincburns benjamincburns merged commit d879f7c into langchain-ai:main Apr 23, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases lgtm PRs that are ready to be merged as-is size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants