whylogs_container.whylabs.llm_validation.actions¶
Functions
|
|
|
Pick the worst action between a normal workflow and a score workflow that consumed the metrics of the former. |
Classes
|
|
|
An enumeration. |
- class whylogs_container.whylabs.llm_validation.actions.Action(*, action_type: ActionType | Any = 'pass', message: str | None = None)¶
Bases:
BaseModel
- action_type: ActionType | Any¶
- message: 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]] = {'action_type': FieldInfo(annotation=Union[ActionType, Any], required=False, default='pass'), 'message': FieldInfo(annotation=Union[str, 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.
- class whylogs_container.whylabs.llm_validation.actions.ActionType(value)¶
Bases:
Enum
An enumeration.
- BLOCK_ACTION = 'block'¶
- FLAG_ACTION = 'flag'¶
- PASS_ACTION = 'pass'¶
- whylogs_container.whylabs.llm_validation.actions.get_action(result: WorkflowResult, config: ConfigInstance, dataset_id: str, org_id: str) Action ¶
- whylogs_container.whylabs.llm_validation.actions.worst_action(action: Action, score_action: Action | None) Action ¶
Pick the worst action between a normal workflow and a score workflow that consumed the metrics of the former.
If we have both then we prefer the one with the more severe flag. If they have the same flag level then we prefer the score_action.