Skip to content

Commit

Permalink
remove vertex changes from this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Dec 18, 2024
1 parent 1e30ded commit 8ec7433
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,12 @@ def _get_response(self, response_body: GenerationResponse) -> List[ChatMessage]:
# Remove content from metadata
metadata.pop("content", None)
if part._raw_part.text != "":
replies.append(ChatMessage.from_assistant(part._raw_part.text, meta=metadata))
replies.append(ChatMessage.from_assistant(content=part._raw_part.text, meta=metadata))
elif part.function_call:
metadata["function_call"] = part.function_call
new_message = ChatMessage.from_assistant(json.dumps(dict(part.function_call.args)), meta=metadata)
new_message = ChatMessage.from_assistant(
content=json.dumps(dict(part.function_call.args)), meta=metadata
)
new_message.name = part.function_call.name
replies.append(new_message)
return replies
Expand Down

0 comments on commit 8ec7433

Please sign in to comment.