Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Record tool response in tool run span#2109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
alexmojaki merged 1 commit intomainfromalex/tool-response
Jul 1, 2025
Merged

Conversation

alexmojaki
Copy link
Contributor

Closes#2004

Copy link

@CopilotCopilotAI 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 ensures that the tool response is recorded within the tool run span, addressing issue#2004.

  • Updated tests to assert a more comprehensive snapshot of tool attributes when content is included.
  • Modified the tool execution flow in the tools module to capture and record the tool response in the current trace span.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
tests/test_logfire.pyUpdated snapshot assertions to check additional tool fields
pydantic_ai_slim/pydantic_ai/tools.pyRevised span handling to record the tool response within the span
Comments suppressed due to low confidence (1)

tests/test_logfire.py:548

  • [nitpick] The updated snapshot assertion now compares multiple keys. Please ensure that dynamic fields like 'gen_ai.tool.call.id' and the JSON schema remain stable across test runs and consider adding comments to clarify the expected snapshot structure.
    assert result.output == snapshot('{"add_numbers":84}')

@github-actionsGitHub Actions
Copy link

Docs Preview

commit:40324fa
Preview URL:https://62ad36fa-pydantic-ai-previews.pydantic.workers.dev

@alexmojakialexmojaki requested a review fromDouweMJuly 1, 2025 16:43
@DouweM
Copy link
Contributor

@alexmojaki Thanks, makes sense, approved!

@alexmojakialexmojaki merged commit5b94841 intomainJul 1, 2025
18 checks passed
@alexmojakialexmojaki deleted the alex/tool-response branchJuly 1, 2025 19:30
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@DouweMDouweMDouweM approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Show tool response in the running tool span
2 participants
@alexmojaki@DouweM

[8]ページ先頭

©2009-2025 Movatter.jp