aiq.data_models.interactive#

Attributes#

Classes#

HumanPromptModelType

Represents the type of an interaction model.

BinaryChoiceOptionsType

Represents the types of system interaction binary choice content

MultipleChoiceOptionType

Represents the types of system interaction multiple choice content

BinaryHumanPromptOption

Represents a choice for a binary interaction.

MultipleChoiceOption

HumanResponseText

Represents a text response to an interaction.

HumanResponseNotification

Represents a notification response to an interaction.

HumanResponseBinary

Represents a binary response to an interaction.

HumanResponseRadio

Represents a multiple choice radio response to an interaction.

HumanResponseCheckbox

Represents a multiple choice checkbox response to an interaction.

HumanResponseDropdown

Represents a multiple choice dropdown response to an interaction.

HumanPromptBase

Base interaction model to derive from

HumanPromptText

Represents a text interaction.

HumanPromptNotification

Represents a notification interaction.

HumanPromptBinary

Represents a binary interaction.

HumanPromptMultipleChoiceBase

Represents a multiple choice interaction.

HumanPromptRadio

Represents a radio interaction.

HumanPromptCheckbox

Represents a checkbox interaction.

HumanPromptDropdown

Represents a dropdown interaction.

InteractionStatus

Represents the status of an interaction.

InteractionBase

Represents a system-human interaction.

InteractionPrompt

Represents a system-human interaction with a prompt.

InteractionResponse

Represents a system-human interaction with a response.

Module Contents#

class HumanPromptModelType#

Bases: str, enum.Enum

Represents the type of an interaction model.

Initialize self. See help(type(self)) for accurate signature.

TEXT = 'text'#
NOTIFICATION = 'notification'#
BINARY_CHOICE = 'binary_choice'#
RADIO = 'radio'#
CHECKBOX = 'checkbox'#
DROPDOWN = 'dropdown'#
class BinaryChoiceOptionsType#

Bases: str, enum.Enum

Represents the types of system interaction binary choice content

Initialize self. See help(type(self)) for accurate signature.

CONTINUE = 'continue'#
CANCEL = 'cancel'#
class MultipleChoiceOptionType#

Bases: str, enum.Enum

Represents the types of system interaction multiple choice content

Initialize self. See help(type(self)) for accurate signature.

EMAIL = 'email'#
SMS = 'sms'#
PUSH = 'push'#
class BinaryHumanPromptOption(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a choice for a binary interaction.

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.

id: str = None#
label: str = None#
value: Any = None#
class MultipleChoiceOption(/, **data: Any)#

Bases: pydantic.BaseModel

id: str = None#
label: str = None#
value: str = None#
description: str = None#
class HumanResponseText(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a text response to an interaction.

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.

type: Literal[HumanPromptModelType]#
text: str = None#
class HumanResponseNotification(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a notification response to an interaction.

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.

type: Literal[HumanPromptModelType]#
text: str = None#
class HumanResponseBinary(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a binary response to an interaction.

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.

type: Literal[HumanPromptModelType]#
selected_option: BinaryHumanPromptOption = None#
class HumanResponseRadio(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a multiple choice radio response to an interaction.

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.

type: Literal[HumanPromptModelType]#
selected_option: MultipleChoiceOption = None#
class HumanResponseCheckbox(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a multiple choice checkbox response to an interaction.

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.

type: Literal[HumanPromptModelType]#
selected_option: MultipleChoiceOption = None#
class HumanResponseDropdown(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a multiple choice dropdown response to an interaction.

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.

type: Literal[HumanPromptModelType]#
selected_option: MultipleChoiceOption = None#
HumanResponse#
class HumanPromptBase(/, **data: Any)#

Bases: pydantic.BaseModel

Base interaction model to derive from

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.

text: str = None#
class HumanPromptText(/, **data: Any)#

Bases: HumanPromptBase

Represents a text interaction.

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.

input_type: Literal[HumanPromptModelType]#
placeholder: str | None = None#
required: bool = None#
class HumanPromptNotification(/, **data: Any)#

Bases: HumanPromptBase

Represents a notification interaction.

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.

input_type: Literal[HumanPromptModelType]#
class HumanPromptBinary(/, **data: Any)#

Bases: HumanPromptBase

Represents a binary interaction.

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.

input_type: Literal[HumanPromptModelType]#
options: list[BinaryHumanPromptOption] = None#
classmethod validate_options(options)#
class HumanPromptMultipleChoiceBase(/, **data: Any)#

Bases: HumanPromptBase

Represents a multiple choice interaction.

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.

options: list[MultipleChoiceOption] = None#
class HumanPromptRadio(/, **data: Any)#

Bases: HumanPromptMultipleChoiceBase

Represents a radio interaction.

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.

input_type: Literal[HumanPromptModelType]#
class HumanPromptCheckbox(/, **data: Any)#

Bases: HumanPromptMultipleChoiceBase

Represents a checkbox interaction.

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.

input_type: Literal[HumanPromptModelType]#
class HumanPromptDropdown(/, **data: Any)#

Bases: HumanPromptMultipleChoiceBase

Represents a dropdown interaction.

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.

input_type: Literal[HumanPromptModelType]#
HumanPrompt#
class InteractionStatus#

Bases: str, enum.Enum

Represents the status of an interaction.

Initialize self. See help(type(self)) for accurate signature.

PENDING = 'pending'#
IN_PROGRESS = 'in_progress'#
COMPLETED = 'completed'#
FAILED = 'failed'#
class InteractionBase(/, **data: Any)#

Bases: pydantic.BaseModel

Represents a system-human interaction.

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.

id: str = None#
type: str = None#
thread_id: str | None = None#
parent_id: str | None = None#
status: InteractionStatus = None#
timestamp: str = None#
classmethod validate_timestamp(timestamp)#
class InteractionPrompt(/, **data: Any)#

Bases: InteractionBase

Represents a system-human interaction with a prompt.

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.

content: HumanPrompt = None#
class InteractionResponse(/, **data: Any)#

Bases: InteractionBase

Represents a system-human interaction with a response.

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.

content: HumanResponse = None#