src.asqi.schemas¶
Attributes¶
Classes¶
Corresponds to HuggingFace's Value feature type. |
|
Corresponds to HuggingFace's List/Sequence feature type. |
|
Corresponds to HuggingFace's "Python dict" feature type. |
|
Corresponds to HuggingFace's ClassLabel feature type. Represents categorical data with named categories. |
|
Corresponds to HuggingFace's Image feature type. |
|
Corresponds to HuggingFace's Audio feature type. |
|
Corresponds to HuggingFace's Video feature type. |
|
Defines a feature/column within a dataset. |
|
Defines a system input that the container requires. |
|
Defines a parameter that can be passed to the test container. |
|
Defines a metric that will be present in the test container's output. |
|
Defines a file artifact generated by the test container. |
|
Defines an environment variable required by the test container. |
|
Supported dataset types for InputDataset. |
|
Defines a dataset input that the container requires. |
|
Defines a report that will be generated by the test container. |
|
Defines a dataset output that will be generated by the test container. |
|
Schema for the manifest.yaml file inside a test container. |
|
Base system definition. |
|
Parameters for the LLM API systems. |
|
Parameters for Vision Language Model API systems. |
|
Configuration for LLM API systems. |
|
Configuration for RAG API systems. |
|
Configuration for Image Generation API systems. |
|
Configuration for Image Editing API systems. |
|
Configuration for Vision Language Model API systems. |
|
Generic system configuration for system types without specific validation. |
|
Schema for the top-level systems configuration file. |
|
Parameters for loading a HuggingFace dataset from the mounted folder in the container. |
|
Defines a reusable HuggingFace dataset that can be referenced by name in test suites and generation jobs. |
|
Base class for file-based dataset definitions. |
|
Defines a PDF document dataset that can be referenced by name in test suites and generation jobs. |
|
Defines a plain text file dataset that can be referenced by name in test suites and generation jobs. |
|
Schema for datasets configuration file. |
|
Base class for test configuration fields shared between TestDefinition and TestSuiteDefault. |
|
A single test to be executed. |
|
Default values that apply to all tests in the suite unless overridden. |
|
Schema for the top-level Test Suite configuration file. |
|
Defines which test results an indicator applies to. |
|
Individual assessment outcome with condition. |
|
Expression-based metric evaluation with explicit value declarations. |
|
Individual score card indicator with filtering and assessment. |
|
Assessment outcome for audit indicators. |
|
Manual audit indicator. |
|
Complete grading score card configuration. |
|
!!! abstract "Usage Documentation" |
|
!!! abstract "Usage Documentation" |
|
!!! abstract "Usage Documentation" |
|
Schema for the data generation configuration manifest. |
|
Tags for workflow execution tracking. |
|
Metadata structure passed from workflow to test containers. |
Module Contents¶
- src.asqi.schemas.IDsStringPattern¶
- src.asqi.schemas.HFDtype¶
- class src.asqi.schemas.ValueFeature(/, **data: Any)¶
Bases:
pydantic.BaseModelCorresponds to HuggingFace’s Value feature type. Represents a scalar value feature (string, int64, float32, bool, etc.)
- feature_type: Literal['Value'] = None¶
- name: str = None¶
- dtype: HFDtype = None¶
- required: bool = None¶
- description: str | None = None¶
- class src.asqi.schemas.ListFeature(/, **data: Any)¶
Bases:
pydantic.BaseModelCorresponds to HuggingFace’s List/Sequence feature type.
- feature_type: Literal['List'] = None¶
- name: str = None¶
- feature: HFDtype | Literal['Image', 'Audio', 'Video', 'ClassLabel', 'Dict', 'List'] = None¶
- length: int = None¶
- required: bool = None¶
- description: str | None = None¶
- class src.asqi.schemas.DictFeature(/, **data: Any)¶
Bases:
pydantic.BaseModelCorresponds to HuggingFace’s “Python dict” feature type.
- feature_type: Literal['Dict'] = None¶
- name: str = None¶
- fields: List[HFFeature] = None¶
- required: bool = None¶
- description: str | None = None¶
- class src.asqi.schemas.ClassLabelFeature(/, **data: Any)¶
Bases:
pydantic.BaseModelCorresponds to HuggingFace’s ClassLabel feature type. Represents categorical data with named categories.
- feature_type: Literal['ClassLabel'] = None¶
- name: str = None¶
- names: List[str] = None¶
- required: bool = None¶
- description: str | None = None¶
- class src.asqi.schemas.ImageFeature(/, **data: Any)¶
Bases:
pydantic.BaseModelCorresponds to HuggingFace’s Image feature type.
- feature_type: Literal['Image'] = None¶
- name: str = None¶
- required: bool = None¶
- description: str | None = None¶
- class src.asqi.schemas.AudioFeature(/, **data: Any)¶
Bases:
pydantic.BaseModelCorresponds to HuggingFace’s Audio feature type.
- feature_type: Literal['Audio'] = None¶
- name: str = None¶
- required: bool = None¶
- description: str | None = None¶
- class src.asqi.schemas.VideoFeature(/, **data: Any)¶
Bases:
pydantic.BaseModelCorresponds to HuggingFace’s Video feature type.
- feature_type: Literal['Video'] = None¶
- name: str = None¶
- required: bool = None¶
- description: str | None = None¶
- class src.asqi.schemas.DatasetFeature(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines a feature/column within a dataset.
The dtype field uses HuggingFace datasets dtype values. Common types: ‘string’, ‘int64’, ‘float32’, ‘bool’.
- name: str = None¶
- dtype: HFDtype = None¶
- required: bool = None¶
- description: str | None = None¶
- src.asqi.schemas.HFFeature¶
- class src.asqi.schemas.SystemInput(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines a system input that the container requires.
- name: str = None¶
- type: str | List[str] = None¶
- required: bool = None¶
- description: str | None = None¶
- class src.asqi.schemas.InputParameter(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines a parameter that can be passed to the test container. Supports simple types (string, integer, float, boolean) as well as list, object, enum.
- name: str = None¶
- type: Literal['string', 'integer', 'float', 'boolean', 'list', 'object', 'enum'] = None¶
- required: bool = None¶
- description: str | None = None¶
- items: Literal['string', 'integer', 'float', 'boolean', 'object', 'enum'] | InputParameter | None = None¶
- properties: List[InputParameter] | None = None¶
- choices: List[str | int | float] | None = None¶
- default: str | int | float | bool | List | Dict | None = None¶
- validate_rich_fields() InputParameter¶
Validate that rich-type fields are only used with appropriate types.
- class src.asqi.schemas.OutputMetric(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines a metric that will be present in the test container’s output.
- name: str¶
- type: Literal['string', 'integer', 'float', 'boolean', 'list', 'object']¶
- description: str | None = None¶
- class src.asqi.schemas.OutputArtifact(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines a file artifact generated by the test container.
- name: str¶
- path: str¶
- description: str | None = None¶
- class src.asqi.schemas.EnvironmentVariable(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines an environment variable required by the test container.
- name: str = None¶
- required: bool = None¶
- description: str | None = None¶
- class src.asqi.schemas.DatasetType¶
Bases:
enum.StrEnumSupported dataset types for InputDataset.
- HUGGINGFACE = 'huggingface'¶
- PDF = 'pdf'¶
- TXT = 'txt'¶
- class src.asqi.schemas.InputDataset(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines a dataset input that the container requires.
Supported dataset types: - ‘huggingface’: HuggingFace datasets (requires features to be defined) - ‘pdf’: PDF documents - ‘txt’: Plain text files
Supports “either/or” relationships by accepting multiple types: - type: “pdf” - Single type - type: [“pdf”, “txt”] - Either PDF or TXT - type: [“huggingface”, “pdf”, “txt”] - Any of these formats
- name: str = None¶
- required: bool = None¶
- type: DatasetType | List[DatasetType] = None¶
- description: str | None = None¶
- features: List[DatasetFeature | HFFeature] | None = None¶
- class src.asqi.schemas.OutputReports(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines a report that will be generated by the test container.
- name: str = None¶
- type: Literal['pdf', 'html'] = None¶
- description: str | None = None¶
- class src.asqi.schemas.OutputDataset(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines a dataset output that will be generated by the test container.
- name: str = None¶
- type: DatasetType = None¶
- description: str | None = None¶
- features: List[DatasetFeature | HFFeature] | None = None¶
- class src.asqi.schemas.Manifest(/, **data: Any)¶
Bases:
pydantic.BaseModelSchema for the manifest.yaml file inside a test container.
- name: str = None¶
- version: str¶
- description: str | None = None¶
- host_access: bool = None¶
- input_systems: List[SystemInput] = None¶
- input_schema: List[InputParameter] = None¶
- input_datasets: list[InputDataset] = None¶
- output_metrics: List[str] | List[OutputMetric] = None¶
- output_artifacts: List[OutputArtifact] | None = None¶
- environment_variables: List[EnvironmentVariable] = None¶
- output_reports: List[OutputReports] = None¶
- output_datasets: List[OutputDataset] = None¶
- class src.asqi.schemas.SystemDefinition(/, **data: Any)¶
Bases:
pydantic.BaseModelBase system definition.
- description: str | None = None¶
- provider: str | None = None¶
- class src.asqi.schemas.LLMAPIParams(/, **data: Any)¶
Bases:
pydantic.BaseModelParameters for the LLM API systems.
- base_url: str = None¶
- model: str = None¶
- env_file: str | None = None¶
- api_key: str | None = None¶
- class src.asqi.schemas.VLMAPIParams(/, **data: Any)¶
Bases:
LLMAPIParamsParameters for Vision Language Model API systems.
- supports_vision: Literal[True] = None¶
- class src.asqi.schemas.LLMAPIConfig(/, **data: Any)¶
Bases:
SystemDefinitionConfiguration for LLM API systems.
- type: Literal['llm_api'] = None¶
- params: LLMAPIParams = None¶
- class src.asqi.schemas.RAGAPIConfig(/, **data: Any)¶
Bases:
SystemDefinitionConfiguration for RAG API systems.
- type: Literal['rag_api'] = None¶
- params: LLMAPIParams = None¶
- class src.asqi.schemas.ImageGenerationAPIConfig(/, **data: Any)¶
Bases:
SystemDefinitionConfiguration for Image Generation API systems.
- type: Literal['image_generation_api'] = None¶
- params: LLMAPIParams = None¶
- class src.asqi.schemas.ImageEditingAPIConfig(/, **data: Any)¶
Bases:
SystemDefinitionConfiguration for Image Editing API systems.
- type: Literal['image_editing_api'] = None¶
- params: LLMAPIParams = None¶
- class src.asqi.schemas.VLMAPIConfig(/, **data: Any)¶
Bases:
SystemDefinitionConfiguration for Vision Language Model API systems.
- type: Literal['vlm_api'] = None¶
- params: VLMAPIParams = None¶
- class src.asqi.schemas.GenericSystemConfig(/, **data: Any)¶
Bases:
SystemDefinitionGeneric system configuration for system types without specific validation.
This allows backward compatibility and support for system types that don’t have dedicated config classes yet.
- type: str = None¶
- params: Dict[str, Any] = None¶
- src.asqi.schemas.SystemConfig¶
- class src.asqi.schemas.SystemsConfig(/, **data: Any)¶
Bases:
pydantic.BaseModelSchema for the top-level systems configuration file.
- Extension Guide:
Create a new XXXConfig class inheriting from SystemDefinition. e.g, RESTAPIConfig
2. Create a new XXXParam class for the parameters of the system. e.g. RESTAPIParams 2. Add the new system definition (XXXConfig) to the SystemConfig union type
e.g. SystemConfig = Union[LLMAPIConfig, XXXConfig, …, GenericSystemConfig]
- systems: Dict[str, SystemConfig] = None¶
- class src.asqi.schemas.DatasetLoaderParams(/, **data: Any)¶
Bases:
pydantic.BaseModelParameters for loading a HuggingFace dataset from the mounted folder in the container.
- builder_name: Literal['json', 'csv', 'parquet', 'arrow', 'text', 'xml', 'webdataset', 'imagefolder', 'audiofolder', 'videofolder'] = None¶
- data_dir: str | None = None¶
- data_files: str | list[str] | None = None¶
- revision: str | None = None¶
- class src.asqi.schemas.HFDatasetDefinition(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines a reusable HuggingFace dataset that can be referenced by name in test suites and generation jobs.
- type: Literal['huggingface'] = None¶
- description: str | None = None¶
- loader_params: DatasetLoaderParams = None¶
- mapping: dict[str, str] = None¶
- tags: list[str] = None¶
- class src.asqi.schemas.FileDatasetBase(/, **data: Any)¶
Bases:
pydantic.BaseModelBase class for file-based dataset definitions.
- description: str | None = None¶
- file_path: str = None¶
- tags: list[str] = None¶
- class src.asqi.schemas.PDFDatasetDefinition(/, **data: Any)¶
Bases:
FileDatasetBaseDefines a PDF document dataset that can be referenced by name in test suites and generation jobs.
- type: Literal['pdf'] = None¶
- class src.asqi.schemas.TXTDatasetDefinition(/, **data: Any)¶
Bases:
FileDatasetBaseDefines a plain text file dataset that can be referenced by name in test suites and generation jobs.
- type: Literal['txt'] = None¶
- src.asqi.schemas.DatasetDefinition¶
- class src.asqi.schemas.DatasetsConfig(/, **data: Any)¶
Bases:
pydantic.BaseModelSchema for datasets configuration file.
Datasets are defined in a dictionary where keys are dataset names. Each dataset must specify a ‘type’ field that determines its schema: - ‘huggingface’: HuggingFace datasets with loader_params - ‘pdf’: PDF document datasets with file_path - ‘txt’: Plain text file datasets with file_path
- datasets: Dict[str, DatasetDefinition] = None¶
- class src.asqi.schemas.TestDefinitionBase(/, **data: Any)¶
Bases:
pydantic.BaseModelBase class for test configuration fields shared between TestDefinition and TestSuiteDefault.
- systems_under_test: List[str] | None = None¶
- systems: Dict[str, str] | None = None¶
- tags: List[str] | None = None¶
- params: Dict[str, Any] | None = None¶
- input_datasets: Dict[str, str] | None = None¶
- volumes: Dict[str, Any] | None = None¶
- env_file: str | None = None¶
- environment: Dict[str, str] | None = None¶
- class src.asqi.schemas.TestDefinition(/, **data: Any)¶
Bases:
TestDefinitionBaseA single test to be executed.
- id: IDsStringPattern = None¶
- name: str | None = None¶
- description: str | None = None¶
- image: str = None¶
- class src.asqi.schemas.TestSuiteDefault(/, **data: Any)¶
Bases:
TestDefinitionBaseDefault values that apply to all tests in the suite unless overridden.
- class src.asqi.schemas.SuiteConfig(/, **data: Any)¶
Bases:
pydantic.BaseModelSchema for the top-level Test Suite configuration file.
- suite_name: str = None¶
- test_suite_default: TestSuiteDefault | None = None¶
- description: str | None = None¶
- test_suite: List[TestDefinition] = None¶
- class src.asqi.schemas.ScoreCardFilter(/, **data: Any)¶
Bases:
pydantic.BaseModelDefines which test results an indicator applies to.
- test_id: str = None¶
- target_system_type: str | List[str] | None = None¶
- class src.asqi.schemas.AssessmentRule(/, **data: Any)¶
Bases:
pydantic.BaseModelIndividual assessment outcome with condition.
- outcome: str = None¶
- condition: Literal['equal_to', 'greater_than', 'less_than', 'greater_equal', 'less_equal', 'all_true', 'any_false', 'count_equals'] = None¶
- threshold: int | float | bool | None = None¶
- description: str | None = None¶
- class src.asqi.schemas.MetricExpression(/, **data: Any)¶
Bases:
pydantic.BaseModelExpression-based metric evaluation with explicit value declarations.
- expression: str = None¶
- values: Dict[str, str] = None¶
- class src.asqi.schemas.ScoreCardIndicator(/, **data: Any)¶
Bases:
pydantic.BaseModelIndividual score card indicator with filtering and assessment.
- id: IDsStringPattern = None¶
- name: str | None = None¶
- apply_to: ScoreCardFilter = None¶
- metric: str | MetricExpression = None¶
- assessment: List[AssessmentRule] = None¶
- display_reports: List[str] = None¶
- class src.asqi.schemas.AuditAssessmentRule(/, **data: Any)¶
Bases:
pydantic.BaseModelAssessment outcome for audit indicators.
- outcome: str = None¶
- description: str | None = None¶
- class src.asqi.schemas.AuditScoreCardIndicator(/, **data: Any)¶
Bases:
pydantic.BaseModelManual audit indicator.
Outcome is provided via an external audit responses file.
- id: IDsStringPattern = None¶
- type: Literal['audit'] = None¶
- name: str | None = None¶
- assessment: List[AuditAssessmentRule] = None¶
- class src.asqi.schemas.ScoreCard(/, **data: Any)¶
Bases:
pydantic.BaseModelComplete grading score card configuration.
- score_card_name: str = None¶
- indicators: List[ScoreCardIndicator | AuditScoreCardIndicator] = None¶
- class src.asqi.schemas.AuditResponse(/, **data: Any)¶
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- Attributes:
__class_vars__: The names of the class variables defined on the model. __private_attributes__: Metadata about the private attributes of the model. __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
__pydantic_complete__: Whether model building is completed, or if there are still undefined fields. __pydantic_core_schema__: The core schema of the model. __pydantic_custom_init__: Whether the model has a custom __init__ function. __pydantic_decorators__: Metadata containing the decorators defined on the model.
This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to
__args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. __pydantic_post_init__: The name of the post-init method for the model, if defined. __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel]. __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model. __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
__pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra]
is set to ‘allow’.
__pydantic_fields_set__: The names of fields explicitly set during instantiation. __pydantic_private__: Values of private attributes set on the model instance.
- indicator_id: str = None¶
- sut_name: str | None = None¶
- selected_outcome: str = None¶
- notes: str | None = None¶
- class src.asqi.schemas.AuditResponses(/, **data: Any)¶
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- Attributes:
__class_vars__: The names of the class variables defined on the model. __private_attributes__: Metadata about the private attributes of the model. __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
__pydantic_complete__: Whether model building is completed, or if there are still undefined fields. __pydantic_core_schema__: The core schema of the model. __pydantic_custom_init__: Whether the model has a custom __init__ function. __pydantic_decorators__: Metadata containing the decorators defined on the model.
This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to
__args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. __pydantic_post_init__: The name of the post-init method for the model, if defined. __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel]. __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model. __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
__pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra]
is set to ‘allow’.
__pydantic_fields_set__: The names of fields explicitly set during instantiation. __pydantic_private__: Values of private attributes set on the model instance.
- responses: List[AuditResponse]¶
- class src.asqi.schemas.GenerationJobConfig(/, **data: Any)¶
Bases:
pydantic.BaseModel- !!! abstract “Usage Documentation”
[Models](../concepts/models.md)
A base class for creating Pydantic models.
- Attributes:
__class_vars__: The names of the class variables defined on the model. __private_attributes__: Metadata about the private attributes of the model. __signature__: The synthesized __init__ [Signature][inspect.Signature] of the model.
__pydantic_complete__: Whether model building is completed, or if there are still undefined fields. __pydantic_core_schema__: The core schema of the model. __pydantic_custom_init__: Whether the model has a custom __init__ function. __pydantic_decorators__: Metadata containing the decorators defined on the model.
This replaces Model.__validators__ and Model.__root_validators__ from Pydantic V1.
- __pydantic_generic_metadata__: Metadata for generic models; contains data used for a similar purpose to
__args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these.
__pydantic_parent_namespace__: Parent namespace of the model, used for automatic rebuilding of models. __pydantic_post_init__: The name of the post-init method for the model, if defined. __pydantic_root_model__: Whether the model is a [RootModel][pydantic.root_model.RootModel]. __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the model. __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the model.
__pydantic_fields__: A dictionary of field names and their corresponding [FieldInfo][pydantic.fields.FieldInfo] objects. __pydantic_computed_fields__: A dictionary of computed field names and their corresponding [ComputedFieldInfo][pydantic.fields.ComputedFieldInfo] objects.
- __pydantic_extra__: A dictionary containing extra values, if [extra][pydantic.config.ConfigDict.extra]
is set to ‘allow’.
__pydantic_fields_set__: The names of fields explicitly set during instantiation. __pydantic_private__: Values of private attributes set on the model instance.
- id: str = None¶
- systems: Dict[str, str] | None = None¶
- name: str = None¶
- image: str = None¶
- tags: List[str] | None = None¶
- input_datasets: Dict[str, str] | None = None¶
- params: Dict[str, Any] | None = None¶
- volumes: Dict[str, Any] | None = None¶
- env_file: str | None = None¶
- environment: Dict[str, str] | None = None¶
- class src.asqi.schemas.DataGenerationConfig(/, **data: Any)¶
Bases:
pydantic.BaseModelSchema for the data generation configuration manifest.
- job_name: str = None¶
- generation_jobs: List[GenerationJobConfig] = None¶
- class src.asqi.schemas.ExecutionTags(/, **data: Any)¶
Bases:
pydantic.BaseModelTags for workflow execution tracking.
- parent_id: str = None¶
- job_type: str = None¶
- job_id: str = None¶
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class src.asqi.schemas.ExecutionMetadata(/, **data: Any)¶
Bases:
pydantic.BaseModelMetadata structure passed from workflow to test containers.
- tags: ExecutionTags = None¶
- user_id: str | None = None¶
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].