add defaults for tavily (#15075)

This commit is contained in:
Harrison Chase 2023-12-22 11:48:26 -08:00 committed by GitHub
parent 4440ec5ab3
commit 2e159931ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ class TavilySearchResults(BaseTool):
"Useful for when you need to answer questions about current events. "
"Input should be a search query."
)
api_wrapper: TavilySearchAPIWrapper
api_wrapper: TavilySearchAPIWrapper = Field(default_factory=TavilySearchAPIWrapper)
max_results: int = 5
args_schema: Type[BaseModel] = TavilyInput
@ -70,7 +70,7 @@ class TavilyAnswer(BaseTool):
"Input should be a search query. "
"This returns only the answer - not the original source data."
)
api_wrapper: TavilySearchAPIWrapper
api_wrapper: TavilySearchAPIWrapper = Field(default_factory=TavilySearchAPIWrapper)
args_schema: Type[BaseModel] = TavilyInput
def _run(