src.asqi.response_schemas¶
Classes¶
Describes a single column in a dataset. |
|
Structured metadata for a generated dataset. |
|
Represents a dataset produced by a container during execution. |
|
Runtime output for a generated report. |
|
Complete container output schema. |
Functions¶
|
Validate container output against the schema. |
Module Contents¶
- class src.asqi.response_schemas.ColumnMetadata(/, **data: Any)¶
Bases:
pydantic.BaseModelDescribes a single column in a dataset.
- name: str¶
- dtype: str¶
- description: str | None = None¶
- class src.asqi.response_schemas.DatasetMetadata(/, **data: Any)¶
Bases:
pydantic.BaseModelStructured metadata for a generated dataset.
- columns: list[ColumnMetadata]¶
- row_count: int = None¶
- size_bytes: int | None = None¶
- class src.asqi.response_schemas.GeneratedDataset(/, **data: Any)¶
Bases:
pydantic.BaseModelRepresents a dataset produced by a container during execution. The paths are container-internal and get translated to host paths by the workflow system.
- dataset_name: str = None¶
- dataset_type: Literal['huggingface', 'pdf', 'txt'] = None¶
- dataset_path: str = None¶
- format: str | None = None¶
- metadata: DatasetMetadata | dict[str, Any] | None = None¶
- classmethod validate_path_not_empty(v: str) str¶
Validate that dataset_path is not empty or whitespace-only.
- classmethod validate_name_not_empty(v: str) str¶
Validate that dataset_name is not empty or whitespace-only.
- class src.asqi.response_schemas.GeneratedReport(/, **data: Any)¶
Bases:
pydantic.BaseModelRuntime output for a generated report.
Represents a report (HTML, PDF, JSON, etc.) produced by a container during execution. The paths are container-internal and get translated to host paths by the workflow system.
- report_name: str = None¶
- report_type: Literal['html', 'pdf', 'json'] = None¶
- report_path: str = None¶
- metadata: dict[str, Any] | None = None¶
- classmethod validate_path_not_empty(v: str) str¶
Validate that report_path is not empty or whitespace-only.
- classmethod validate_name_not_empty(v: str) str¶
Validate that report_name is not empty or whitespace-only.
- class src.asqi.response_schemas.ContainerOutput(/, **data: Any)¶
Bases:
pydantic.BaseModelComplete container output schema.
Supports both ‘results’ (recommended) and ‘test_results’ (legacy) field names for backward compatibility.
- results: dict[str, Any] | None = None¶
- test_results: dict[str, Any] | None = None¶
- generated_reports: list[GeneratedReport] = None¶
- generated_datasets: list[GeneratedDataset] = None¶
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod validate_results_not_empty_if_present(v: dict[str, Any] | None) dict[str, Any] | None¶
Ensure results field is not empty if present.
At least one results field must contain the ‘success’ key.
- get_results() dict[str, Any]¶
Get results, preferring ‘results’ over ‘test_results’.
- Returns:
Results dictionary, preferring ‘results’ field over ‘test_results’. Returns empty dict if neither field is present.
- src.asqi.response_schemas.validate_container_output(output_dict: dict[str, Any]) ContainerOutput¶
Validate container output against the schema.
It supports both ‘results’ (recommended) and ‘test_results’ (legacy) field names for backward compatibility.
- Args:
output_dict: Raw container output dictionary parsed from JSON
- Returns:
Validated ContainerOutput object
- Raises:
- ValidationError: If output doesn’t match schema (missing required fields,
invalid types, etc.)
ValueError: If neither ‘results’ nor ‘test_results’ field is present