Types
OnFailAction
class OnFailAction(str, Enum)
OnFailAction is an Enum that represents the different actions that can be taken when a validation fails.
Attributes:
REASKLiteral["reask"] - On failure, Reask the LLM.FIXLiteral["fix"] - On failure, apply a static fix.FILTERLiteral["filter"] - On failure, filter out the invalid values.REFRAINLiteral["refrain"] - On failure, refrain from responding; return an empty value.NOOPLiteral["noop"] - On failure, do nothing.EXCEPTIONLiteral["exception"] - On failure, raise a ValidationError.FIX_REASKLiteral["fix_reask"] - On failure, apply a static fix, check if the fixed value passed validation, if not then reask the LLM.CUSTOMLiteral["custom"] - On failure, call a custom function with the invalid value and the FailResult's from any validators run on the value.
RailTypes
class RailTypes(str, Enum)
RailTypes is an Enum that represents the builtin tags for RAIL xml.
Attributes:
STRINGLiteral["string"] - A string value.INTEGERLiteral["integer"] - An integer value.FLOATLiteral["float"] - A float value.BOOLLiteral["bool"] - A boolean value.DATELiteral["date"] - A date value.TIMELiteral["time"] - A time value. DATETIME (Literal["date-time: - A datetime value.PERCENTAGELiteral["percentage"] - A percentage value represented as a string. Example "20.5%".ENUMLiteral["enum"] - An enum value.LISTLiteral["list"] - A list/array value.OBJECTLiteral["object"] - An object/dictionary value.CHOICELiteral["choice"] - The options for a discrimated union.CASELiteral["case"] - A dictionary that contains a discrimated union.
MessageHistory
MessageHistory = List[Dict[str, Union[Prompt, str]]]
ModelOrListOfModels
ModelOrListOfModels = Union[Type[BaseModel], Type[List[Type[BaseModel]]]]
ModelOrListOrDict
ModelOrListOrDict = Union[Type[BaseModel], Type[List[Type[BaseModel]]],
Type[Dict[str, Type[BaseModel]]]]
ModelOrModelUnion
ModelOrModelUnion = Union[Type[BaseModel], Union[Type[BaseModel], Any]]
PydanticValidatorTuple
PydanticValidatorTuple = Tuple[Union[Validator, str, Callable], str]
PydanticValidatorSpec
PydanticValidatorSpec = Union[Validator, PydanticValidatorTuple]
UseValidatorSpec
UseValidatorSpec = Union[Validator, Type[Validator]]
UseManyValidatorTuple
UseManyValidatorTuple = Tuple[
Type[Validator],
Optional[Union[List[Any], Dict[str, Any]]],
Optional[Dict[str, Any]],
]
UseManyValidatorSpec
UseManyValidatorSpec = Union[Validator, UseManyValidatorTuple]
ValidatorMap
ValidatorMap = Dict[str, List[Validator]]