File tree Expand file tree Collapse file tree
src/haystack_integrations/components/websearch/tavily Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212Refer to the general [ Contribution Guidelines] ( https://github.com/deepset-ai/haystack-core-integrations/blob/main/CONTRIBUTING.md ) .
1313
14- To run integration tests, export your Tavily API key:
15-
16- ``` bash
17- export TAVILY_API_KEY=< your-api-key>
18- ```
14+ To run integration tests locally, you need to export the ` TAVILY_API_KEY ` environment variable.
Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ def __init__(
6161 self .api_key = api_key
6262 self .top_k = top_k
6363 self .search_params = search_params
64- self ._search_params = search_params or {}
6564 self ._tavily_client : TavilyClient | None = None
6665 self ._async_tavily_client : AsyncTavilyClient | None = None
6766
@@ -99,7 +98,7 @@ def run(
9998 msg = "TavilyWebSearch client failed to initialize."
10099 raise RuntimeError (msg )
101100
102- params = (search_params if search_params is not None else self ._search_params ).copy ()
101+ params = (search_params if search_params is not None else self .search_params or {} ).copy ()
103102 if "max_results" not in params and self .top_k is not None :
104103 params ["max_results" ] = self .top_k
105104
@@ -129,7 +128,7 @@ async def run_async(
129128 msg = "TavilyWebSearch async client failed to initialize."
130129 raise RuntimeError (msg )
131130
132- params = (search_params if search_params is not None else self ._search_params ).copy ()
131+ params = (search_params if search_params is not None else self .search_params or {} ).copy ()
133132 if "max_results" not in params and self .top_k is not None :
134133 params ["max_results" ] = self .top_k
135134
You can’t perform that action at this time.
0 commit comments