Skip to content

Prompt stack schema

PromptStackSchema

Bases: BaseSchema

Source code in griptape/griptape/schemas/utils/prompt_stack_schema.py
class PromptStackSchema(BaseSchema):
    inputs = fields.List(fields.Nested(PromptStackInputSchema()))

    @post_load
    def make_obj(self, data, **kwargs):
        from griptape.utils.prompt_stack import PromptStack

        return PromptStack(**data)

inputs = fields.List(fields.Nested(PromptStackInputSchema())) class-attribute instance-attribute

make_obj(data, **kwargs)

Source code in griptape/griptape/schemas/utils/prompt_stack_schema.py
@post_load
def make_obj(self, data, **kwargs):
    from griptape.utils.prompt_stack import PromptStack

    return PromptStack(**data)