Skip to content

Commit

Permalink
Merge pull request #156 from PrefectHQ/streaming
Browse files Browse the repository at this point in the history
Fix streaming prints
  • Loading branch information
jlowin authored Jun 21, 2024
2 parents 0171239 + 4cd3b0f commit 496feed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controlflow/llm/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from controlflow.llm.messages import (
AIMessage,
AIMessageChunk,
MessageType,
ToolMessage,
)
Expand Down Expand Up @@ -36,7 +37,7 @@ def format_message(
panels = []
if isinstance(message, ToolMessage):
return format_tool_message(message, width=width)
elif isinstance(message, AIMessage):
elif isinstance(message, (AIMessage, AIMessageChunk)):
if message.content:
panels.append(format_text_message(message, width=width))

Expand Down

0 comments on commit 496feed

Please sign in to comment.