From b2101d75d606ac44f4a9f798ee60d1b85cf908ca Mon Sep 17 00:00:00 2001 From: Reuben Tong Date: Thu, 27 Nov 2025 20:34:37 +0000 Subject: [PATCH] open router finish reason fix --- pydantic_ai_slim/pydantic_ai/models/openrouter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydantic_ai_slim/pydantic_ai/models/openrouter.py b/pydantic_ai_slim/pydantic_ai/models/openrouter.py index f7c9d0e73d..3f910d76b6 100644 --- a/pydantic_ai_slim/pydantic_ai/models/openrouter.py +++ b/pydantic_ai_slim/pydantic_ai/models/openrouter.py @@ -354,7 +354,7 @@ class _OpenRouterCompletionMessage(chat.ChatCompletionMessage): class _OpenRouterChoice(chat_completion.Choice): """Wraps OpenAI chat completion choice with OpenRouter specific attributes.""" - native_finish_reason: str + native_finish_reason: str | None """The provided finish reason by the downstream provider from OpenRouter.""" finish_reason: Literal['stop', 'length', 'tool_calls', 'content_filter', 'error'] # type: ignore[reportIncompatibleVariableOverride]