Commit 584c7d56 authored by ceerrep's avatar ceerrep
Browse files

fix: object type for non-streaming response

parent 6d45871d
...@@ -33,7 +33,7 @@ async def chat_completion(request:Request,create:ChatCompletionCreate): ...@@ -33,7 +33,7 @@ async def chat_completion(request:Request,create:ChatCompletionCreate):
yield chunk yield chunk
return chat_stream_response(request,inner()) return chat_stream_response(request,inner())
else: else:
comp = ChatCompletionObject(id=id,object='chat.completion.chunk',created=int(time())) comp = ChatCompletionObject(id=id,object='chat.completion',created=int(time()))
comp.usage = Usage(completion_tokens=1, prompt_tokens=1, total_tokens=2) comp.usage = Usage(completion_tokens=1, prompt_tokens=1, total_tokens=2)
async for token in interface.inference(input_message,id): async for token in interface.inference(input_message,id):
comp.append_token(token) comp.append_token(token)
......
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