From 43d70ad37812c7d5ebd653a560637d6edc097985 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 21 Oct 2024 15:50:21 -0500 Subject: [PATCH] update example --- .../misc/src/events_chunk_stream.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docs/griptape-framework/misc/src/events_chunk_stream.py b/docs/griptape-framework/misc/src/events_chunk_stream.py index 62501b8d6..3ab5517f4 100644 --- a/docs/griptape-framework/misc/src/events_chunk_stream.py +++ b/docs/griptape-framework/misc/src/events_chunk_stream.py @@ -4,22 +4,14 @@ from griptape.tasks import ToolkitTask from griptape.tools import PromptSummaryTool, WebScraperTool - -def action_chunk_listener(event: ActionChunkEvent) -> None: - if event.tag is not None and event.name is not None and event.path is not None: - print(f"{event.name}.{event.tag} ({event.path}) ", end="", flush=True) - if event.partial_input is not None: - print(event.partial_input, end="", flush=True) - - EventBus.add_event_listeners( [ EventListener( - lambda e: print(e.token, end="", flush=True), + lambda e: print(str(e), end="", flush=True), event_types=[TextChunkEvent], ), EventListener( - action_chunk_listener, + lambda e: print(str(e), end="", flush=True), event_types=[ActionChunkEvent], ), ]