Skip to content

Comments

Add User-Agent header for Anthropic API calls#20771

Open
mikelambert wants to merge 1 commit intorun-llama:mainfrom
mikelambert:mike/user-agent
Open

Add User-Agent header for Anthropic API calls#20771
mikelambert wants to merge 1 commit intorun-llama:mainfrom
mikelambert:mike/user-agent

Conversation

@mikelambert
Copy link
Contributor

Description

Passes User-Agent: llama-index-llms-anthropic/{version} to the Anthropic SDK so Anthropic can identify traffic from LlamaIndex integrations.

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)

  • Yes

Type of Change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • I added new unit tests to cover this change

Suggested Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran uv run make format; uv run make lint to appease the lint gods

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 23, 2026
@dosubot
Copy link

dosubot bot commented Feb 23, 2026

Related Documentation

Checked 0 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

Passes User-Agent: llama-index-llms-anthropic/{version} to the Anthropic SDK
so Anthropic can identify traffic from LlamaIndex integrations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mikelambert
Copy link
Contributor Author

I see a failure on python3.9 on CI, but it appears unrelated to my change:

.venv/lib/python3.9/site-packages/llama_index/core/indices/prompt_helper.py:558: in ChatPromptHelper
    llm: LLM | None = None,
E   TypeError: unsupported operand type(s) for |: 'ModelMetaclass' and 'NoneType'

I suspect someone else submitted a python-3.10-ism here, but that this isn't blocking for merging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant