Add an annotation to a trace.
The annotation can be of type "LLM", "CODE", or "HUMAN" and can include a label, score, and metadata. If an identifier is provided and an annotation with that identifier already exists, it will be updated.
The parameters to add a trace annotation
The ID of the created or updated annotation
const result = await addTraceAnnotation({ traceAnnotation: { traceId: "abc123", name: "correctness", label: "correct", score: 1.0, annotatorKind: "HUMAN", identifier: "custom_id_123", metadata: { reviewer: "alice" } }, sync: true,}); Copy
const result = await addTraceAnnotation({ traceAnnotation: { traceId: "abc123", name: "correctness", label: "correct", score: 1.0, annotatorKind: "HUMAN", identifier: "custom_id_123", metadata: { reviewer: "alice" } }, sync: true,});
Add an annotation to a trace.
The annotation can be of type "LLM", "CODE", or "HUMAN" and can include a label, score, and metadata. If an identifier is provided and an annotation with that identifier already exists, it will be updated.