Skip to content

The agent engineering platform.

add defaults for tavily (#15075)

Harrison Chase2e159931ac4b
diff --git a/libs/community/langchain_community/tools/tavily_search/tool.py b/libs/community/langchain_community/tools/tavily_search/tool.py
index f9af0fefe2..4eb1ff4b45 100644
--- a/libs/community/langchain_community/tools/tavily_search/tool.py
+++ b/libs/community/langchain_community/tools/tavily_search/tool.py
@@ -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(