whylogs_container.whylabs.llm_validation.metadata

Classes

ConfigurationMetadata(config_error, ...)

ModuleDefinition(*, module[, ...])

ValidationMetadata([validator_name, ...])

ValidationReport(failures)

YamlConfig(*, whylabs_dataset_id, policy, ...)

class whylogs_container.whylabs.llm_validation.metadata.ConfigurationMetadata(config_error: bool, timestamp: int, message: str)

Bases: object

config_error: bool
message: str
timestamp: int
class whylogs_container.whylabs.llm_validation.metadata.ModuleDefinition(*, module: Literal['toxicity', 'sentiment', 'themes', 'textstat', 'regexes', 'input_output'], upper_threshold: float | int | None = None, lower_threshold: float | int | None = None, include_upper: bool | None = None, config_path: str | None = None, metric: str | None = None)

Bases: BaseModel

config_path: str | None
include_upper: bool | None
lower_threshold: float | int | None
metric: str | None
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]] = {'config_path': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'include_upper': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'lower_threshold': FieldInfo(annotation=Union[float, int, NoneType], required=False, default=None), 'metric': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'module': FieldInfo(annotation=Literal['toxicity', 'sentiment', 'themes', 'textstat', 'regexes', 'input_output'], required=True), 'upper_threshold': FieldInfo(annotation=Union[float, int, NoneType], required=False, default=None)}

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

This replaces Model.__fields__ from Pydantic V1.

module: Literal['toxicity', 'sentiment', 'themes', 'textstat', 'regexes', 'input_output']
upper_threshold: float | int | None
class whylogs_container.whylabs.llm_validation.metadata.ValidationMetadata(validator_name: str | None = None, failed_metric: str | None = None, value: str | int | float | NoneType = None, timestamp: int | None = None, is_valid: bool | None = False)

Bases: object

failed_metric: str | None = None
is_valid: bool | None = False
timestamp: int | None = None
validator_name: str | None = None
value: str | int | float | None = None
class whylogs_container.whylabs.llm_validation.metadata.ValidationReport(failures: List[whylogs_container.whylabs.llm_validation.metadata.ValidationMetadata])

Bases: object

failures: List[ValidationMetadata]
class whylogs_container.whylabs.llm_validation.metadata.YamlConfig(*, whylabs_dataset_id: str, policy: str, id: str, policy_version: str, schema_version: str, rules: Dict[Literal['prompt', 'response'], List[ModuleDefinition]] = {}, profiling: List[Literal['toxicity', 'sentiment', 'themes', 'textstat', 'regexes', 'input_output', 'all']] = [])

Bases: BaseModel

id: str
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]] = {'id': FieldInfo(annotation=str, required=True), 'policy': FieldInfo(annotation=str, required=True), 'policy_version': FieldInfo(annotation=str, required=True), 'profiling': FieldInfo(annotation=List[Literal['toxicity', 'sentiment', 'themes', 'textstat', 'regexes', 'input_output', 'all']], required=False, default=[]), 'rules': FieldInfo(annotation=Dict[Literal['prompt', 'response'], List[ModuleDefinition]], required=False, default={}), 'schema_version': FieldInfo(annotation=str, required=True), 'whylabs_dataset_id': FieldInfo(annotation=str, required=True)}

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

This replaces Model.__fields__ from Pydantic V1.

policy: str
policy_version: str
profiling: List[Literal['toxicity', 'sentiment', 'themes', 'textstat', 'regexes', 'input_output', 'all']]
rules: Dict[Literal['prompt', 'response'], List[ModuleDefinition]]
schema_version: str
whylabs_dataset_id: str