Add tool_calls field and make content optional in Message model

- Add optional tool_calls field to Message model
- Make content field optional with default None
- Allows assistant messages with tool_calls instead of content
- Fixes 422 validation errors for tool call messages
- Supports OpenAI message format with function calls
parent bd5b2939
......@@ -28,7 +28,8 @@ from typing import Dict, List, Optional, Union
class Message(BaseModel):
role: str
content: Union[str, List[Dict], List]
content: Union[str, List[Dict], List, None] = None
tool_calls: Optional[List[Dict]] = None
class ChatCompletionRequest(BaseModel):
model: str
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment