Add support for 'developer' role in chat messages
- 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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user