import "@opentelemetry/api";

//#region src/components/execution/otel/aiExtractor.d.ts

/**
 * Canonical AI metadata extracted from a span's OpenTelemetry GenAI semantic
 * convention (`gen_ai.*`) attributes.
 *
 * The fields below are an explicit **allowlist**: only these are ever read from
 * a span (see {@link FIELD_SPECS}). Anything not mapped — prompt/response
 * content, messages, tool calls, embeddings payloads, and other
 * potentially-sensitive or bulky attributes — is not captured.
 *
 * For each category we describe how multiple AIMetadata values are aggregated
 * (see {@link aggregate}).
 */
interface AIMetadata {
  /** The requested model, e.g. `gpt-4.1-nano`. */
  requestModel?: string;
  /**
   * The model that actually served the request. This is often a dated snapshot
   * of the requested {@link AIMetadata.requestModel} (e.g.
   * `gpt-4.1-nano-2025-04-14`).
   */
  responseModel?: string;
  /** The AI provider that served the request (e.g. `openai`) */
  provider?: string;
  /** The provider's identifier for the response, e.g. `chatcmpl-...`. */
  responseId?: string;
  /**
   * Why generation stopped, as reported by the provider, e.g. `["stop"]`,
   * `["length"]`, or `["tool_calls"]`. Last-write-wins across calls.
   */
  finishReasons?: string[];
  /** The number of input tokens consumed by the request. */
  inputTokens?: number;
  /** The number of output tokens produced by the response. */
  outputTokens?: number;
  /** The total tokens consumed, as reported by the provider. */
  totalTokens?: number;
  /**
   * Cached input tokens read from the prompt cache. Providers differ on
   * accounting. OpenAI's cached tokens are a subset of
   * {@link AIMetadata.inputTokens}, Anthropic's are additive. Callers must
   * not assume a single relationship.
   */
  cacheReadTokens?: number;
  /** Tokens written to the prompt cache. */
  cacheCreationTokens?: number;
  /** Reasoning/thinking tokens, when the emitter reports them separately. */
  reasoningTokens?: number;
  /** Sampling temperature requested, e.g. `0.7`. */
  temperature?: number;
  /** Nucleus sampling probability mass requested (`top_p`), e.g. `0.9`. */
  topP?: number;
  /** Upper bound on tokens to generate (`max_tokens`). */
  maxTokens?: number;
  /** Frequency penalty requested. */
  frequencyPenalty?: number;
  /** Presence penalty requested. */
  presencePenalty?: number;
  /** Sampling seed requested, when the emitter reports it. */
  seed?: number;
}
//#endregion
export { AIMetadata };
//# sourceMappingURL=aiExtractor.d.ts.map