From 342550c1e24cc3e354c4afde92940da28ace9a32 Mon Sep 17 00:00:00 2001 From: Dean Wampler Date: Thu, 7 Aug 2025 13:09:57 -0400 Subject: [PATCH] docs: Added comment about a known limitation of AgentEventLogger (#2930) # What does this PR do? `AgentEventLogger` only supports streaming responses, so I suggest adding a comment near the bottom of `demo_script.py` letting the user know this, e.g., if they change the `stream` value to `False` in the call to `create_turn`, they need to comment out the logging lines. See https://github.com/llamastack/llama-stack-client-python/issues/15 ## Test Plan --------- Signed-off-by: Dean Wampler --- docs/source/getting_started/demo_script.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/source/getting_started/demo_script.py b/docs/source/getting_started/demo_script.py index 298fd9899..777fc78c2 100644 --- a/docs/source/getting_started/demo_script.py +++ b/docs/source/getting_started/demo_script.py @@ -52,11 +52,16 @@ agent = Agent( prompt = "How do you do great work?" print("prompt>", prompt) +use_stream = True response = agent.create_turn( messages=[{"role": "user", "content": prompt}], session_id=agent.create_session("rag_session"), - stream=True, + stream=use_stream, ) -for log in AgentEventLogger().log(response): - log.print() +# Only call `AgentEventLogger().log(response)` for streaming responses. +if use_stream: + for log in AgentEventLogger().log(response): + log.print() +else: + print(response)