Share via


InputVariable Class

Input variable for a prompt template.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Constructor

InputVariable(*, name: str, description: str | None = '', default: Any | None = '', is_required: bool | None = True, json_schema: str | None = '', allow_dangerously_set_content: bool = False)

Parameters

Name Description
name
Required

The name of the input variable.

description
Required

The description of the input variable.

default
Required

The default value of the input variable.

is_required
Required

Whether the input variable is required.

json_schema
Required

The JSON schema for the input variable.

allow_dangerously_set_content
Required

Allow content without encoding, this controls if this variable is encoded before use, default is False.

Keyword-Only Parameters

Name Description
name
Required
description
Required
default
Required
is_required
Default value: True
json_schema
Required
allow_dangerously_set_content
Required

Attributes

allow_dangerously_set_content

allow_dangerously_set_content: bool

default

default: Any | None

description

description: str | None

is_required

is_required: bool | None

json_schema

json_schema: str | None

name

name: str