Skip to content

feat: hardcode client name for Tavily#3540

Merged
sjrl merged 2 commits into
deepset-ai:mainfrom
manisrinivasan2k1:feat/tavily-param-update
Jul 3, 2026
Merged

feat: hardcode client name for Tavily#3540
sjrl merged 2 commits into
deepset-ai:mainfrom
manisrinivasan2k1:feat/tavily-param-update

Conversation

@manisrinivasan2k1

Copy link
Copy Markdown
Contributor

Related Issues

  • N/A

Proposed Changes:

Adds Tavily request attribution for the Haystack integration by passing client_name="haystack" when initializing both TavilyClient and AsyncTavilyClient.

This makes Tavily API requests from TavilyWebSearch identifiable as coming from the Haystack integration.

How did you test it?

  • Ran Tavily unit tests:

UV_CACHE_DIR=/private/tmp/uv-cache uv run --project . --with pytest --with pytest-asyncio python -m pytest -m "not integration" tests/test_tavily_websearch.py

Result: 15 passed, 2 deselected

  • Ran Ruff on the touched files:

UV_CACHE_DIR=/private/tmp/uv-cache uv run --project . --with ruff ruff check integrations/tavily/src/haystack_integrations/components/websearch/tavily/tavily_websearch.py integrations/tavily/tests/test_tavily_websearch.py

Result: All checks passed

  • Manually verified with a live Tavily request and confirmed server-side attribution showed CLIENT_NAME = haystack.

Notes for the reviewer

The change intentionally uses the Tavily Python SDK’s client_name parameter instead of manually setting HTTP headers.

Checklist

@manisrinivasan2k1 manisrinivasan2k1 requested a review from a team as a code owner July 2, 2026 17:43
@manisrinivasan2k1 manisrinivasan2k1 requested review from sjrl and removed request for a team July 2, 2026 17:43
@CLAassistant

CLAassistant commented Jul 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@manisrinivasan2k1 manisrinivasan2k1 changed the title hardcoded client name Hardcoded client name for Tavily Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Coverage report (tavily)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/tavily/src/haystack_integrations/components/websearch/tavily
  tavily_websearch.py
Project Total  

This report was generated by python-coverage-comment-action

@sjrl sjrl changed the title Hardcoded client name for Tavily feat: hardcode client name for Tavily Jul 3, 2026

@sjrl sjrl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution and looks good!

@sjrl sjrl merged commit fe16dad into deepset-ai:main Jul 3, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants