Skip to main content
在深入阅读本内容之前,建议先了解以下内容:
反馈是 LangSmith 用于存储针对特定追踪或中间运行(span)的评估标准和得分的方式。反馈可以通过多种方式生成,例如:
  1. 从 LLM 应用程序中随追踪一起上传
  2. 用户在应用中内联生成或在标注队列中生成
  3. 离线评估期间由自动评估器生成
  4. 在线评估器生成
反馈以简单的格式存储,包含以下字段:
Field NameTypeDescription
idUUIDUnique identifier for the record itself
created_atdatetimeTimestamp when the record was created
modified_atdatetimeTimestamp when the record was last modified
session_idUUIDUnique identifier for the experiment or tracing project the run was a part of
run_idUUIDUnique identifier for a specific run within a session
keystringA key describing the criteria of the feedback, e.g. 'correctness'
scorenumberNumerical score associated with the feedback key
valuestringReserved for storing a value associated with the score. Useful for categorical feedback.
commentstringAny comment or annotation associated with the record. This can be a justification for the score given.
correctionobjectReserved for storing correction details, if any
feedback_sourceobjectObject containing information about the feedback source
feedback_source.typestringThe type of source where the feedback originated, e.g. 'api', 'app', 'evaluator'
feedback_source.metadataobjectReserved for additional metadata, currently
feedback_source.user_idUUIDUnique identifier for the user providing feedback
以下是上述格式中反馈记录的 JSON 示例:
{
  "created_at": "2024-05-05T23:23:11.077838",
  "modified_at": "2024-05-05T23:23:11.232962",
  "session_id": "c919298b-0af2-4517-97a2-0f98ed4a48f8",
  "run_id": "e26174e5-2190-4566-b970-7c3d9a621baa",
  "key": "correctness",
  "score": 1.0,
  "value": null,
  "comment": "我给出这个分数是因为答案是正确的。",
  "correction": null,
  "id": "62104630-c7f5-41dc-8ee2-0acee5c14224",
  "feedback_source": {
    "type": "app",
    "metadata": null,
    "user_id": "ad52b092-1346-42f4-a934-6e5521562fab"
  }
}