mirror of
https://github.com/langchain-ai/docs.git
synced 2026-08-27 21:00:00 -04:00
14 lines
317 B
Plaintext
14 lines
317 B
Plaintext
```python
|
|
question = "Which genre on average has the longest tracks?"
|
|
|
|
stream = agent.stream_events(
|
|
{"messages": [{"role": "user", "content": question}]},
|
|
version="v3",
|
|
)
|
|
for message in stream.messages:
|
|
for token in message.text:
|
|
print(token, end="", flush=True)
|
|
|
|
final_state = stream.output
|
|
```
|