Unverified Commit a6d471c7 authored by Jae-Won Chung's avatar Jae-Won Chung Committed by GitHub
Browse files

Fix: `AttributeError` in OpenAI-compatible server (#3018)

parent 01a5d18a
......@@ -57,7 +57,7 @@ class UsageInfo(BaseModel):
class ChatCompletionRequest(BaseModel):
model: str
messages: Union[str, List[Dict[str, str]]]
messages: List[Dict[str, str]]
temperature: Optional[float] = 0.7
top_p: Optional[float] = 1.0
n: Optional[int] = 1
......
......@@ -80,7 +80,7 @@ class OpenAIServingChat(OpenAIServing):
if request.add_generation_prompt:
return self.response_role
else:
return request.messages[-1].role
return request.messages[-1]["role"]
async def chat_completion_stream_generator(
self, request: ChatCompletionRequest,
......
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