From e7d9543f437c0acd861517efa22cdc737af0ba03 Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Wed, 9 Oct 2024 13:19:38 -0700 Subject: [PATCH] Fix example for inspecting payloads --- docs/griptape-framework/misc/src/events_6.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/griptape-framework/misc/src/events_6.py b/docs/griptape-framework/misc/src/events_6.py index 25934442a5..0bfa9426b3 100644 --- a/docs/griptape-framework/misc/src/events_6.py +++ b/docs/griptape-framework/misc/src/events_6.py @@ -1,15 +1,15 @@ from griptape.events import BaseEvent, EventBus, EventListener, StartPromptEvent from griptape.structures import Agent -EventBus.add_event_listeners([EventListener(handler=lambda e: print(e), event_types=[StartPromptEvent])]) - def handler(event: BaseEvent) -> None: if isinstance(event, StartPromptEvent): print("Prompt Stack Messages:") for message in event.prompt_stack.messages: - print(f"{message.role}: {message.content}") + print(f"{message.role}: {message.to_text()}") + +EventBus.add_event_listeners([EventListener(handler=handler, event_types=[StartPromptEvent])]) agent = Agent()