Skip to content

Adding user agent#30

Merged
aayush3011 merged 3 commits into
AzureCosmosDB:mainfrom
aayush3011:users/akataria/user_agent
Jul 9, 2026
Merged

Adding user agent#30
aayush3011 merged 3 commits into
AzureCosmosDB:mainfrom
aayush3011:users/akataria/user_agent

Conversation

@aayush3011

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 8, 2026 22:08

Copilot AI 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.

Pull request overview

Adds a toolkit-specific Cosmos DB user-agent string (with optional caller prefix) and wires it through both sync and async Cosmos memory clients so Cosmos requests can be attributed in backend telemetry.

Changes:

  • Introduces COSMOS_USER_AGENT / build_cosmos_user_agent() utilities and stores the resolved UA on the shared base client config.
  • Adds a new user_agent constructor argument to CosmosMemoryClient and AsyncCosmosMemoryClient, forwarding it when creating CosmosClient.
  • Adds unit tests covering user-agent construction/forwarding and bumps package version + changelog entry.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uv.lock Bumps editable package version to 0.2.0b3.
pyproject.toml Bumps project version to 0.2.0b3.
CHANGELOG.md Documents the new user_agent constructor option and release entry.
azure/cosmos/agent_memory/_utils.py Adds user-agent helpers/constants used to build the Cosmos UA string.
azure/cosmos/agent_memory/_base/base_client.py Plumbs user_agent through base config and stores _cosmos_user_agent.
azure/cosmos/agent_memory/cosmos_memory_client.py Forwards resolved user-agent into sync CosmosClient construction.
azure/cosmos/agent_memory/aio/cosmos_memory_client.py Forwards resolved user-agent into async CosmosClient construction.
tests/unit/test_utils.py Adds unit tests for user-agent helper behavior.
tests/unit/test_cosmos_memory_client.py Adds unit tests asserting user_agent is passed to the Cosmos client.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread azure/cosmos/agent_memory/cosmos_memory_client.py
Comment thread azure/cosmos/agent_memory/cosmos_memory_client.py
Comment thread azure/cosmos/agent_memory/aio/cosmos_memory_client.py
Comment thread azure/cosmos/agent_memory/aio/cosmos_memory_client.py

Copilot AI 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.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Comment thread azure/cosmos/agent_memory/_utils.py
@aayush3011 aayush3011 merged commit ba18b4c into AzureCosmosDB:main Jul 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants