Skip to content

Commit

Permalink
fix: make Ollama Chat Generator compatible with new ChatMessage (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 authored Dec 18, 2024
1 parent 7f62ca8 commit aff6748
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _build_message_from_ollama_response(self, ollama_response: ChatResponse) ->
Converts the non-streaming response from the Ollama API to a ChatMessage.
"""
response_dict = ollama_response.model_dump()
message = ChatMessage.from_assistant(content=response_dict["message"]["content"])
message = ChatMessage.from_assistant(response_dict["message"]["content"])
message.meta.update({key: value for key, value in response_dict.items() if key != "message"})
return message

Expand Down

0 comments on commit aff6748

Please sign in to comment.