effect-io-ai

Package: @effect/ai-openai-compat
Module: OpenAiTelemetry

OpenAiTelemetry.addGenAIAnnotations

Applies the specified OpenAI GenAI telemetry attributes to the provided Span.

When to use

Use to annotate an OpenAI-compatible model span with standard GenAI telemetry attributes and OpenAI-specific request or response metadata.

Details

Standard GenAI attributes are applied first. When OpenAI request or response metadata is present, it is written under gen_ai.openai.request.* and gen_ai.openai.response.* attributes.

Gotchas

Mutates the supplied Span in place.

Signature

declare const addGenAIAnnotations: { (options: OpenAiTelemetryAttributeOptions): (span: Span) => void; (span: Span, options: OpenAiTelemetryAttributeOptions): void; }

Source

Since v4.0.0