> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-zh.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 从 Playground 运行评估

LangSmith 允许您直接在 UI 界面中运行评估。[**Playground**](/langsmith/prompt-engineering#playground) 让您能够在一系列输入上测试您的提示词或模型配置，以查看其在不同上下文或场景下的表现得分，而无需编写任何代码。

在运行评估之前，您需要有一个[现有的数据集](/langsmith/evaluation-concepts#datasets)。了解如何[从 UI 界面创建数据集](/langsmith/manage-datasets-in-application#create-a-dataset-and-add-examples)。

若要从 Studio 运行评估，请参阅[在 Studio 中对数据集运行实验](/langsmith/observability-studio#run-experiments-over-a-dataset)。如果您更倾向于在代码中运行实验，请参阅[使用 SDK 运行评估](/langsmith/evaluate-llm-application)。

<img src="https://mintcdn.com/hhh-8c10bf0c/PHzfKFWRV-Ltob7s/langsmith/images/playground-experiment.gif?s=35f65cdb76d171281215cca0b8b03c4a" alt="Playground 实验" width="1358" height="720" data-path="langsmith/images/playground-experiment.gif" />

<Callout type="info" icon="feather">
  **[Polly](/langsmith/polly)** 在 Playground 中可用，可帮助您在运行评估前优化提示词。
</Callout>

## 在 Playground 中创建实验

1. **点击侧边栏中的 Playground**。

2. **添加提示词**：选择一个现有的已保存提示词或创建一个新的。

3. **从“在数据集上测试”下拉菜单中选择一个数据集**

   * 请注意，数据集输入中的键必须与提示词的输入变量匹配。例如，在上面的视频中，所选数据集的输入具有键 "blog"，这正确地匹配了提示词的输入变量。
   * Playground 中最多允许 15 个输入变量。

4. **开始实验**：点击 **开始** 或按 CMD+Enter。这将在数据集中的所有示例上运行提示词，并在数据集详情页中为该实验创建一个条目。建议在开始实验前将提示词提交到提示词中心，以便在后续查看实验时可以轻松引用。

5. **查看完整结果**：点击 **查看完整实验**。这将带您进入实验详情页面，您可以在那里查看实验的结果。

## 为实验添加评估分数[​](#add-evaluation-scores-to-the-experiment "Direct link to Add evaluation scores to the experiment")

通过添加评估器，根据特定标准评估您的实验。在 Playground 中使用 **+Evaluator** 按钮添加 LLM-as-a-judge 或自定义代码评估器。

要了解更多关于通过 UI 界面添加评估器的信息，请访问[如何定义 LLM-as-a-judge 评估器](/langsmith/llm-as-judge)。

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/i18n\zh-CN\langsmith\run-evaluation-from-playground.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
