Skip to content

Commit 9286e8d

Browse files
fix(tavily): remove self._search_params, use self.search_params directly
1 parent d49418d commit 9286e8d

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

integrations/tavily/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,4 @@
1111

1212
Refer 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.

integrations/tavily/src/haystack_integrations/components/websearch/tavily/tavily_websearch.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)