跳到主要内容

如何评估现有实验(仅限 Python)

现有实验的评估目前仅在 Python SDK 中支持。

如果您已经运行了一个实验并想添加额外的评估指标,您可以像以前一样使用 evaluate() / aevaluate() 方法将任何评估器应用于该实验。只需传入实验名称/ID,而不是目标函数。

from langsmith import evaluate

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

experiment_name = "my-experiment:abc" # Replace with an actual experiment name or ID
evaluate(experiment_name, evaluators=[always_half])

此页面有用吗?


您可以在 GitHub 上 留下详细反馈.

© . This site is unofficial and not affiliated with LangChain, Inc.
这些文档随着 LangChain v1.0 在 2025 年 10 月的发布而弃用,并且不再维护。 请访问 v1.0 文档