Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

deepeval-evaluation

БесплатноБез исполняемых скриптовНе проверен

Use for any question or task about testing an LLM or RAG app with pytest, including hallucination checks in CI and answers that invent facts missing from the…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

deepeval-evaluation

Overview

Per de-start, DeepEval is "an open-source LLM eval package" enabling "evaluation of LLM applications locally through test cases and metrics." The model: each test constructs an LLMTestCase, applies one or more Metric instances, and either asserts (assert_test) or batch-evaluates (evaluate). Pytest discovery + reporting works unchanged.

When to use

  • The repo already uses pytest; LLM tests should live alongside unit tests.
  • The user works with RAG and needs Faithfulness / Contextual-* metrics without writing them from scratch.
  • The team wants a managed dashboard (Confident-AI) for regression tracking + prompt-vs-prompt comparison.
  • Programmatic test-case authoring (data-driven from a CSV/JSONL) is needed and pytest fixtures fit better than YAML config.

Step 1 - Install

Per de-gh and de-start:

pip install -U deepeval

Optional Confident-AI login (for dashboard):

deepeval login

Per de-start: after login "Confident AI will generate testing reports and automate regression testing whenever you run a test run."

Step 2 - First test

Per de-gh (verbatim quickstart):

import pytest
from deepeval import assert_test
from deepeval.metrics import GEval
from deepeval.test_case import LLMTestCase, SingleTurnParams

def test_case():
    correctness_metric = GEval(
        name="Correctness",
        criteria="Determine if the 'actual output' is correct based on the 'expected output'.",
        evaluation_params=[SingleTurnParams.ACTUAL_OUTPUT, SingleTurnParams.EXPECTED_OUTPUT],
        threshold=0.5
    )
    test_case = LLMTestCase(
        input="What if these shoes don't fit?",
        actual_output="You have 30 days to get a full refund at no extra cost.",
        expected_output="We offer a 30-day full refund at no extra costs.",
        retrieval_context=["All customers are eligible for a 30 day full refund at no extra costs."]
    )
    assert_test(test_case, [correctness_metric])

Run it:

deepeval test run test_chatbot.py

(Per de-gh.)

Step 3 - LLMTestCase fields

Per de-start, LLMTestCase fields:

Field Required Notes
input yes The user prompt / query
actual_output yes What the LLM produced
expected_output optional Reference answer (used by metrics that compare)
retrieval_context optional The chunks your retriever actually returned for this input, at test time. Faithfulness and the Contextual-* metrics judge against it
context optional Ground-truth reference text you supply. Only HallucinationMetric reads it; passing retrieved chunks here leaves Faithfulness with nothing to check (de-halluc)

Step 3b - A golden set that can fail

A suite only catches what its cases can expose. Three gaps let an inventing bot pass:

  • Expected answers copied from the app. If expected_output was saved from the bot's own replies, every comparison metric measures the bot against itself. Write expected answers by hand, or have a person check each one against the source documents.
  • No unanswerable questions. Add questions the knowledge base does not answer (a policy it never mentions, a product you do not sell) and check the reply declines, says it does not know, or hands off. Use a G-Eval criterion for that behaviour, since an answer-relevancy metric rewards a confident invented answer:
from deepeval.metrics import GEval
from deepeval.test_case import SingleTurnParams

JUDGE_MODEL = "<one dated judge model id>"  # pinned once, used by every metric

declines = GEval(
    name="Declines when the docs are silent",
    criteria="The retrieved context does not answer the question. Pass only if the "
             "actual output says it cannot confirm the answer or offers a hand-off, "
             "and states no policy, number or date that is absent from the context.",
    evaluation_params=[SingleTurnParams.INPUT, SingleTurnParams.ACTUAL_OUTPUT,
                       SingleTurnParams.RETRIEVAL_CONTEXT],
    threshold=0.8,
    model=JUDGE_MODEL,
)
  • Only happy-path topics. Cover the questions that went wrong in production and the ones with exact facts (windows, prices, limits).

Step 4 - Metric catalog

Per de-gh the available metrics include:

Metric Use
GEval Custom rubric-based scoring (LLM-as-judge with chain-of-thought)
`Answe
Полный SKILL.md на GitHub

Установить deepeval-evaluation в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonevals/deepeval-geval-config/criteria.jsonevals/deepeval-geval-config/task.mdevals/deepeval-invented-policy/criteria.jsonevals/deepeval-invented-policy/task.mdevals/deepeval-multiturn-v4/criteria.jsonevals/deepeval-multiturn-v4/task.mdevals/green-suite-missed-a-shipped-regression/criteria.jsonevals/green-suite-missed-a-shipped-regression/task.mdevals/nightly-job-dies-at-the-two-hour-mark/criteria.jsonevals/nightly-job-dies-at-the-two-hour-mark/task.mdevals/policy-checks-switched-off-since-june/criteria.jsonevals/policy-checks-switched-off-since-june/task.mdevals/quality-score-swings-on-answers-nobody-changed/criteria.jsonevals/quality-score-swings-on-answers-nobody-changed/task.mdevals/six-release-gates-handed-over-before-launch/criteria.jsonevals/six-release-gates-handed-over-before-launch/task.md

FAQ

Что делает скилл deepeval-evaluation?

Use for any question or task about testing an LLM or RAG app with pytest, including hallucination checks in CI and answers that invent facts missing from the retrieved documents: DeepEval LLMTestCase, built-in metrics such as G-Eval, answer relevancy, faithfulness, contextual recall and precision, hallucination, bias and toxicity, deepeval test run with assert_test, and the Confident AI dashboard.

Как установить скилл deepeval-evaluation?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл deepeval-evaluation запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить deepeval-evaluation с