feat: add streaming result support to flows and crews

* feat: add streaming result support to flows and crews
* docs: add streaming execution documentation and integration tests
This commit is contained in:
Greyson LaLonde
2025-11-24 15:43:48 -05:00
committed by GitHub
parent a978267fa2
commit f3c5d1e351
21 changed files with 15819 additions and 37 deletions

View File

@@ -897,6 +897,31 @@ flow = ExampleFlow()
result = flow.kickoff()
```
### Streaming Flow Execution
For real-time visibility into flow execution, you can enable streaming to receive output as it's generated:
```python
class StreamingFlow(Flow):
stream = True # Enable streaming
@start()
def research(self):
# Your flow implementation
pass
# Iterate over streaming output
flow = StreamingFlow()
streaming = flow.kickoff()
for chunk in streaming:
print(chunk.content, end="", flush=True)
# Access final result
result = streaming.result
```
Learn more about streaming in the [Streaming Flow Execution](/en/learn/streaming-flow-execution) guide.
### Using the CLI
Starting from version 0.103.0, you can run flows using the `crewai run` command: