Skip to content

Commit

Permalink
fix: join chat message content, removing empty space
Browse files Browse the repository at this point in the history
  • Loading branch information
bhimrazy committed Jun 9, 2024
1 parent d971311 commit 2558ee9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/litserve/specs/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,11 @@ async def non_streaming_completion(self, request: ChatCompletionRequest, pipe_re
chat_msg = json.loads(chat_msg)
logger.debug(chat_msg)
chat_msg = ChatMessage(**chat_msg)
# Is " " correct choice to concat with?
msgs.append(chat_msg.content)
if chat_msg.tool_calls:
tool_calls = chat_msg.tool_calls

content = " ".join(msgs)
content = "".join(msgs)
msg = {"role": "assistant", "content": content, "tool_calls": tool_calls}
choice = ChatCompletionResponseChoice(index=i, message=msg, finish_reason="stop")
choices.append(choice)
Expand Down

0 comments on commit 2558ee9

Please sign in to comment.