diff --git a/pyproject.toml b/pyproject.toml index b171896cc..ce47b3dff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "validmind" -version = "2.11.0" +version = "2.11.1" description = "ValidMind Library" readme = "README.pypi.md" requires-python = ">=3.9,<3.13" diff --git a/validmind/__init__.py b/validmind/__init__.py index 5b96ea574..8093f59af 100644 --- a/validmind/__init__.py +++ b/validmind/__init__.py @@ -50,7 +50,7 @@ from . import scorer from .__version__ import __version__ # noqa: E402 -from .api_client import init, log_metric, log_text, reload +from .api_client import init, log_metric, log_test_result, log_text, reload from .client import ( # noqa: E402 get_test_suite, init_dataset, @@ -143,6 +143,7 @@ def check_version(): "unit_metrics", "test_suites", "log_text", + "log_test_result", # experimental features "experimental_agent", ] diff --git a/validmind/api_client.py b/validmind/api_client.py index c0d14dac8..d5722efdb 100644 --- a/validmind/api_client.py +++ b/validmind/api_client.py @@ -365,6 +365,35 @@ async def alog_test_result( raise e +def log_test_result( + result: Dict[str, Any], + section_id: str = None, + position: int = None, + unsafe: bool = False, + config: Dict[str, bool] = None, +) -> Dict[str, Any]: + """Logs test results information. + + Args: + result (dict): A dictionary representing the test result. + section_id (str, optional): The section ID add a test driven block to the documentation. + position (int): The position in the section to add the test driven block. + unsafe (bool): If True, log the result even if it contains sensitive data. + config (Dict[str, bool]): Configuration options for displaying the test result. + + Returns: + dict: The response from the API. + """ + return run_async( + alog_test_result, + result=result, + section_id=section_id, + position=position, + unsafe=unsafe, + config=config, + ) + + async def alog_input( input_id: str, type: str, metadata: Dict[str, Any] ) -> Dict[str, Any]: