You can customise how/when/why TavilySearchResults calls search tool by setting the description param.
The default description used to determine whether to call search tool is:
description: str = 'A search engine optimized for comprehensive, accurate, and trusted results. Useful for when you need to answer questions about current events. Input should be a search query.'
Obviously not so great, you can change it to what you need like:
custom_description = """
Only use the search tool if:
1. The question requires current information
2. The information cannot be derived from common knowledge
3. The question indicated that the answer must be a comprehensive, accurate, and trusted result
"""
search = TavilySearchResults(
max_results=2,
description=custom_description
)
You'll then notice that TavilySearchResults won't make query tool calls easily anymore unless input question meets the newly customised conditions.