Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Agent output streams #1116

ChristianWeyer started this conversation in Feature Requests
Jan 21, 2024 · 12 comments · 2 replies
Discussion options

I just saw that AutoGen is planning to add an output streams feature beyond console output.
microsoft/autogen#1290 (comment)

This would be great if crewAI would provide a similar feature.

You must be logged in to vote

Replies: 12 comments 2 replies

Comment options

Interesting, curious to hear more about the use cases so we can get something that is great for those, anything comes to mind?

You must be logged in to vote
0 replies
Comment options

One use case would be to stream, agent result to a web frontend.
Another could be to have really distributed agents working together.

You must be logged in to vote
0 replies
Comment options

I agree, i'd like to send answers via WebSockets to a web client.

You must be logged in to vote
0 replies
Comment options

I also want to be able to stream live output to a frontend.

Seems like it is also related to #146

You must be logged in to vote
0 replies
Comment options

Currently I found a workaround to capture terminal output while crew.kickoff() is working with subprocess and to stream the stdout. It’s ugly and gets unsupported characters, but at least can stream.

You must be logged in to vote
0 replies
Comment options

Currently I found a workaround to capture terminal output while crew.kickoff() is working with subprocess and to stream the stdout. It’s ugly and gets unsupported characters, but at least can stream.

please, share the code
i'm currently doing it like this with "verbose=2" and it sucks

from io import StringIO # Python 3
import sys
# Create the in-memory "file"
temp_out = StringIO()
# Replace default stdout (terminal) with our stream
sys.stdout = temp_out
print("This is going in to the memory stream")

Sometimes i see agents questions to one another in console, i'd really like to capture these too
They write pretty high quality prompts into each other, gathering these would be 100% useful

You must be logged in to vote
0 replies
Comment options

Capture stdout would be a dream. Capturing chain of thought reasoning for audit logs and such.

You must be logged in to vote
0 replies
Comment options

Any news on this?

You must be logged in to vote
0 replies
Comment options

If CrewAI could add streaming outputs, it would be a breakthrough

You must be logged in to vote
0 replies
Comment options

I genuinely don’t want to use this:

from typing import AsyncGenerator
import time
async def stream(text: str, chunk_size: int = 4, sleep: float = 0.03) -> AsyncGenerator:
 """Generator function to yield chunks of the final answer."""
 for i in range(0, len(text), chunk_size):
 time.sleep(sleep)
 yield text[i : i + chunk_size]
text = "This is a test message. This is a piece of text that will be streamed. This is the final message."
async for chunk in stream(text):
 print(chunk, end="")
You must be logged in to vote
0 replies
Comment options

+1 on this feature.

You must be logged in to vote
2 replies
Comment options

Anything update?

Comment options

yeah, i switched to pydanticAI.

Comment options

+1

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Converted from issue

This discussion was converted from issue #169 on August 07, 2024 10:15.

AltStyle によって変換されたページ (->オリジナル) /