Skip to content

Align Tavily Search schema with current API behavior#2720

Open
yasu-oh wants to merge 6 commits intolanggenius:mainfrom
yasu-oh:main
Open

Align Tavily Search schema with current API behavior#2720
yasu-oh wants to merge 6 commits intolanggenius:mainfrom
yasu-oh:main

Conversation

@yasu-oh
Copy link
Copy Markdown

@yasu-oh yasu-oh commented Mar 12, 2026

Related Issues or Context

This PR updates the Tavily Search tool schema to better align with the current Tavily Search API and improve LLM tool-call reliability.

Changes include:

  • update chunks_per_source descriptions for advanced and fast
  • clarify time_range / start_date / end_date constraints
  • improve country parameter guidance so exact option values are used
  • refine parameter descriptions for consistency

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 12, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving the reliability and usability of the Tavily Search tool by updating its schema to accurately reflect the underlying API's behavior. The changes primarily involve enhancing parameter descriptions and clarifying usage constraints, which will lead to more precise and predictable tool calls by large language models.

Highlights

  • Tavily Search Schema Alignment: Updated the Tavily Search tool schema to align with the current Tavily Search API, enhancing LLM tool-call reliability.
  • Parameter Description Clarity: Refined descriptions for various parameters, including chunks_per_source, time_range, start_date, end_date, include_answer, and topic, for improved consistency and guidance.
  • Constraint Clarification: Added explicit constraints for time_range, start_date, and end_date parameters to prevent conflicting usage.
  • Country Parameter Guidance: Improved guidance for the country parameter, advising users to use exact option values and removing the default value.
  • Version Update: Bumped the version of the Tavily tool to 0.1.5 in both manifest.yaml and pyproject.toml.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • models/gemini/.difyignore
    • Moved the .difyignore file.
  • tools/tavily/manifest.yaml
    • Updated the tool version from 0.1.4 to 0.1.5.
  • tools/tavily/pyproject.toml
    • Updated the project version from 0.1.3 to 0.1.5.
  • tools/tavily/tools/tavily_search.yaml
    • Corrected the LLM description for the tool from 'A tool for search engine' to 'A search engine tool'.
    • Updated the llm_description for the topic parameter to use 'Valid options are' instead of 'Options include'.
    • Modified the llm_description for time_range to include a constraint against setting start_date or end_date simultaneously.
    • Updated the llm_description for start_date to include a constraint against setting time_range simultaneously.
    • Updated the llm_description for end_date to include a constraint against setting time_range simultaneously.
    • Clarified the llm_description for include_answer regarding 'basic' and 'advanced' options.
    • Updated the human_description for chunks_per_source to include 'fast search only'.
    • Updated the llm_description for chunks_per_source to specify validity for 'advanced' or 'fast' search_depth.
    • Adjusted the human_description for country from 'from a specific country' to 'for a specific country'.
    • Enhanced the llm_description for country to instruct users to 'Use one of the exact option values'.
    • Removed the default value 'united states' for the country parameter.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot bot added the enhancement New feature or request label Mar 12, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Tavily Search tool's YAML schema to improve clarity and align with the current API, particularly for LLM consumption. The changes refine parameter descriptions and constraints, such as clarifying the relationship between time range and specific date parameters. While the schema updates are beneficial, I've identified a potential inconsistency where a description for chunks_per_source was updated to include 'fast' search, but the corresponding default-handling logic in the Python implementation was not updated, which could lead to unexpected behavior.

en_US: Chunks Per Source
zh_Hans: 每来源片段数
llm_description: Maximum number of relevant content chunks (1-3) returned per source. Valid only when search_depth is advanced.
llm_description: Maximum number of relevant content chunks (1-3) returned per source. Valid when search_depth is 'advanced' or 'fast'.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This description update correctly reflects that chunks_per_source is valid for 'fast' search. However, the backing implementation in tools/tavily/tools/tavily_search.py appears to be inconsistent with this change. The _process_params method only sets a default value for chunks_per_source when search_depth is 'advanced':

# tools/tavily/tools/tavily_search.py:111-112
if processed_params.get("search_depth") == "advanced":
    processed_params.setdefault("chunks_per_source", 3)

This logic does not include the 'fast' search depth. As a result, the default value for chunks_per_source will not be applied for 'fast' searches, which may lead to behavior that is inconsistent with the updated description. Please consider aligning the Python code with this schema change.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Mar 12, 2026
@yasu-oh
Copy link
Copy Markdown
Author

yasu-oh commented Mar 29, 2026

Hi maintainers, just a gentle follow-up on this PR.

If there are any issues with the approach, implementation, or scope, please feel free to let me know directly. I’d really appreciate any feedback, and I’m happy to revise the PR if needed.

Thanks for your time and review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants