We’re excited to partner with Langchain as their recommended search tool!
Warning: TheThe langchain-tavily Python package is the offical LangChain integration of Tavily, inlcuding both TavilySearch and TavilyExtractlangchain_community.tools.tavily_search.tool
is deprecated. While it remains functional for now, we strongly recommend migrating to the newlangchain-tavily
Python package which supports both Search and Extract functionality and receives continuous updates with the latest features.
max_results
(optional, int): Maximum number of search results to return. Default is 5.topic
(optional, str): Category of the search. Can be “general”, “news”, or “finance”. Default is “general”.include_answer
(optional, bool): Include an answer to original query in results. Default is False.include_raw_content
(optional, bool): Include cleaned and parsed HTML of each search result. Default is False.include_images
(optional, bool): Include a list of query related images in the response. Default is False.include_image_descriptions
(optional, bool): Include descriptive text for each image. Default is False.search_depth
(optional, str): Depth of the search, either “basic” or “advanced”. Default is “basic”.time_range
(optional, str): The time range back from the current date to filter results - “day”, “week”, “month”, or “year”. Default is None.start_date
(optional, str): Will return all results after the specified start date. Required to be written in the format YYYY-MM-DD. Default is None.end_date
(optional, str): Will return all results before the specified end date. Required to be written in the format YYYY-MM-DD. Default is None.include_domains
(optional, List[str]): List of domains to specifically include. Default is None.exclude_domains
(optional, List[str]): List of domains to specifically exclude. Default is None.query
(required): A natural language search queryinclude_images
, search_depth
, time_range
, include_domains
, exclude_domains
, include_images
, start_date
, end_date
include_answer
and include_raw_content
. These limitations prevent unexpected context window issues and ensure consistent results.tavily_search
with {'query': 'most popular sport in the world', 'include_domains': ['wikipedia.org'], 'search_depth': 'basic'}
extract_depth
(optional, str): The depth of the extraction, either “basic” or “advanced”. Default is “basic ”.include_images
(optional, bool): Whether to include images in the extraction. Default is False.urls
(required): A list of URLs to extract content from.extract_depth
and include_images
can also be set during invokation