feat: unified chat completions endpoint

This commit is contained in:
Timothy J. Baek
2024-06-09 13:17:44 -07:00
parent 7b1404f490
commit 84defafc14
3 changed files with 39 additions and 6 deletions

View File

@@ -849,9 +849,14 @@ async def generate_chat_completion(
# TODO: we should update this part once Ollama supports other types
class OpenAIChatMessageContent(BaseModel):
type: str
model_config = ConfigDict(extra="allow")
class OpenAIChatMessage(BaseModel):
role: str
content: str
content: Union[str, OpenAIChatMessageContent]
model_config = ConfigDict(extra="allow")