Skip to content

Commit

Permalink
make Vertex compatible with new ChatMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Dec 18, 2024
1 parent 7f62ca8 commit 50e90a6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ 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(content=part._raw_part.text, meta=metadata))
replies.append(ChatMessage.from_assistant(part._raw_part.text, meta=metadata))
elif part.function_call:
metadata["function_call"] = part.function_call
new_message = ChatMessage.from_assistant(
content=json.dumps(dict(part.function_call.args)), meta=metadata
json.dumps(dict(part.function_call.args)), meta=metadata
)
new_message.name = part.function_call.name
replies.append(new_message)
Expand Down

0 comments on commit 50e90a6

Please sign in to comment.