@valon-technologies/gestalt
    Preparing search index...

    Class GenAIOperation

    Records a GenAI span plus operation duration and token usage metrics.

    Index

    Constructors

    • Parameters

      • span: Span
      • metricAttributes: Attributes

      Returns GenAIOperation

    Methods

    • Ends the span and records operation duration.

      Parameters

      • Optionalerror: unknown

      Returns void

    • Marks the operation span and duration metric as failed.

      Parameters

      • errorTypeValue: string
      • description: string = ""
      • Optionalexception: unknown

      Returns void

    • Sets a span attribute when the value is valid for OpenTelemetry.

      Parameters

      • key: string
      • value: unknown

      Returns void

    • Attaches common GenAI response metadata to the span.

      Parameters

      • input: { id?: string; model?: string; finishReasons?: string[] }

      Returns void

    • Records GenAI token usage on the span and token usage metric.

      Parameters

      Returns void