events
EventBus = _EventBus()
module-attribute
__all__ = ['BaseEvent', 'BaseTaskEvent', 'StartTaskEvent', 'FinishTaskEvent', 'BaseActionsSubtaskEvent', 'StartActionsSubtaskEvent', 'FinishActionsSubtaskEvent', 'BasePromptEvent', 'StartPromptEvent', 'FinishPromptEvent', 'StartStructureRunEvent', 'FinishStructureRunEvent', 'CompletionChunkEvent', 'EventListener', 'StartImageGenerationEvent', 'FinishImageGenerationEvent', 'StartImageQueryEvent', 'FinishImageQueryEvent', 'BaseTextToSpeechEvent', 'StartTextToSpeechEvent', 'FinishTextToSpeechEvent', 'BaseAudioTranscriptionEvent', 'StartAudioTranscriptionEvent', 'FinishAudioTranscriptionEvent', 'EventBus']
module-attribute
BaseActionsSubtaskEvent
Bases: BaseTaskEvent
, ABC
Source code in griptape/events/base_actions_subtask_event.py
subtask_actions: Optional[list[dict]] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
subtask_parent_task_id: Optional[str] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
subtask_thought: Optional[str] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
from_task(task)
classmethod
Source code in griptape/events/base_actions_subtask_event.py
BaseAudioTranscriptionEvent
BaseEvent
Bases: SerializableMixin
, ABC
Source code in griptape/events/base_event.py
id: str = field(default=Factory(lambda: uuid.uuid4().hex), kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
meta: dict[str, Any] = field(factory=dict, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
timestamp: float = field(default=Factory(lambda: time.time()), kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
BasePromptEvent
BaseTaskEvent
Bases: BaseEvent
, ABC
Source code in griptape/events/base_task_event.py
task_child_ids: list[str] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
task_id: str = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
task_input: BaseArtifact = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
task_output: Optional[BaseArtifact] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
task_parent_ids: list[str] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
BaseTextToSpeechEvent
CompletionChunkEvent
EventListener
Source code in griptape/events/event_listener.py
driver: Optional[BaseEventListenerDriver] = field(default=None, kw_only=True)
class-attribute
instance-attribute
event_types: Optional[list[type[BaseEvent]]] = field(default=None, kw_only=True)
class-attribute
instance-attribute
handler: Callable[[BaseEvent], Optional[dict]] = field(default=Factory(lambda: lambda event: event.to_dict()))
class-attribute
instance-attribute
__enter__()
__exit__(type, value, traceback)
publish_event(event, *, flush=False)
Source code in griptape/events/event_listener.py
FinishActionsSubtaskEvent
FinishAudioTranscriptionEvent
Bases: BaseAudioTranscriptionEvent
Source code in griptape/events/finish_audio_transcription_event.py
FinishImageGenerationEvent
FinishImageQueryEvent
Bases: BaseImageQueryEvent
Source code in griptape/events/finish_image_query_event.py
result: str = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
FinishPromptEvent
Bases: BasePromptEvent
Source code in griptape/events/finish_prompt_event.py
input_token_count: Optional[float] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
output_token_count: Optional[float] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
result: str = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
FinishStructureRunEvent
Bases: BaseEvent
Source code in griptape/events/finish_structure_run_event.py
output_task_input: BaseArtifact = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
output_task_output: Optional[BaseArtifact] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
structure_id: Optional[str] = field(kw_only=True, default=None, metadata={'serializable': True})
class-attribute
instance-attribute
FinishTaskEvent
FinishTextToSpeechEvent
StartActionsSubtaskEvent
StartAudioTranscriptionEvent
Bases: BaseAudioTranscriptionEvent
Source code in griptape/events/start_audio_transcription_event.py
StartImageGenerationEvent
Bases: BaseImageGenerationEvent
Source code in griptape/events/start_image_generation_event.py
negative_prompts: Optional[list[str]] = field(default=None, kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
prompts: list[str] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
StartImageQueryEvent
Bases: BaseImageQueryEvent
Source code in griptape/events/start_image_query_event.py
images_info: list[str] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
query: str = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
StartPromptEvent
Bases: BasePromptEvent
Source code in griptape/events/start_prompt_event.py
prompt_stack: PromptStack = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
StartStructureRunEvent
Bases: BaseEvent
Source code in griptape/events/start_structure_run_event.py
input_task_input: BaseArtifact = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
input_task_output: Optional[BaseArtifact] = field(kw_only=True, metadata={'serializable': True})
class-attribute
instance-attribute
structure_id: Optional[str] = field(kw_only=True, default=None, metadata={'serializable': True})
class-attribute
instance-attribute
StartTaskEvent
StartTextToSpeechEvent
Bases: BaseTextToSpeechEvent