"description":"The search keywords to execute with Tavily. The keywords should be the most important words/terms(includes synonyms) from the original request.",
"default":"{sys.query}",
"required":True
},
"topic":{
"type":"string",
"description":"default:general. The category of the search.news is useful for retrieving real-time updates, particularly about politics, sports, and major current events covered by mainstream media sources. general is for broader, more general-purpose searches that may include a wide range of sources.",
"enum":["general","news"],
"default":"general",
"required":False,
},
"include_domains":{
"type":"array",
"description":"default:[]. A list of domains only from which the search results can be included.",
"default":[],
"items":{
"type":"string",
"description":"Domain name that must be included, e.g. www.yahoo.com"
},
"required":False
},
"exclude_domains":{
"type":"array",
"description":"default:[]. A list of domains from which the search results can not be included",
"default":[],
"items":{
"type":"string",
"description":"Domain name that must be excluded, e.g. www.yahoo.com"
},
"required":False
},
}
}
super().__init__()
self.api_key=""
self.search_depth="basic"# basic/advanced
self.max_results=6
self.days=14
self.include_answer=False
self.include_raw_content=False
self.include_images=False
self.include_image_descriptions=False
defcheck(self):
self.check_valid_value(self.topic,"Tavily topic: should be in 'general/news'",["general","news"])
self.check_valid_value(self.search_depth,"Tavily search depth should be in 'basic/advanced'",["basic","advanced"])
self.check_positive_integer(self.max_results,"Tavily max result number should be within [1, 20]")
self.check_positive_integer(self.days,"Tavily days should be greater than 1")
"description":"Extract web page content from one or more specified URLs using Tavily Extract.",
"parameters":{
"urls":{
"type":"array",
"description":"The URLs to extract content from.",
"default":"",
"items":{
"type":"string",
"description":"The URL to extract content from, e.g. www.yahoo.com"
},
"required":True
},
"extract_depth":{
"type":"string",
"description":"The depth of the extraction process. advanced extraction retrieves more data, including tables and embedded content, with higher success but may increase latency.basic extraction costs 1 credit per 5 successful URL extractions, while advanced extraction costs 2 credits per 5 successful URL extractions.",
"enum":["basic","advanced"],
"default":"basic",
"required":False,
},
"format":{
"type":"string",
"description":"The format of the extracted web page content. markdown returns content in markdown format. text returns plain text and may increase latency.",
"enum":["markdown","text"],
"default":"markdown",
"required":False,
}
}
}
super().__init__()
self.api_key=""
self.extract_depth="basic"# basic/advanced
self.urls=[]
self.format="markdown"
self.include_images=False
defcheck(self):
self.check_valid_value(self.extract_depth,"Tavily extract depth should be in 'basic/advanced'",["basic","advanced"])
self.check_valid_value(self.format,"Tavily extract format should be in 'markdown/text'",["markdown","text"])