-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adding thinkingpart to otel_events in ModelResponse #2237
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I've clubbed the events together keeping only ToolCallPart separate. |
…/pydantic-ai into thinking_blocks_spans
…hinking_blocks_spans
…/pydantic-ai into thinking_blocks_spans
…/pydantic-ai into thinking_blocks_spans
…/pydantic-ai into thinking_blocks_spans
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.
This looks good but it turns out our UI isn't quite ready yet so I think merging this should wait a bit
if settings.include_content: | ||
body['content'] = part.content | ||
elif isinstance(part, (TextPart, ThinkingPart)): | ||
kind = 'thinking' if isinstance(part, ThinkingPart) else 'text' |
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.
kind = 'thinking' if isinstance(part, ThinkingPart) else 'text' | |
kind = part.part_kind |
Closes #2131
Moves from each TextPart being its own event to clubbing all TextParts and ThinkingPart events into one body
Updates the tests based on this new approach