Interface AnnotationOptions

Annotation options for LLM Observability spans.

interface AnnotationOptions {
    inputData?: string | Document | Message | {
        [key: string]: any;
    } | Message[] | Document[];
    metadata?: {
        [key: string]: any;
    };
    metrics?: {
        [key: string]: number;
    };
    outputData?: string | Document | Message | Message[] | Document[] | {
        [key: string]: any;
    };
    tags?: {
        [key: string]: any;
    };
}

Properties

inputData?: string | Document | Message | {
    [key: string]: any;
} | Message[] | Document[]

A single input string, object, or a list of objects based on the span kind:

  1. LLM spans: accepts a string, or an object of the form {content: "...", role: "..."}, or a list of objects with the same signature.
  2. Embedding spans: accepts a string, list of strings, or an object of the form {text: "...", ...}, or a list of objects with the same signature.
  3. Other: any JSON serializable type

Type declaration

  • [key: string]: any
metadata?: {
    [key: string]: any;
}

Object of JSON serializable key-value metadata pairs relevant to the input/output operation described by the LLM Observability span.

Type declaration

  • [key: string]: any
metrics?: {
    [key: string]: number;
}

Object of JSON seraliazable key-value metrics (number) pairs, such as {input,output,total}Tokens

Type declaration

  • [key: string]: number
outputData?: string | Document | Message | Message[] | Document[] | {
    [key: string]: any;
}

A single output string, object, or a list of objects based on the span kind:

  1. LLM spans: accepts a string, or an object of the form {content: "...", role: "..."}, or a list of objects with the same signature.
  2. Retrieval spans: An object containing any of the key value pairs {name: str, id: str, text: str, source: number} or a list of dictionaries with the same signature.
  3. Other: any JSON serializable type

Type declaration

  • [key: string]: any
tags?: {
    [key: string]: any;
}

Object of JSON serializable key-value tag pairs to set or update on the LLM Observability span regarding the span's context.

Type declaration

  • [key: string]: any

Generated using TypeDoc