This commit is contained in:
anigasan 2025-07-06 12:52:47 -07:00
parent f288f92f88
commit 8c4f489c5d

View file

@ -69,11 +69,10 @@ class TavilySearchToolRuntimeImpl(ToolGroupsProtocolPrivate, ToolRuntime, NeedsR
async def invoke_tool(self, tool_name: str, kwargs: dict[str, Any]) -> ToolInvocationResult: async def invoke_tool(self, tool_name: str, kwargs: dict[str, Any]) -> ToolInvocationResult:
api_key = self._get_api_key() api_key = self._get_api_key()
# Configure timeout for external API calls using config values timeout = https.Timeout(timeout=self.config.timeout, connect=self.config.connect_timeout)
timeout = httpx.Timeout(timeout=self.config.timeout, connect=self.config.connect_timeout)
async with httpx.AsyncClient() as client:
async with httpx.AsyncClient(timeout=timeout) as client:
response = await client.post( response = await client.post(
"https://api.tavily.com/search", "https://api.tavily.com/search",
json={"api_key": api_key, "query": kwargs["query"]}, json={"api_key": api_key, "query": kwargs["query"]},