Add an annotation to a document within a span.
The annotation can be of type "LLM", "CODE", or "HUMAN" and can include a label, score, explanation, and metadata. At least one of label, score, or explanation must be provided.
The parameters to add a document annotation
The ID of the created annotation
const result = await addDocumentAnnotation({ documentAnnotation: { spanId: "123abc", documentPosition: 0, name: "relevance_score", label: "relevant", score: 0.95, annotatorKind: "LLM", explanation: "Document is highly relevant to the query", metadata: { model: "gpt-4" } }}); Copy
const result = await addDocumentAnnotation({ documentAnnotation: { spanId: "123abc", documentPosition: 0, name: "relevance_score", label: "relevant", score: 0.95, annotatorKind: "LLM", explanation: "Document is highly relevant to the query", metadata: { model: "gpt-4" } }});
Add an annotation to a document within a span.
The annotation can be of type "LLM", "CODE", or "HUMAN" and can include a label, score, explanation, and metadata. At least one of label, score, or explanation must be provided.