Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest log10 updates to include url to evaluation page #322

Merged
merged 1 commit into from
Oct 8, 2024
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
6 changes: 6 additions & 0 deletions src/log10/pytest_log10_managed_evaluation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions src/log10/pytest_log10_managed_evaluation/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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: <url-placeholder>")
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)
Expand Down
3 changes: 3 additions & 0 deletions src/log10/pytest_log10_managed_evaluation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def create_log10_test_run(eval_name: str):
name
reportUploadUrl
createdAt
organization {
slug
}
}
}
"""
Expand Down
Loading