Skip to content

Commit c16c960

Browse files
committed
fix typing
1 parent b8406d0 commit c16c960

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pydantic_ai_slim/pydantic_ai/models/openrouter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ async def _map_messages(self, messages: list[ModelMessage]) -> list[ChatCompleti
472472
openai_message['reasoning_details'] = reasoning_details # type: ignore[reportGeneralTypeIssues]
473473

474474
if openai_message['role'] == 'assistant' and isinstance(
475-
contents := openai_message['content'], str
475+
contents := openai_message.get('content'), str
476476
): # pragma: lax no cover
477477
openai_message['content'] = re.sub(r'<think>.*?</think>\s*', '', contents, flags=re.DOTALL).strip()
478478

0 commit comments

Comments
 (0)