Skip to content

Fix ThinkingPartDelta.apply(ThinkingPart) not updating ThinkingPart.signature #2011

@CallumJHays

Description

@CallumJHays

Initial Checks

Description

Hi 👋 I came across an issue while trying to subclass BedrockConverseModel to enable mapping ThinkingPart to ReasoningContentBlockOutputTypeDef:

ThinkingPartDelta.signature_delta does not update ThinkingPart during ThinkingPartDelta.apply, and gets discarded. This issue might apply to other models, not just bedrock.

part_delta = ThinkingPartDelta(signature_delta=signature)
self._parts[part_index] = part_delta.apply(existing_thinking_part)
return PartDeltaEvent(index=part_index, delta=part_delta)

if isinstance(part, ThinkingPart):
return replace(part, content=part.content + self.content_delta if self.content_delta else None)

Python, Pydantic AI & LLM client version

Python: 3.12
Pydantic-AI: 0.3.0
LLM: `boto3==1.38.33`

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions