Install giskard-checks to create evaluations (evals) for LLM-based systems. This library supports simple assertions and LLM-as-judge assessments (like Groundedness, Conformity, and LLMJudge) to handle non-deterministic outputs. Use it to catch regressions, validate RAG quality, enforce safety, and evaluate multi-turn agents.
Note: The run() method is asynchronous and should be wrapped with asyncio.run() in scripts.
from openai import OpenAI
from giskard.checks import Scenario, Groundedness
client = OpenAI()
def get_answer(inputs: str) -> str:
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[{"role": "user", "content": inputs}],
)
return response.choices[0].message.content
scenario = (
Scenario("test_dynamic_output")
.interact(
inputs="What is the capital of France?",
outputs=get_answer,
)
.check(
Groundedness(
name="answer is grounded",
context="France is a country in Western Europe. Its capital is Paris.",
)
)
)
result = await scenario.run()
result.print_report()