Skip to content

Start prompt event schema

StartPromptEventSchema

Bases: BasePromptEventSchema

Source code in griptape/griptape/schemas/events/start_prompt_event_schema.py
class StartPromptEventSchema(BasePromptEventSchema):
    prompt_stack = fields.Nested(PromptStackSchema())
    prompt = fields.Str()

    @post_load
    def make_obj(self, data, **kwargs):
        from griptape.events import StartPromptEvent

        return StartPromptEvent(**data)

prompt = fields.Str() class-attribute instance-attribute

prompt_stack = fields.Nested(PromptStackSchema()) class-attribute instance-attribute

make_obj(data, **kwargs)

Source code in griptape/griptape/schemas/events/start_prompt_event_schema.py
@post_load
def make_obj(self, data, **kwargs):
    from griptape.events import StartPromptEvent

    return StartPromptEvent(**data)