• Convert a DocumentAnnotation to the API format

    Parameters

    Returns {
        annotator_kind: "LLM" | "CODE" | "HUMAN";
        document_position: number;
        identifier?: string;
        metadata?: null | { [key: string]: unknown };
        name: string;
        result?:
            | null
            | {
                explanation?: null
                | string;
                label?: null | string;
                score?: null | number;
            };
        span_id: string;
    }

    • annotator_kind: "LLM" | "CODE" | "HUMAN"

      Annotator Kind

      The kind of annotator used for the annotation

    • document_position: number

      Document Position

      A 0 based index of the document. E.x. the first document during retrieval is 0

    • Optionalidentifier?: string

      Identifier

      The identifier of the annotation. If provided, the annotation will be updated if it already exists.

      
      
    • Optionalmetadata?: null | { [key: string]: unknown }

      Metadata

      Metadata for the annotation

    • name: string

      Name

      The name of the annotation

    • Optionalresult?:
          | null
          | {
              explanation?: null
              | string;
              label?: null | string;
              score?: null | number;
          }

      The result of the annotation

    • span_id: string

      Span Id

      OpenTelemetry Span ID (hex format w/o 0x prefix)