Skip to content

feat(api_core): add AI agent environment detection to ClientInfo - #19189

Open
ankitaluthra1 wants to merge 1 commit into
googleapis:mainfrom
ankitaluthra1:feat/agentic-usage-observability
Open

ankitaluthra1 wants to merge 1 commit into
googleapis:mainfrom
ankitaluthra1:feat/agentic-usage-observability

Conversation

@ankitaluthra1

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@ankitaluthra1
ankitaluthra1 requested a review from a team as a code owner November 23, 2026 17:09

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a new module google.api_core.agents to detect AI agents from ambient environment variables and append them to the client's user-agent string. It includes sanitization logic for agent names, respects telemetry opt-out environment variables, and updates ClientInfo to support this detection automatically or via an explicit parameter. Comprehensive unit tests and documentation updates are also included. There are no review comments, so I have no additional feedback to provide.

This branch has not been deployed

No deployments
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.

1 participant