| | |
- get_model_name(orch_config: dict, keys: list[str], error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> Any
- Retrieves the value from orch_config using the list of keys provided.
If any key in the path is missing, logs an error and returns None.
Args:
orch_config (dict): The orchestration configuration JSON object.
keys (list): List of keys representing the path to the desired field.
error_collector (ValidationCollector): The error collector to log errors.
Returns:
The value at the specified path in orch_config, or None if any key is missing.
- get_prompt_templating_config(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Returns the prompt_templating configuration from the orchestration config.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- get_template_key(orch_config: dict, keys: list[str], error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> Any
- Retrieves the value from orch_config using the list of keys provided.
If any key in the path is missing, logs an error and returns None.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param keys: List of keys representing the path to the desired field.
:type keys: list[str]
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: The value at the specified path in orch_config, or None if any key is missing.
:rtype: Any | None
- get_template_list_from_orch_config(orch_config: dict) -> list
- Returns the template list from the orchestration config.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:return: The template list from the orchestration config.
:rtype: list
- to_comparable(x) -> Union[dict, Any]
- Converts an object to a comparable format (dict or primitive).
Handles Pydantic v1, Pydantic v2, custom classes, and primitives.
:param x: The object to convert.
:type x: Any
:return: Dictionary representation or the primitive value.
:rtype: dict | Any
- validate_if_all_grounding_input_params_present_in_prompt_variables(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if all the input params of the grounding module exist in the prompt variables for v2 configuration.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_if_content_inside_template_is_empty_in_templating_module_config(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if the template list is an array and is a valid dict and content exists in template.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_if_grounding_output_present_in_prompt_variables(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if the grounding output parameter is present in prompt variables.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_if_image_url_is_provided_in_content_type_inside_templating_module_config(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if inside the template list of templating_module_config if it has image_url type inside the content.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_if_template_list_is_empty(orch_config: dict, keys: list[str], error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if template list exists and is not empty.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param keys: List of keys representing the path to the template list.
:type keys: list[str]
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_if_template_list_is_empty_in_templating_module_config(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if template list exists and is not empty in the templating module config.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_mandatory_modules(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector, module_key: str, required_keys: list[str], config_keys: list[str]) -> None
- Validates the presence of mandatory modules and their structure.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:param module_key: The key of the module to validate.
:type module_key: str
:param required_keys: List of required keys in the module.
:type required_keys: list[str]
:param config_keys: List of configuration keys to validate as dictionaries.
:type config_keys: list[str]
:return: None
:rtype: None
- validate_model_name(orch_config: dict, keys: list[str], error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if llm_module_config is a dict and the model name exists.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param keys: List of keys representing the path to the model name.
:type keys: list[str]
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_model_name_in_llm_module_config(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if the model configuration in llm_module_config is a dict and the model name exists.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_orch_config_mandatory_modules(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if the outer structure of the orchestration config is valid and exists.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_orchestration_params_from_evaluation_config(evaluation_configs: List[gen_ai_hub.evaluations.models.evaluation_config.EvaluationConfig], error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates orchestration parameters from evaluation configuration.
Ensures that either orchestration_registry_reference is provided alone,
or both template and llm are provided together.
:param evaluation_configs: List of evaluation configuration objects.
:type evaluation_configs: List[EvaluationConfig]
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
- validate_template_ref_absent_in_config(orch_config: dict, error_collector: gen_ai_hub.evaluations.helpers.collector.ValidationCollector) -> None
- Validates if template_ref is given in templating module config and raises an error.
:param orch_config: The orchestration configuration dictionary.
:type orch_config: dict
:param error_collector: ValidationCollector instance for collecting validation errors.
:type error_collector: ValidationCollector
:return: None
:rtype: None
|