From 27d9bfbad85d9748d9daf23dde7cce548687703d Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 23 Feb 2026 12:50:23 -0500 Subject: [PATCH] Add support for 'developer' role in chat messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add 'developer' to accepted role literals in ChatMessage model - Existing normalization in chat.py converts developer → system before watsonx API call - Fixes 422 validation errors when clients send developer role messages - Maintains backward compatibility with all existing roles --- app/models/openai_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/openai_models.py b/app/models/openai_models.py index 71534ba..b352ce1 100644 --- a/app/models/openai_models.py +++ b/app/models/openai_models.py @@ -10,7 +10,7 @@ from pydantic import BaseModel, Field class ChatMessage(BaseModel): """A chat message in the conversation.""" - role: Literal["system", "user", "assistant", "function", "tool"] + role: Literal["system", "user", "assistant", "function", "tool", "developer"] content: Optional[str] = None name: Optional[str] = None function_call: Optional[Dict[str, Any]] = None