Skip to content

Commit

Permalink
Replace system roles in responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Amnah199 committed Aug 27, 2024
1 parent 611b05d commit 7483bc6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _get_response(self, response_body: GenerationResponse) -> List[ChatMessage]:
for candidate in response_body.candidates:
for part in candidate.content.parts:
if part._raw_part.text != "":
replies.append(ChatMessage.from_system(part.text))
replies.append(ChatMessage.from_assistant(part.text))
elif part.function_call is not None:
replies.append(
ChatMessage(
Expand Down Expand Up @@ -264,4 +264,4 @@ def _get_stream_response(
responses.append(streaming_chunk.content)

combined_response = "".join(responses).lstrip()
return [ChatMessage.from_system(content=combined_response)]
return [ChatMessage.from_assistant(content=combined_response)]

0 comments on commit 7483bc6

Please sign in to comment.