Skip to content

Identify AI agents in API requests#49

Merged
zvikagart merged 2 commits intomainfrom
identify-ai-agents-in-open-api-requests
Jul 8, 2025
Merged

Identify AI agents in API requests#49
zvikagart merged 2 commits intomainfrom
identify-ai-agents-in-open-api-requests

Conversation

@zvikagart
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 8, 2025 13:42

This comment was marked as outdated.

@zvikagart zvikagart requested a review from Copilot July 8, 2025 13:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for tracking AI agents by introducing an agent_id field to the CodeOcean client and automatically including it in API requests when provided.

  • Added agent_id as an optional parameter with default None
  • Updated class docstring to document the new field
  • Inject Agent-Id header into the session if agent_id is set
Comments suppressed due to low confidence (2)

src/codeocean/client.py:34

  • Add or update unit tests to verify that providing an agent_id correctly results in the Agent-Id header being set on outgoing requests.
    agent_id: Optional[str] = None

src/codeocean/client.py:41

  • [nitpick] Confirm that the custom header name 'Agent-Id' aligns with the API specification (consider standard 'X-Agent-Id' prefix if required) to avoid potential integration issues.
            self.session.headers.update({"Agent-Id": self.agent_id})

@zvikagart zvikagart merged commit 7b4885f into main Jul 8, 2025
1 check passed
@zvikagart zvikagart deleted the identify-ai-agents-in-open-api-requests branch July 8, 2025 19:28
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