mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
Changed config and tavily_search for tavily API
This commit is contained in:
parent
15d27a251f
commit
349e80d06a
2 changed files with 5 additions and 4 deletions
|
@ -26,7 +26,7 @@ class TavilySearchToolConfig(BaseModel):
|
||||||
@classmethod
|
@classmethod
|
||||||
def sample_run_config(cls, __distro_dir__: str) -> dict[str, Any]:
|
def sample_run_config(cls, __distro_dir__: str) -> dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
"api_key": "${env.TAVILY_SEARCH_API_KEY:=}",
|
"api_key": "${env.TAVILY_SEARCH_API_KEY:+}",
|
||||||
"max_results": 3,
|
"max_results": 3,
|
||||||
"timeout": 30.0,
|
"timeout": 30.0,
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,8 @@ 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()
|
||||||
|
|
||||||
timeout = httpx.Timeout(timeout=self.config.timeout)
|
# Configure timeout for external API calls using config values
|
||||||
|
timeout = httpx.Timeout(timeout=self.config.timeout, connect=self.config.connect_timeout)
|
||||||
|
|
||||||
async with httpx.AsyncClient(timeout=timeout) as client:
|
async with httpx.AsyncClient(timeout=timeout) as client:
|
||||||
response = await client.post(
|
response = await client.post(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue