- Notifications
You must be signed in to change notification settings - Fork1k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this 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.
File | Description |
---|---|
tests/test_logfire.py | Updated snapshot assertions to check additional tool fields |
pydantic_ai_slim/pydantic_ai/tools.py | Revised 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}')
Uh oh!
There was an error while loading.Please reload this page.
Docs Preview
|
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@alexmojaki Thanks, makes sense, approved! |
5b94841
intomainUh oh!
There was an error while loading.Please reload this page.
Closes#2004