Skip to content

Start image generation event schema

StartImageGenerationEventSchema

Bases: BaseImageGenerationEventSchema

Source code in griptape/griptape/schemas/events/start_image_generation_event_schema.py
class StartImageGenerationEventSchema(BaseImageGenerationEventSchema):
    prompts = fields.List(fields.Str())
    negative_prompts = fields.List(fields.Str())

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

        return StartImageGenerationEvent(**data)

negative_prompts = fields.List(fields.Str()) class-attribute instance-attribute

prompts = fields.List(fields.Str()) class-attribute instance-attribute

make_obj(data, **kwargs)

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

    return StartImageGenerationEvent(**data)