diff --git a/docs/source/providers/tool_runtime/remote_tavily-search.md b/docs/source/providers/tool_runtime/remote_tavily-search.md index 3dc31534d..73ee4af46 100644 --- a/docs/source/providers/tool_runtime/remote_tavily-search.md +++ b/docs/source/providers/tool_runtime/remote_tavily-search.md @@ -10,12 +10,16 @@ Tavily Search tool for AI-optimized web search with structured results. |-------|------|----------|---------|-------------| | `api_key` | `str \| None` | No | | The Tavily Search API Key | | `max_results` | `` | No | 3 | The maximum number of results to return | +| `timeout` | `` | No | 30.0 | HTTP request timeout for the API | +| `connect_timeout` | `` | No | 10.0 | HTTP connection timeout in seconds for the API | ## Sample Configuration ```yaml api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 +timeout: 30.0 +connect_timeout: 10.0 ``` diff --git a/llama_stack/providers/remote/tool_runtime/tavily_search/config.py b/llama_stack/providers/remote/tool_runtime/tavily_search/config.py index ae7b41d50..ec409ab55 100644 --- a/llama_stack/providers/remote/tool_runtime/tavily_search/config.py +++ b/llama_stack/providers/remote/tool_runtime/tavily_search/config.py @@ -32,6 +32,6 @@ class TavilySearchToolConfig(BaseModel): return { "api_key": "${env.TAVILY_SEARCH_API_KEY:=}", "max_results": 3, - "timeout:" 30.0, + "timeout": 30.0, "connect_timeout": 10.0, } diff --git a/llama_stack/providers/remote/tool_runtime/tavily_search/tavily_search.py b/llama_stack/providers/remote/tool_runtime/tavily_search/tavily_search.py index cdaf78d4a..d89c9b101 100644 --- a/llama_stack/providers/remote/tool_runtime/tavily_search/tavily_search.py +++ b/llama_stack/providers/remote/tool_runtime/tavily_search/tavily_search.py @@ -70,7 +70,7 @@ class TavilySearchToolRuntimeImpl(ToolGroupsProtocolPrivate, ToolRuntime, NeedsR async def invoke_tool(self, tool_name: str, kwargs: dict[str, Any]) -> ToolInvocationResult: api_key = self._get_api_key() - timeout = https.Timeout(timeout=self.config.timeout, connect=self.config.connect_timeout) + httpx.Timeout(timeout=self.config.timeout, connect=self.config.connect_timeout) async with httpx.AsyncClient() as client: response = await client.post( diff --git a/llama_stack/templates/bedrock/run.yaml b/llama_stack/templates/bedrock/run.yaml index 068278c66..632fa5b02 100644 --- a/llama_stack/templates/bedrock/run.yaml +++ b/llama_stack/templates/bedrock/run.yaml @@ -85,6 +85,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/cerebras/run.yaml b/llama_stack/templates/cerebras/run.yaml index 305e9a20f..bda867555 100644 --- a/llama_stack/templates/cerebras/run.yaml +++ b/llama_stack/templates/cerebras/run.yaml @@ -91,6 +91,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/ci-tests/run.yaml b/llama_stack/templates/ci-tests/run.yaml index 5a68af3e6..6501fb7e5 100644 --- a/llama_stack/templates/ci-tests/run.yaml +++ b/llama_stack/templates/ci-tests/run.yaml @@ -89,6 +89,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/dell/run-with-safety.yaml b/llama_stack/templates/dell/run-with-safety.yaml index 1e1ef1ea9..121087d8c 100644 --- a/llama_stack/templates/dell/run-with-safety.yaml +++ b/llama_stack/templates/dell/run-with-safety.yaml @@ -92,6 +92,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/dell/run.yaml b/llama_stack/templates/dell/run.yaml index 6f5c56dd3..de661bfda 100644 --- a/llama_stack/templates/dell/run.yaml +++ b/llama_stack/templates/dell/run.yaml @@ -88,6 +88,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/fireworks/run-with-safety.yaml b/llama_stack/templates/fireworks/run-with-safety.yaml index 1233e2271..26212e57d 100644 --- a/llama_stack/templates/fireworks/run-with-safety.yaml +++ b/llama_stack/templates/fireworks/run-with-safety.yaml @@ -105,6 +105,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha config: diff --git a/llama_stack/templates/fireworks/run.yaml b/llama_stack/templates/fireworks/run.yaml index 7f0bc49f5..38860cdb9 100644 --- a/llama_stack/templates/fireworks/run.yaml +++ b/llama_stack/templates/fireworks/run.yaml @@ -100,6 +100,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha config: diff --git a/llama_stack/templates/groq/run.yaml b/llama_stack/templates/groq/run.yaml index 351ca74f7..ecc533ad9 100644 --- a/llama_stack/templates/groq/run.yaml +++ b/llama_stack/templates/groq/run.yaml @@ -91,6 +91,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/hf-endpoint/run-with-safety.yaml b/llama_stack/templates/hf-endpoint/run-with-safety.yaml index 63063ad91..550651cf8 100644 --- a/llama_stack/templates/hf-endpoint/run-with-safety.yaml +++ b/llama_stack/templates/hf-endpoint/run-with-safety.yaml @@ -96,6 +96,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/hf-endpoint/run.yaml b/llama_stack/templates/hf-endpoint/run.yaml index 4caf0db04..77e7c8cfc 100644 --- a/llama_stack/templates/hf-endpoint/run.yaml +++ b/llama_stack/templates/hf-endpoint/run.yaml @@ -91,6 +91,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/hf-serverless/run-with-safety.yaml b/llama_stack/templates/hf-serverless/run-with-safety.yaml index a4bba1f76..5344d4347 100644 --- a/llama_stack/templates/hf-serverless/run-with-safety.yaml +++ b/llama_stack/templates/hf-serverless/run-with-safety.yaml @@ -96,6 +96,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/hf-serverless/run.yaml b/llama_stack/templates/hf-serverless/run.yaml index 23e4c1f28..de7ba3a10 100644 --- a/llama_stack/templates/hf-serverless/run.yaml +++ b/llama_stack/templates/hf-serverless/run.yaml @@ -91,6 +91,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/llama_api/run.yaml b/llama_stack/templates/llama_api/run.yaml index 77bbcfbc8..83cf5d5b2 100644 --- a/llama_stack/templates/llama_api/run.yaml +++ b/llama_stack/templates/llama_api/run.yaml @@ -101,6 +101,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml b/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml index 2f5ee4062..d3600c8a1 100644 --- a/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml +++ b/llama_stack/templates/meta-reference-gpu/run-with-safety.yaml @@ -106,6 +106,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/meta-reference-gpu/run.yaml b/llama_stack/templates/meta-reference-gpu/run.yaml index cc119bf4d..82ebd3c44 100644 --- a/llama_stack/templates/meta-reference-gpu/run.yaml +++ b/llama_stack/templates/meta-reference-gpu/run.yaml @@ -96,6 +96,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/ollama/run-with-safety.yaml b/llama_stack/templates/ollama/run-with-safety.yaml index 98db5fc98..2838d6069 100644 --- a/llama_stack/templates/ollama/run-with-safety.yaml +++ b/llama_stack/templates/ollama/run-with-safety.yaml @@ -107,6 +107,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/ollama/run.yaml b/llama_stack/templates/ollama/run.yaml index 38fb2bace..129bf4912 100644 --- a/llama_stack/templates/ollama/run.yaml +++ b/llama_stack/templates/ollama/run.yaml @@ -105,6 +105,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/open-benchmark/run.yaml b/llama_stack/templates/open-benchmark/run.yaml index 7b1ef8f10..d9031b15f 100644 --- a/llama_stack/templates/open-benchmark/run.yaml +++ b/llama_stack/templates/open-benchmark/run.yaml @@ -115,6 +115,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/passthrough/run-with-safety.yaml b/llama_stack/templates/passthrough/run-with-safety.yaml index 5cd8a2930..e33009b6d 100644 --- a/llama_stack/templates/passthrough/run-with-safety.yaml +++ b/llama_stack/templates/passthrough/run-with-safety.yaml @@ -96,6 +96,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha config: diff --git a/llama_stack/templates/passthrough/run.yaml b/llama_stack/templates/passthrough/run.yaml index 5b6078953..3578b3ad8 100644 --- a/llama_stack/templates/passthrough/run.yaml +++ b/llama_stack/templates/passthrough/run.yaml @@ -91,6 +91,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: wolfram-alpha provider_type: remote::wolfram-alpha config: diff --git a/llama_stack/templates/postgres-demo/run.yaml b/llama_stack/templates/postgres-demo/run.yaml index 2b6b1a64f..ce3ea23bf 100644 --- a/llama_stack/templates/postgres-demo/run.yaml +++ b/llama_stack/templates/postgres-demo/run.yaml @@ -65,6 +65,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/remote-vllm/run-with-safety.yaml b/llama_stack/templates/remote-vllm/run-with-safety.yaml index a8d30904d..0faee221d 100644 --- a/llama_stack/templates/remote-vllm/run-with-safety.yaml +++ b/llama_stack/templates/remote-vllm/run-with-safety.yaml @@ -100,6 +100,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/remote-vllm/run.yaml b/llama_stack/templates/remote-vllm/run.yaml index 58c4f867d..80da1f534 100644 --- a/llama_stack/templates/remote-vllm/run.yaml +++ b/llama_stack/templates/remote-vllm/run.yaml @@ -93,6 +93,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/sambanova/run.yaml b/llama_stack/templates/sambanova/run.yaml index ab6c70ae0..39e6290e1 100644 --- a/llama_stack/templates/sambanova/run.yaml +++ b/llama_stack/templates/sambanova/run.yaml @@ -70,6 +70,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/starter/run.yaml b/llama_stack/templates/starter/run.yaml index de8d35683..d2e129881 100644 --- a/llama_stack/templates/starter/run.yaml +++ b/llama_stack/templates/starter/run.yaml @@ -162,6 +162,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/tgi/run-with-safety.yaml b/llama_stack/templates/tgi/run-with-safety.yaml index c19b916d5..400b654e7 100644 --- a/llama_stack/templates/tgi/run-with-safety.yaml +++ b/llama_stack/templates/tgi/run-with-safety.yaml @@ -91,6 +91,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/tgi/run.yaml b/llama_stack/templates/tgi/run.yaml index f0197d74c..b4636ddfb 100644 --- a/llama_stack/templates/tgi/run.yaml +++ b/llama_stack/templates/tgi/run.yaml @@ -90,6 +90,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/together/run-with-safety.yaml b/llama_stack/templates/together/run-with-safety.yaml index b32c9ee8d..f6df14477 100644 --- a/llama_stack/templates/together/run-with-safety.yaml +++ b/llama_stack/templates/together/run-with-safety.yaml @@ -96,6 +96,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/together/run.yaml b/llama_stack/templates/together/run.yaml index 22c99f6cf..ef64cf8ee 100644 --- a/llama_stack/templates/together/run.yaml +++ b/llama_stack/templates/together/run.yaml @@ -91,6 +91,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/vllm-gpu/run.yaml b/llama_stack/templates/vllm-gpu/run.yaml index 6d122e180..8f80a2dcb 100644 --- a/llama_stack/templates/vllm-gpu/run.yaml +++ b/llama_stack/templates/vllm-gpu/run.yaml @@ -95,6 +95,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {} diff --git a/llama_stack/templates/watsonx/run.yaml b/llama_stack/templates/watsonx/run.yaml index d80ee6329..8193c0ac6 100644 --- a/llama_stack/templates/watsonx/run.yaml +++ b/llama_stack/templates/watsonx/run.yaml @@ -92,6 +92,8 @@ providers: config: api_key: ${env.TAVILY_SEARCH_API_KEY:=} max_results: 3 + timeout: 30.0 + connect_timeout: 10.0 - provider_id: rag-runtime provider_type: inline::rag-runtime config: {}