Skip to content

Audit tool call gating and update attributes and data collection gates as necessary #7200

Description

@ericapisani

We use the deprecated gen_ai.response.tool_calls attribute in a number of places which has caused confusion in the data collection implementation because:

  • tool calls are defined as "inputs"
  • they currently may appear in the response output if "outputs" are set to False but "inputs" are set to True

Mirroring what the JS SDK does, we should be doing the following:

  • tool calls appearing in the response like the gen_ai.output.messages attribute should be gated on "output"
  • arguments to a tool call should be gated on "input" and set on the non-deprecated attribute gen_ai.tool.call.arguments (doc)
  • results of a tool call should be gated on "output" and set on the non-deprecated attribute gen_ai.tool.call.result (doc)
  • confirm that integrations that create distinct tool invocation spans (i.e. agent frameworks such as openai-agents, langchain, and pydantic-ai) are setting the correct attributes and are gated correctly.

To preserve legacy behaviour, the code path for when data collection is not enabled should continue to set the legacy attributes.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions