Python SDK
Install the Shimmer package and connect your Python agent to your org.
On this page
Install shimmer-sdk from your Python package manager. The package provides the shimmer CLI, the ShimmerTest harness base class, and integration tools for collecting your agent’s behavior.
Install the package
pip install shimmer-sdk
Python 3.11 or newer is required. Install your agent’s dependencies in the same environment.
Harness input
Your harness defines a ShimmerTest class for each suite:
from shimmer import ShimmerTest, UserMessage
from support_bot import SupportBot
class TestRefunds(ShimmerTest):
suite = "refunds"
def run(self, messages: list[UserMessage]) -> None:
bot = SupportBot()
for message in messages:
bot.reply(message.text)
messages contains every user message from a test case, in order. The return value is ignored; Shimmer collects the instrumented interaction and evaluates that trace.
Point the CLI at this module with --path harness, or set the GitHub Action’s harness input to harness. See Write a Python harness for parallel runs, asynchronous agents, and module layout.
Test execution
Use the CLI or the Shimmer GitHub Action to execute a suite. Both call your test’s run once per case, in parallel processes, and handle suite lookup, execution, and trace collection for you.
Execution and evaluation are separate: your agent can run successfully and still fail a behavioral criterion. Review the run and its assertions in your Shimmer org.
The runner reports missing or ambiguous suites, disabled tracing, exceptions raised by run, collection failures, and unsuccessful evaluation verdicts. See Run and compare for how to read results.
Data models
ShimmerTest is the base class for your harness tests. Set suite and implement run.
UserMessage is one user turn from a test case. Read message.text and pass it to your agent.
The model is frozen. Treat the input as immutable; keep agent-specific setup and state inside your harness or application.
Integrations
Use LangSmith instrumentation to capture the activity inside your harness. Set LANGSMITH_TRACING=local to collect for Shimmer without also uploading to LangSmith.
For recorded tool-result preparation with the synchronous OpenAI client, import shim_openai from shimmer.openai.