diff --git a/README.md b/README.md index 3eb303a..baa83a3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + +> [!NOTE] +> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。 +> [English](./README.en.md) · [原始项目](https://github.com/confident-ai/deepeval) · [上游 README](https://github.com/confident-ai/deepeval/blob/HEAD/README.md) +> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。 +

@@ -6,7 +12,7 @@

-

The LLM Evaluation Framework

+

LLM 评估框架

@@ -24,31 +30,31 @@

- Documentation | - Metrics and Features | - Getting Started | - Integrations | + 文档 | + 指标与功能 | + 快速开始 | + 集成 | Confident AI

- GitHub release + GitHub 发布 - Try Quickstart in Colab + 在 Colab 中试用快速入门 - License + 许可证 - Twitter Follow + Twitter 关注

- + Deutsch | Español | français | @@ -59,128 +65,128 @@ 中文

-**DeepEval** is a simple-to-use, open-source LLM evaluation framework, for evaluating large-language model systems. It is similar to Pytest but specialized for unit testing LLM apps. DeepEval incorporates the latest research to run evals via metrics such as G-Eval, task completion, answer relevancy, hallucination, etc., which uses LLM-as-a-judge and other NLP models that run **locally on your machine**. +**DeepEval** 是一个简单易用的开源 LLM 评估框架,用于评估大语言模型系统。它类似于 Pytest,但专门用于对 LLM 应用进行单元测试。DeepEval 融入了最新研究,可通过 G-Eval、任务完成度(task completion)、答案相关性(answer relevancy)、幻觉(hallucination)等指标运行评估,这些指标使用 LLM-as-a-judge 以及可在**你本地机器**上运行的其他 NLP 模型。 -Whether you're building AI agents, RAG pipelines, or chatbots, implemented via LangChain or OpenAI, DeepEval has you covered. With it, you can easily determine the optimal models, prompts, and architecture to improve your AI quality, prevent prompt drifting, or even transition from OpenAI to Claude with confidence. +无论你是在构建 AI 智能体、RAG 流水线还是聊天机器人,无论通过 LangChain 还是 OpenAI 实现,DeepEval 都能满足你的需求。借助它,你可以轻松确定最优的模型、提示词和架构,以提升 AI 质量、防止提示词漂移(prompt drifting),甚至自信地从 OpenAI 迁移到 Claude。 > [!IMPORTANT] -> Need a place for your DeepEval testing data to live 🏡❤️? [Sign up to Confident AI](https://www.confident-ai.com?utm_source=deepeval&utm_medium=github&utm_content=signup_callout) to compare iterations of your LLM app, generate & share testing reports, and more. +> 需要为你的 DeepEval 测试数据找个安身之所 🏡❤️?[注册 Confident AI](https://www.confident-ai.com?utm_source=deepeval&utm_medium=github&utm_content=signup_callout),比较你的 LLM 应用各次迭代、生成并分享测试报告,等等。 > > ![Demo GIF](assets/demo.gif) -> Want to talk LLM evaluation, need help picking metrics, or just to say hi? [Come join our discord.](https://discord.com/invite/3SEyvpgu2f) +> 想讨论 LLM 评估、需要帮忙选择指标,或者只想打个招呼?[来加入我们的 Discord。](https://discord.com/invite/3SEyvpgu2f)
-# 🔥 Metrics and Features +# 🔥 指标与功能 -- 📐 Large variety of ready-to-use LLM eval metrics (all with explanations) powered by **ANY** LLM of your choice, statistical methods, or NLP models that run **locally on your machine** covering all use cases: +- 📐 大量开箱即用的 LLM 评估指标(均附带说明),由你选择的**任意** LLM、统计方法或在**你本地机器**上运行的 NLP 模型驱动,覆盖所有使用场景: - - **Custom, All-Purpose Metrics:** + - **自定义通用指标:** - - [G-Eval](https://deepeval.com/docs/metrics-llm-evals) — a research-backed LLM-as-a-judge metric for evaluating on any custom criteria with human-like accuracy - - [DAG](https://deepeval.com/docs/metrics-dag) — DeepEval's graph-based deterministic LLM-as-a-judge metric builder + - [G-Eval](https://deepeval.com/docs/metrics-llm-evals) — 基于研究的 LLM-as-a-judge 指标,可按任意自定义标准评估,具备接近人类的准确度 + - [DAG](https://deepeval.com/docs/metrics-dag) — DeepEval 基于图结构的确定性 LLM-as-a-judge 指标构建器 -
- Agentic Metrics + 智能体指标 - - [Task Completion](https://deepeval.com/docs/metrics-task-completion) — evaluate whether an agent accomplished its goal - - [Tool Correctness](https://deepeval.com/docs/metrics-tool-correctness) — check if the right tools were called with the right arguments - - [Goal Accuracy](https://deepeval.com/docs/metrics-goal-accuracy) — measure how accurately the agent achieved the intended goal - - [Step Efficiency](https://deepeval.com/docs/metrics-step-efficiency) — evaluate whether the agent took unnecessary steps - - [Plan Adherence](https://deepeval.com/docs/metrics-plan-adherence) — check if the agent followed the expected plan - - [Plan Quality](https://deepeval.com/docs/metrics-plan-quality) — evaluate the quality of the agent's plan - - [Tool Use](https://deepeval.com/docs/metrics-tool-use) — measure quality of tool usage - - [Argument Correctness](https://deepeval.com/docs/metrics-argument-correctness) — validate tool call arguments + - [Task Completion](https://deepeval.com/docs/metrics-task-completion) — 评估智能体是否完成了其目标 + - [Tool Correctness](https://deepeval.com/docs/metrics-tool-correctness) — 检查是否以正确参数调用了正确的工具 + - [Goal Accuracy](https://deepeval.com/docs/metrics-goal-accuracy) — 衡量智能体达成预期目标的准确程度 + - [Step Efficiency](https://deepeval.com/docs/metrics-step-efficiency) — 评估智能体是否采取了不必要的步骤 + - [Plan Adherence](https://deepeval.com/docs/metrics-plan-adherence) — 检查智能体是否遵循了预期计划 + - [Plan Quality](https://deepeval.com/docs/metrics-plan-quality) — 评估智能体计划的质量 + - [Tool Use](https://deepeval.com/docs/metrics-tool-use) — 衡量工具使用的质量 + - [Argument Correctness](https://deepeval.com/docs/metrics-argument-correctness) — 验证工具调用参数的正确性
-
- RAG Metrics + RAG 指标 - - [Answer Relevancy](https://deepeval.com/docs/metrics-answer-relevancy) — measure how relevant the RAG pipeline's output is to the input - - [Faithfulness](https://deepeval.com/docs/metrics-faithfulness) — evaluate whether the RAG pipeline's output factually aligns with the retrieval context - - [Contextual Recall](https://deepeval.com/docs/metrics-contextual-recall) — measure how well the RAG pipeline's retrieval context aligns with the expected output - - [Contextual Precision](https://deepeval.com/docs/metrics-contextual-precision) — evaluate whether relevant nodes in the RAG pipeline's retrieval context are ranked higher - - [Contextual Relevancy](https://deepeval.com/docs/metrics-contextual-relevancy) — measure the overall relevance of the RAG pipeline's retrieval context to the input - - [RAGAS](https://deepeval.com/docs/metrics-ragas) — average of answer relevancy, faithfulness, contextual precision, and contextual recall + - [Answer Relevancy](https://deepeval.com/docs/metrics-answer-relevancy) — 衡量 RAG 流水线输出与输入的相关程度 + - [Faithfulness](https://deepeval.com/docs/metrics-faithfulness) — 评估 RAG 流水线输出是否在事实上与检索上下文一致 + - [Contextual Recall](https://deepeval.com/docs/metrics-contextual-recall) — 衡量 RAG 流水线检索上下文与预期输出的匹配程度 + - [Contextual Precision](https://deepeval.com/docs/metrics-contextual-precision) — 评估 RAG 流水线检索上下文中相关节点是否排名更高 + - [Contextual Relevancy](https://deepeval.com/docs/metrics-contextual-relevancy) — 衡量 RAG 流水线检索上下文与输入的整体相关程度 + - [RAGAS](https://deepeval.com/docs/metrics-ragas) — 答案相关性、忠实度、上下文精确度与上下文召回率的平均值
-
- Multi-Turn Metrics + 多轮对话指标 - - [Knowledge Retention](https://deepeval.com/docs/metrics-knowledge-retention) — evaluate whether the chatbot retains factual information throughout a conversation - - [Conversation Completeness](https://deepeval.com/docs/metrics-conversation-completeness) — measure whether the chatbot satisfies user needs throughout a conversation - - [Turn Relevancy](https://deepeval.com/docs/metrics-turn-relevancy) — evaluate whether the chatbot generates consistently relevant responses throughout a conversation - - [Turn Faithfulness](https://deepeval.com/docs/metrics-turn-faithfulness) — check if the chatbot's responses are factually grounded in retrieval context across turns - - [Role Adherence](https://deepeval.com/docs/metrics-role-adherence) — evaluate whether the chatbot adheres to its assigned role throughout a conversation + - [Knowledge Retention](https://deepeval.com/docs/metrics-knowledge-retention) — 评估聊天机器人在整个对话过程中是否保留事实信息 + - [Conversation Completeness](https://deepeval.com/docs/metrics-conversation-completeness) — 衡量聊天机器人在整个对话过程中是否满足用户需求 + - [Turn Relevancy](https://deepeval.com/docs/metrics-turn-relevancy) — 评估聊天机器人在整个对话过程中是否持续生成相关回复 + - [Turn Faithfulness](https://deepeval.com/docs/metrics-turn-faithfulness) — 检查聊天机器人在各轮对话中的回复是否在事实上基于检索上下文 + - [Role Adherence](https://deepeval.com/docs/metrics-role-adherence) — 评估聊天机器人在整个对话过程中是否恪守其指定角色
-
- MCP Metrics + MCP 指标 - - [MCP Task Completion](https://deepeval.com/docs/metrics-mcp-task-completion) — evaluate how effectively an MCP-based agent accomplishes a task - - [MCP Use](https://deepeval.com/docs/metrics-mcp-use) — measure how effectively an agent uses its available MCP servers - - [Multi-Turn MCP Use](https://deepeval.com/docs/metrics-multi-turn-mcp-use) — evaluate MCP server usage across conversation turns + - [MCP Task Completion](https://deepeval.com/docs/metrics-mcp-task-completion) — 评估基于 MCP 的智能体完成任务的有效性 + - [MCP Use](https://deepeval.com/docs/metrics-mcp-use) — 衡量智能体使用其可用 MCP 服务器的有效性 + - [Multi-Turn MCP Use](https://deepeval.com/docs/metrics-multi-turn-mcp-use) — 评估跨对话轮次的 MCP 服务器使用情况 + +
+ + -
+ 多模态指标(Multimodal Metrics) + + - [文生图(Text to Image)](https://deepeval.com/docs/multimodal-metrics-text-to-image) — 基于语义一致性和感知质量评估图像生成质量 + - [图像编辑(Image Editing)](https://deepeval.com/docs/multimodal-metrics-image-editing) — 基于语义一致性和感知质量评估图像编辑质量 + - [图像连贯性(Image Coherence)](https://deepeval.com/docs/multimodal-metrics-image-coherence) — 衡量图像与其伴随文本的对齐程度 + - [图像有用性(Image Helpfulness)](https://deepeval.com/docs/multimodal-metrics-image-helpfulness) — 评估图像对用户理解文本的有效贡献程度 + - [图像引用(Image Reference)](https://deepeval.com/docs/multimodal-metrics-image-reference) — 评估伴随文本对图像的引用或解释是否准确
-
- Multimodal Metrics + 其他指标(Other Metrics) - - [Text to Image](https://deepeval.com/docs/multimodal-metrics-text-to-image) — evaluate image generation quality based on semantic consistency and perceptual quality - - [Image Editing](https://deepeval.com/docs/multimodal-metrics-image-editing) — evaluate image editing quality based on semantic consistency and perceptual quality - - [Image Coherence](https://deepeval.com/docs/multimodal-metrics-image-coherence) — measure how well images align with their accompanying text - - [Image Helpfulness](https://deepeval.com/docs/multimodal-metrics-image-helpfulness) — evaluate how effectively images contribute to user comprehension of the text - - [Image Reference](https://deepeval.com/docs/multimodal-metrics-image-reference) — evaluate how accurately images are referred to or explained by accompanying text + - [幻觉(Hallucination)](https://deepeval.com/docs/metrics-hallucination) — 检查 LLM 是否根据提供的上下文生成事实正确的信息 + - [摘要(Summarization)](https://deepeval.com/docs/metrics-summarization) — 评估摘要是否事实正确并包含必要细节 + - [偏见(Bias)](https://deepeval.com/docs/metrics-bias) — 检测 LLM 输出中的性别、种族或政治偏见 + - [毒性(Toxicity)](https://deepeval.com/docs/metrics-toxicity) — 评估 LLM 输出中的毒性 + - [JSON 正确性(JSON Correctness)](https://deepeval.com/docs/metrics-json-correctness) — 检查输出是否符合预期的 JSON schema + - [提示对齐(Prompt Alignment)](https://deepeval.com/docs/metrics-prompt-alignment) — 衡量输出是否与提示模板中的指令一致
- -
- Other Metrics - - - [Hallucination](https://deepeval.com/docs/metrics-hallucination) — check whether the LLM generates factually correct information against provided context - - [Summarization](https://deepeval.com/docs/metrics-summarization) — evaluate whether summaries are factually correct and include necessary details - - [Bias](https://deepeval.com/docs/metrics-bias) — detect gender, racial, or political bias in LLM outputs - - [Toxicity](https://deepeval.com/docs/metrics-toxicity) — evaluate toxicity in LLM outputs - - [JSON Correctness](https://deepeval.com/docs/metrics-json-correctness) — check whether the output matches an expected JSON schema - - [Prompt Alignment](https://deepeval.com/docs/metrics-prompt-alignment) — measure whether the output aligns with instructions in the prompt template - -
- -- 🎯 Supports both end-to-end and component-level LLM evaluation. -- 🧩 Build your own custom metrics that are automatically integrated with DeepEval's ecosystem. -- 🔮 Generate both single and multi-turn synthetic datasets for evaluation. -- 🔗 Integrates seamlessly with **ANY** CI/CD environment. -- 🧬 Optimize prompts automatically based on evaluation results. -- 🏆 Easily benchmark **ANY** LLM on popular LLM benchmarks in [under 10 lines of code.](https://deepeval.com/docs/benchmarks-introduction?utm_source=GitHub), including MMLU, HellaSwag, DROP, BIG-Bench Hard, TruthfulQA, HumanEval, GSM8K. +- 🎯 同时支持端到端和组件级 LLM 评估。 +- 🧩 构建你自己的自定义指标,并自动集成到 DeepEval 生态系统中。 +- 🔮 生成用于评估的单轮和多轮合成数据集。 +- 🔗 可与**任意** CI/CD 环境无缝集成。 +- 🧬 根据评估结果自动优化提示词。 +- 🏆 轻松在热门 LLM 基准测试上评测**任意** LLM,[仅需不到 10 行代码。](https://deepeval.com/docs/benchmarks-introduction?utm_source=GitHub), 包括 MMLU、HellaSwag、DROP、BIG-Bench Hard、TruthfulQA、HumanEval、GSM8K。
-# 🔌 Integrations +# 🔌 集成 -DeepEval plugs into any LLM framework — OpenAI Agents, LangChain, CrewAI, and more. To scale evals across your team — or let anyone run them without writing code — **Confident AI** gives you a native platform integration. +DeepEval 可接入任意 LLM 框架——OpenAI Agents、LangChain、CrewAI 等。若要在团队中扩展评估规模,或让任何人无需编写代码即可运行评估,**Confident AI** 提供原生平台集成。 -## Frameworks +## 框架 -- [OpenAI](https://www.deepeval.com/integrations/frameworks/openai?utm_source=GitHub) — evaluate and trace OpenAI applications via a client wrapper -- [OpenAI Agents](https://www.deepeval.com/integrations/frameworks/openai-agents?utm_source=GitHub) — evaluate OpenAI Agents end-to-end in under a minute -- [LangChain](https://www.deepeval.com/integrations/frameworks/langchain?utm_source=GitHub) — evaluate LangChain applications with a callback handler -- [LangGraph](https://www.deepeval.com/integrations/frameworks/langgraph?utm_source=GitHub) — evaluate LangGraph agents with a callback handler -- [Pydantic AI](https://www.deepeval.com/integrations/frameworks/pydanticai?utm_source=GitHub) — evaluate Pydantic AI agents with type-safe validation -- [CrewAI](https://www.deepeval.com/integrations/frameworks/crewai?utm_source=GitHub) — evaluate CrewAI multi-agent systems -- [Anthropic](https://www.deepeval.com/integrations/frameworks/anthropic?utm_source=GitHub) — evaluate and trace Claude applications via a client wrapper -- [AWS AgentCore](https://www.deepeval.com/integrations/frameworks/agentcore?utm_source=GitHub) — evaluate agents deployed on Amazon AgentCore -- [LlamaIndex](https://www.deepeval.com/integrations/frameworks/llamaindex?utm_source=GitHub) — evaluate RAG applications built with LlamaIndex +- [OpenAI](https://www.deepeval.com/integrations/frameworks/openai?utm_source=GitHub) — 通过客户端包装器评估并追踪 OpenAI 应用 +- [OpenAI Agents](https://www.deepeval.com/integrations/frameworks/openai-agents?utm_source=GitHub) — 在一分钟内端到端评估 OpenAI Agents +- [LangChain](https://www.deepeval.com/integrations/frameworks/langchain?utm_source=GitHub) — 使用回调处理器评估 LangChain 应用 +- [LangGraph](https://www.deepeval.com/integrations/frameworks/langgraph?utm_source=GitHub) — 使用回调处理器评估 LangGraph 智能体 +- [Pydantic AI](https://www.deepeval.com/integrations/frameworks/pydanticai?utm_source=GitHub) — 使用类型安全验证评估 Pydantic AI 智能体 +- [CrewAI](https://www.deepeval.com/integrations/frameworks/crewai?utm_source=GitHub) — 评估 CrewAI 多智能体系统 +- [Anthropic](https://www.deepeval.com/integrations/frameworks/anthropic?utm_source=GitHub) — 通过客户端包装器评估并追踪 Claude 应用 +- [AWS AgentCore](https://www.deepeval.com/integrations/frameworks/agentcore?utm_source=GitHub) — 评估部署在 Amazon AgentCore 上的智能体 +- [LlamaIndex](https://www.deepeval.com/integrations/frameworks/llamaindex?utm_source=GitHub) — 评估使用 LlamaIndex 构建的 RAG 应用 -## ☁️ Platform + Ecosystem +## ☁️ 平台与生态 -[Confident AI](https://www.confident-ai.com?utm_source=deepeval&utm_medium=github&utm_content=platform_section) is an all-in-one platform that integrates natively with DeepEval. +[Confident AI](https://www.confident-ai.com?utm_source=deepeval&utm_medium=github&utm_content=platform_section) 是与 DeepEval 原生集成的全合一平台。 -- Manage datasets, trace LLM applications, run evaluations, and monitor responses in production — all from one platform. -- Don't need a UI? Confident AI can also be your data persistent layer - run evals, pull datasets, and inspect traces straight from claude code, cursor, via Confident AI's [MCP server](https://github.com/confident-ai/confident-mcp-server). +- 在同一平台上管理数据集、追踪 LLM 应用、运行评估并监控生产环境中的响应。 +- 不需要 UI?Confident AI 也可作为数据持久化层——运行评估、拉取数据集,并通过 Confident AI 的 [MCP server](https://github.com/confident-ai/confident-mcp-server). 直接从 claude code、cursor 中检查追踪记录

Confident AI MCP Architecture @@ -188,47 +194,47 @@ DeepEval plugs into any LLM framework — OpenAI Agents, LangChain, CrewAI, and
-# 🤖 Vibe-Coder QuickStart +# 🤖 Vibe-Coder 快速入门 -Want your coding agent to add evals and fix failures for you? Install the DeepEval skill, point it at your agent, RAG pipeline, or chatbot, and ask it to generate a dataset, write the eval suite, run `deepeval test run`, and iterate on the failing metrics. +希望你的编程智能体为你添加评估并修复失败项?安装 DeepEval skill,将其指向你的智能体、RAG 流水线或聊天机器人,然后让它生成数据集、编写评估套件、运行 `deepeval test run`,并对失败的指标进行迭代。 -[Start with the 5-minute vibe-coder guide](https://deepeval.com/docs/vibe-coder-quickstart?utm_source=GitHub). +[从 5 分钟 vibe-coder 指南开始](https://deepeval.com/docs/vibe-coder-quickstart?utm_source=GitHub).
-# 🚀 Human QuickStart +# 🚀 人工快速入门 -Let's pretend your LLM application is a RAG based customer support chatbot; here's how DeepEval can help test what you've built. +假设你的 LLM 应用是一个基于 RAG 的客户支持聊天机器人;下面介绍 DeepEval 如何帮助你测试所构建的内容。 -## Installation +## 安装 -Deepeval works with **Python>=3.9+**. +Deepeval 适用于 **Python>=3.9+**。 ``` pip install -U deepeval ``` -## Create an account (highly recommended) +## 创建账户(强烈推荐) -Using the `deepeval` platform will allow you to generate sharable testing reports on the cloud. It is free, takes no additional code to setup, and we highly recommend giving it a try. +使用 `deepeval` 平台可让你在云端生成可分享的测试报告。它免费、无需额外代码即可设置,我们强烈建议你试一试。 -To login, run: +要登录,请运行: ``` deepeval login ``` -Follow the instructions in the CLI to create an account, copy your API key, and paste it into the CLI. All test cases will automatically be logged (find more information on data privacy [here](https://deepeval.com/docs/data-privacy?utm_source=GitHub)). +按照 CLI 中的说明创建账户、复制 API 密钥并将其粘贴到 CLI 中。所有测试用例将自动记录(有关数据隐私的更多信息请见[此处](https://deepeval.com/docs/data-privacy?utm_source=GitHub)). -## Write your first test case +## 编写你的第一个测试用例 -Create a test file: +创建测试文件: ```bash touch test_chatbot.py ``` -Open `test_chatbot.py` and write your first test case to run an **end-to-end** evaluation using DeepEval, which treats your LLM app as a black-box: +打开 `test_chatbot.py` 并编写你的第一个测试用例,使用 DeepEval 运行**端到端**评估,将 LLM 应用视为黑盒: ```python import pytest @@ -253,34 +259,34 @@ def test_case(): assert_test(test_case, [correctness_metric]) ``` -Set your `OPENAI_API_KEY` as an environment variable (you can also evaluate using your own custom model, for more details visit [this part of our docs](https://deepeval.com/docs/metrics-introduction#using-a-custom-llm?utm_source=GitHub)): +将你的 `OPENAI_API_KEY` 设置为环境变量(你也可以使用自己的自定义模型进行评估,更多详情请访问[我们文档的这一部分](https://deepeval.com/docs/metrics-introduction#using-a-custom-llm?utm_source=GitHub)): ``` export OPENAI_API_KEY="..." ``` -And finally, run `test_chatbot.py` in the CLI: +最后,在 CLI 中运行 `test_chatbot.py`: ``` deepeval test run test_chatbot.py ``` -**Congratulations! Your test case should have passed ✅** Let's break down what happened. +**恭喜!你的测试用例应该已通过 ✅** 让我们来分解一下发生了什么。 -- The variable `input` mimics a user input, and `actual_output` is a placeholder for what your application's supposed to output based on this input. -- The variable `expected_output` represents the ideal answer for a given `input`, and [`GEval`](https://deepeval.com/docs/metrics-llm-evals) is a research-backed metric provided by `deepeval` for you to evaluate your LLM outputs on any custom with human-like accuracy. -- In this example, the metric `criteria` is correctness of the `actual_output` based on the provided `expected_output`. -- All metric scores range from 0 - 1, which the `threshold=0.5` threshold ultimately determines if your test has passed or not. +- 变量 `input` 模拟用户输入,`actual_output` 是根据该输入你的应用应输出的内容的占位符。 +- 变量 `expected_output` 表示给定 `input` 的理想答案,[`GEval`](https://deepeval.com/docs/metrics-llm-evals) 是 `deepeval` 提供的、基于研究的指标,可让你以接近人类的准确度在任何自定义场景上评估 LLM 输出。 +- 在此示例中,指标 `criteria` 是基于所提供的 `expected_output` 的 `actual_output` 正确性。 +- 所有指标得分范围为 0 - 1,`threshold=0.5` 阈值最终决定你的测试是否通过。 -[Read our documentation](https://deepeval.com/docs/getting-started?utm_source=GitHub) for more information! +[阅读我们的文档](https://deepeval.com/docs/getting-started?utm_source=GitHub) 了解更多信息!
-## Evals With Full Traceability +## 具备完整可追溯性的评估(Evals) -Use `evals_iterator()` to run the same dataset through your app, whether you instrument it manually or through one of DeepEval's framework integrations. +使用 `evals_iterator()` 在你的应用中用同一数据集运行评估,无论你采用手动埋点还是通过 DeepEval 的某一框架集成。 -Here's an example of manual instrumentation: +下面是手动埋点的示例: ```python from deepeval.tracing import observe, update_current_span @@ -495,13 +501,13 @@ for golden in dataset.evals_iterator(metrics=[TaskCompletionMetric()]): -Learn more about component-level evaluations [here.](https://www.deepeval.com/docs/evaluation-component-level-llm-evals) +了解更多组件级评估信息,请[点击此处。](https://www.deepeval.com/docs/evaluation-component-level-llm-evals)
-## Evaluate Without Pytest Integration +## 不使用 Pytest 集成的评估方式 -Alternatively, you can evaluate without Pytest, which is more suited for a notebook environment. +或者,你也可以在不使用 Pytest 的情况下进行评估,这种方式更适合 notebook 环境。 ```python from deepeval import evaluate @@ -518,9 +524,9 @@ test_case = LLMTestCase( evaluate([test_case], [answer_relevancy_metric]) ``` -## Using Standalone Metrics +## 使用独立指标(Metrics) -DeepEval is extremely modular, making it easy for anyone to use any of our metrics. Continuing from the previous example: +DeepEval 具有极高的模块化程度,任何人都能轻松使用我们的任一指标。接续上一个示例: ```python from deepeval.metrics import AnswerRelevancyMetric @@ -540,28 +546,28 @@ print(answer_relevancy_metric.score) print(answer_relevancy_metric.reason) ``` -Note that some metrics are for RAG pipelines, while others are for fine-tuning. Make sure to use our docs to pick the right one for your use case. +请注意,部分指标适用于 RAG 流水线,另一些则适用于微调(fine-tuning)。请务必查阅我们的文档,为你的使用场景选择合适的指标。 -## A Note on Env Variables (.env / .env.local) +## 关于环境变量(.env / .env.local)的说明 -DeepEval auto-loads `.env.local` then `.env` from the current working directory **at import time**. -**Precedence:** process env -> `.env.local` -> `.env`. -Opt out with `DEEPEVAL_DISABLE_DOTENV=1`. +DeepEval 会在**导入时**从当前工作目录自动加载 `.env.local`,随后加载 `.env`。 +**优先级:** 进程环境变量 -> `.env.local` -> `.env`。 +可使用 `DEEPEVAL_DISABLE_DOTENV=1` 选择退出。 ```bash cp .env.example .env.local # then edit .env.local (ignored by git) ``` -# DeepEval With Confident AI +# 将 DeepEval 与 Confident AI 配合使用 -[Confident AI](https://www.confident-ai.com?utm_source=deepeval&utm_medium=github&utm_content=cli_login_section) is an all-in-one platform to manage datasets, trace LLM applications, and run evaluations in production. Log in from the CLI to get started: +[Confident AI](https://www.confident-ai.com?utm_source=deepeval&utm_medium=github&utm_content=cli_login_section) 是一个一体化平台,用于管理数据集、追踪 LLM 应用,并在生产环境中运行评估。通过 CLI 登录即可开始使用: ```bash deepeval login ``` -Then run your tests as usual — results are automatically synced to the platform: +然后像往常一样运行测试——结果会自动同步到平台: ```bash deepeval test run test_chatbot.py @@ -569,43 +575,43 @@ deepeval test run test_chatbot.py ![Demo GIF](assets/demo.gif) -Prefer to stay in your IDE? Use DeepEval via [Confident AI's MCP server](https://github.com/confident-ai/confident-mcp-server) as the persistent layer to run evals, pull datasets, and inspect traces without leaving your editor. +想一直待在 IDE 里?通过 [Confident AI 的 MCP server](https://github.com/confident-ai/confident-mcp-server) 作为持久层来运行评测、拉取数据集并检查 trace,无需离开编辑器即可使用 DeepEval。

- Confident AI MCP Architecture + Confident AI MCP 架构

-Everything on Confident AI is available [here](https://www.confident-ai.com/docs?utm_source=deepeval&utm_medium=github&utm_content=cloud_docs). +Confident AI 上的全部内容可在[此处](https://www.confident-ai.com/docs?utm_source=deepeval&utm_medium=github&utm_content=cloud_docs).
-# Contributing +# 贡献 -Please read [CONTRIBUTING.md](https://github.com/confident-ai/deepeval/blob/main/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us. +请阅读 [CONTRIBUTING.md](https://github.com/confident-ai/deepeval/blob/main/CONTRIBUTING.md),了解我们的行为准则以及向我们提交 Pull Request 的流程详情。
-# Roadmap +# 路线图 -Features: +功能特性: -- [x] Integration with Confident AI -- [x] Implement G-Eval -- [x] Implement RAG metrics -- [x] Implement Conversational metrics -- [x] Evaluation Dataset Creation -- [x] Red-Teaming -- [ ] DAG custom metrics -- [ ] Guardrails +- [x] 与 Confident AI 集成 +- [x] 实现 G-Eval +- [x] 实现 RAG 指标 +- [x] 实现对话(Conversational)指标 +- [x] 评测数据集创建 +- [x] 红队测试(Red-Teaming) +- [ ] DAG 自定义指标 +- [ ] Guardrails(护栏)
-# Authors +# 作者 -Built by the founders of Confident AI. Contact jeffreyip@confident-ai.com for all enquiries. +由 Confident AI 创始人打造。如有任何咨询,请联系 jeffreyip@confident-ai.com。
-# License +# 许可证 -DeepEval is licensed under Apache 2.0 - see the [LICENSE.md](https://github.com/confident-ai/deepeval/blob/main/LICENSE.md) file for details. +DeepEval 采用 Apache 2.0 许可证——详见 [LICENSE.md](https://github.com/confident-ai/deepeval/blob/main/LICENSE.md) 文件。