From 15c650f9422a1c4c987199a2a82fa0803ce3184c Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 23 Feb 2026 13:03:09 -0500 Subject: [PATCH] Allow extra fields in ChatCompletionRequest to fix 422 errors - Add model_config with extra='allow' to ChatCompletionRequest - Fixes 422 validation errors when OpenAI-compatible clients send unknown fields - Maintains backward compatibility with all existing fields - Tested with unknown_field and extra_param - request succeeds --- app/models/openai_models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/openai_models.py b/app/models/openai_models.py index b352ce1..3dcc196 100644 --- a/app/models/openai_models.py +++ b/app/models/openai_models.py @@ -32,6 +32,8 @@ class ToolCall(BaseModel): class ChatCompletionRequest(BaseModel): """OpenAI chat completion request.""" + model_config = {"extra": "allow"} + model: str messages: List[ChatMessage] temperature: Optional[float] = Field(default=1.0, ge=0, le=2)