Skip to content

Commit

Permalink
Merge pull request #1527 from phidatahq/fix/gemini_parts
Browse files Browse the repository at this point in the history
fix/gemini_parts
  • Loading branch information
ashpreetbedi authored Dec 9, 2024
2 parents 1b1dfc3 + 7e92ad3 commit 09ad4b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions phi/model/google/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,9 @@ def response(self, messages: List[Message]) -> ModelResponse:
model_response.content = assistant_message.get_content_string()

# -*- Remove parts from messages
for m in messages:
if hasattr(m, "parts"):
m.parts = None
# for m in messages:
# if hasattr(m, "parts"):
# m.parts = None

logger.debug("---------- Gemini Response End ----------")
return model_response
Expand Down Expand Up @@ -623,8 +623,8 @@ def response_stream(self, messages: List[Message]) -> Iterator[ModelResponse]:
yield from self.response_stream(messages=messages)

# -*- Remove parts from messages
for m in messages:
if hasattr(m, "parts"):
m.parts = None
# for m in messages:
# if hasattr(m, "parts"):
# m.parts = None

logger.debug("---------- Gemini Response End ----------")

0 comments on commit 09ad4b7

Please sign in to comment.