• Convert a SpanAnnotation to the API format

    Parameters

    Returns {
        annotator_kind: "LLM" | "CODE" | "HUMAN";
        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

    • 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)