From b1e68a232ad8312aff2762b8a20b19af81a2457c Mon Sep 17 00:00:00 2001 From: Wenzhe Xue Date: Mon, 7 Oct 2024 21:13:50 -0700 Subject: [PATCH] pytest log10 updates: * add link to docs.log10.io * add url to log10 evaluations page * update create test run function, returning the org slug --- src/log10/pytest_log10_managed_evaluation/README.md | 6 ++++++ src/log10/pytest_log10_managed_evaluation/plugin.py | 12 +++++++----- src/log10/pytest_log10_managed_evaluation/utils.py | 3 +++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/log10/pytest_log10_managed_evaluation/README.md b/src/log10/pytest_log10_managed_evaluation/README.md index aff503f0..5c8f7248 100644 --- a/src/log10/pytest_log10_managed_evaluation/README.md +++ b/src/log10/pytest_log10_managed_evaluation/README.md @@ -2,6 +2,12 @@ A pytest plugin for managing evaluation in Log10 platform. +## Overview + +This plugin facilitates the evaluation of LLM applications using Log10. +For detailed information on how to start evaluating your LLM applications, +please refer to our [evaluation documentation](https://docs.log10.io/evaluation). + ## Installation After [configuring the Log10 environment variables](https://docs.log10.io/observability/advanced/logging#configuration), ```bash diff --git a/src/log10/pytest_log10_managed_evaluation/plugin.py b/src/log10/pytest_log10_managed_evaluation/plugin.py index 235fea27..482cdd9a 100644 --- a/src/log10/pytest_log10_managed_evaluation/plugin.py +++ b/src/log10/pytest_log10_managed_evaluation/plugin.py @@ -275,7 +275,7 @@ def pytest_sessionfinish(self, session): except OSError as e: self._terminal_summary = "could not save report: {}".format(e) else: - self._terminal_summary = "report saved to: {}".format(path) + self._terminal_summary = "Report saved to: {}".format(path) if self.log10_test_run is not None: upload_url = self.log10_test_run.get("reportUploadUrl") @@ -351,12 +351,14 @@ def pytest_terminal_summary(self, terminalreporter): terminalreporter.write_sep("=", "Log10 Eval Report") if self.log10_test_run: - terminalreporter.write_line( - f"Log10 Eval is enabled.\nTest run: {self.log10_test_run.get('name')}-{self.log10_test_run.get('id')}" - ) + test_run_name = self.log10_test_run.get("name") + test_run_id = self.log10_test_run.get("id") + terminalreporter.write_line(f"Log10 Eval is enabled.\nTest run: {test_run_name}-{test_run_id}") # todo (wenzhe) add url to managed eval page in log10 UI - terminalreporter.write_line("Log10 managed evaluation page: ") + test_run_org_slug = self.log10_test_run.get("organization", {}).get("slug") + evaluations_page_url = f"https://log10.io/app/{test_run_org_slug}/evaluations?id={test_run_id}" + terminalreporter.write_line(f"Log10 Evaluation URL: {evaluations_page_url}") else: terminalreporter.write_line("Log10 Eval runs locally.") terminalreporter.write_line(self._terminal_summary) diff --git a/src/log10/pytest_log10_managed_evaluation/utils.py b/src/log10/pytest_log10_managed_evaluation/utils.py index bd57cb59..16d12aec 100644 --- a/src/log10/pytest_log10_managed_evaluation/utils.py +++ b/src/log10/pytest_log10_managed_evaluation/utils.py @@ -13,6 +13,9 @@ def create_log10_test_run(eval_name: str): name reportUploadUrl createdAt + organization { + slug + } } } """