Skip to content

Conversation

@satyadevai
Copy link
Collaborator

@satyadevai satyadevai commented Dec 8, 2025

Closes #2476 #2475

Multiple Tool Output Messages from LLM
image

Tools with Tool Details & Output:
image

Multiple Input Messages - Multiple Tool Calls & Tools Output
image


Note

Extends instrumentation to capture multi-part input/output messages and tool definitions/args/responses, sets span status codes, and adds a multi-tool agent example with updated tests.

  • Instrumentation (semantic conventions):
    • Support multi-part message contents via MessageContentAttributes and indexed MESSAGE_CONTENTS for gen_ai.input/output.messages.
    • Capture tool metadata: LLM_TOOLS from both output_tools and function_tools with JSON schema; include tool_argumentsTOOL_PARAMETERS and tool_responseOUTPUT_VALUE.
    • Normalize tool call fields: index tool calls in messages; JSON-serialize non-string arguments; JSON-serialize final_result output.
    • Add constants: PydanticTools.TOOL_ARGUMENTS/TOOL_RESPONSE, PydanticModelRequestParameters.FUNCTION_TOOLS, and adjust tool PARAMETERS to properties.
  • Span processor:
    • Set span StatusCode.OK on success; mark StatusCode.ERROR with exception details on failures.
  • Examples:
    • New examples/multi_tool_agent.py demonstrating a multi-tool Agent with OTLP export and two tools (get_weather, get_time).
  • Tests:
    • Update assertions to handle v1 vs v2 message formats and verify tool call args, tools metadata, and token counts.

Written by Cursor Bugbot for commit 284e0f0. This will update automatically on new commits. Configure here.

@satyadevai satyadevai changed the title 2476 pydentic tool issue feat: pydentic tool & multiple input out messages support Dec 9, 2025
@satyadevai satyadevai changed the title feat: pydentic tool & multiple input out messages support feat(pydentic_ai): tools & multiple input/output messages support Dec 9, 2025
@satyadevai satyadevai marked this pull request as ready for review December 9, 2025 19:32
@satyadevai satyadevai requested a review from a team as a code owner December 9, 2025 19:32
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[bug] Only one tool call part is processed when multiple tool calls exist in a gen_ai message

1 participant