Model (autotransform.model.base)

The base class and associated classes for Model components.

class autotransform.model.base.Model

Bases: Generic[TResultData], NamedComponent

The base for Model components. Used by AutoTransform to interact with AI models such as LLMs.

name

The name of the Component.

Type:

ClassVar[ModelName]

abstract get_result_for_item(item: FileItem) Tuple[str, TResultData]

Gets a completion for a FileItem, usually used to find new file content.

Parameters:

item (FileItem) – The FileItem to get the result for.

Returns:

The result for the Item along with any information needed

for future completions with validation.

Return type:

Tuple[str, TResultData]

abstract get_result_with_validation(item: FileItem, result_data: TResultData, validation_failures: Sequence[ValidationResult]) Tuple[str, TResultData]

Gets a new result based on ValidationResult issues.

Parameters:
  • item (FileItem) – The FileItem to get the result for.

  • result_data (TResultData) – The previously returned result data.

  • validation_failures (Sequence[ValidationResult]) – The validation failures.

Returns:

The result for the failures along with any information needed

for future completions.

Return type:

Tuple[str, TResultData]

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: ClassVar[ModelName]
class autotransform.model.base.ModelName(value)

Bases: str, Enum

A simple enum for mapping.

OPEN_AI = 'open_ai'