Skip to content

Commit

Permalink
Update models
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Feb 7, 2025
1 parent 3a47fe7 commit 64e07ef
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions libs/agno/agno/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,11 +892,12 @@ def response(self, messages: List[Message]) -> ModelResponse:
# Log response and metrics
assistant_message.log(metrics=True)

# TODO(dirk): i dont think this is needed
# Update model response with assistant message content and audio
if assistant_message.content is not None:
model_response.content = assistant_message.get_content_string()
if assistant_message.audio_output is not None:
model_response.audio = assistant_message.audio_output
# if assistant_message.content is not None:
# model_response.content = assistant_message.get_content_string()
# if assistant_message.audio_output is not None:
# model_response.audio = assistant_message.audio_output

# Handle tool calls
if (
Expand Down Expand Up @@ -947,11 +948,12 @@ async def aresponse(self, messages: List[Message]) -> ModelResponse:
# Log response and metrics
assistant_message.log(metrics=True)

# TODO(dirk): i dont think this is needed
# Update model response with assistant message content and audio
if assistant_message.content is not None:
model_response.content = assistant_message.get_content_string()
if assistant_message.audio_output is not None:
model_response.audio = assistant_message.audio_output
# if assistant_message.content is not None:
# model_response.content = assistant_message.get_content_string()
# if assistant_message.audio_output is not None:
# model_response.audio = assistant_message.audio_output

# Handle tool calls
if (
Expand Down Expand Up @@ -1019,6 +1021,7 @@ def response_stream(self, messages: List[Message]) -> Iterator[ModelResponse]:
# Generate response
assistant_message.metrics.start_timer()
for response in self.invoke_stream(messages=messages):
# Parse model response chunk
model_response = self.parse_model_response_chunk(response)
if model_response is not None:
yield model_response
Expand Down

0 comments on commit 64e07ef

Please sign in to comment.