- How you use it
- A setting in your project
- What it can do
- installs software · writes files · network · secrets access · runs shell
- What's inside
The option
| Option | AConfig · v2.3.7Opik local output checks |
|---|---|
| How you use it | A setting in your project |
| What it can do | installs software · writes files · network · secrets access · runs shell |
| What's inside |
What this thread does
Do first: Compare an output string with an expected reference using Equals.
What it is
Opik provides a Python SDK for tracing and evaluation.
Use it when
Use Equals() for exact string matches and Contains for substring checks (Contains can be case-insensitive).
Not for
This thread covers only Equals and Contains checks on supplied strings. For the Opik dashboard, use Opik Cloud or deploy a self-hosted server.
Install
1. Use Python >=3.10. 2. Create an isolated environment and install the pinned SDK: Our recipe (not an upstream command):
python3 -m venv .venv && .venv/bin/python -m pip install opik==2.3.7
Check
Our recipe instruction: run the examples from the directory containing .venv. Our recipe (not an upstream command):
.venv/bin/python -c 'print(__import__("opik.evaluation.metrics", fromlist=["Equals"]).Equals().score(output="hello", reference="hello").value)'
.venv/bin/python -c 'print(__import__("opik.evaluation.metrics", fromlist=["Contains"]).Contains(case_sensitive=False).score(output="Hello world !", reference="Hello").value)'
Limits
Equals checks that the output exactly matches an expected string; Contains checks that the output contains a substring. Cloud tracing requires an Opik Cloud account; self-hosting is a separate deployment option.
Sources
Started from a post by @comet-ml, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.