Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion validmind/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -143,6 +143,7 @@ def check_version():
"unit_metrics",
"test_suites",
"log_text",
"log_test_result",
# experimental features
"experimental_agent",
]
29 changes: 29 additions & 0 deletions validmind/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down