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

# 如何向现有实验添加评估器（仅限 Python）

目前仅 Python SDK 支持对现有实验进行评估。

运行实验后，您可能希望**添加新的评估指标而无需重新运行应用程序**。当您添加了新的评估器或希望对现有结果应用不同的评分标准时，这非常有用。您无需在所有示例上重新执行目标函数，而是可以直接评估现有的实验跟踪记录。

要向现有实验添加评估器，请将实验名称或 ID 传递给 `evaluate()` / `aevaluate()`，而不是传递目标函数。评估器将运行在原始实验的缓存跟踪记录上，访问输入、输出以及记录的所有中间步骤。

## 示例

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langsmith import evaluate

def always_half(inputs: dict, outputs: dict) -> float:
    return 0.5

experiment_name = "my-experiment:abc"  # 替换为实际的实验名称或 ID

evaluate(experiment_name, evaluators=[always_half])
```

## 相关主题

* [重试实验中失败的示例](/langsmith/evaluate-with-retry)
* [运行评估](/langsmith/evaluate-llm-application)
* [异步运行评估](/langsmith/evaluation-async)

***

<div className="source-links">
  <Callout icon="terminal-2">
    [将这些文档连接](/use-these-docs)到 Claude、VSCode 等，通过 MCP 获取实时答案。
  </Callout>

  <Callout icon="edit">
    [在 GitHub 上编辑此页面](https://github.com/langchain-ai/docs/edit/main/src/langsmith/evaluate-existing-experiment.mdx) 或 [提交问题](https://github.com/langchain-ai/docs/issues/new/choose)。
  </Callout>
</div>
