Skip to content

Python: ChatAgent ID not matching underlying service side agent ID #2283

@TaoChenOSU

Description

@TaoChenOSU

For some agents, for example the Azure AI agent, the ID on ChatAgent doesn't match the ID of the service side agent.

Currently, we create the underlying agent when run/run_stream is first called, which has its own ID that's different than the ID we generate, resulting in inconsistency. This causes other services, such as the agent evaluation, to become unable to correlate our traces to the actual agents, because our traces capture the ID of the ChatAgent.

When we create the underlying agent that lives on the server side, we will have already created the ID of the ChatAgent. There are multiple ways to address this issue:

  1. Create the server-side agent when ID is first accessed. This could be difficult because agent creation might be async.
  2. Use an async context manager as the client which will create the server-side agent upon entering.
  3. Force users to pass an agent that's already created to ChatAgent.

Metadata

Metadata

Assignees

Labels

agentsIssues related to single agentspythonv1.0Features being tracked for the version 1.0 GA

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions