Files
klz-cables.com/.pnpm-store/v10/files/e9/ddbbddb71441d8d9bae8d416e9106199b8e5c1384478741b6f2fdac71bec51c9f56d745f75b1b6c94513f662e1dda8270eb180b758c3a43e5284e4f1eece0e
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

46 lines
1.9 KiB
Plaintext

/**
* Shared utils for AI integrations (OpenAI, Anthropic, Verce.AI, etc.)
*/
import type { Span } from '../../types-hoist/span';
/**
* Maps AI method paths to OpenTelemetry semantic convention operation names
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#llm-request-spans
*/
export declare function getFinalOperationName(methodPath: string): string;
/**
* Get the span operation for AI methods
* Following Sentry's convention: "gen_ai.{operation_name}"
*/
export declare function getSpanOperation(methodPath: string): string;
/**
* Build method path from current traversal
*/
export declare function buildMethodPath(currentPath: string, prop: string): string;
/**
* Set token usage attributes
* @param span - The span to add attributes to
* @param promptTokens - The number of prompt tokens
* @param completionTokens - The number of completion tokens
* @param cachedInputTokens - The number of cached input tokens
* @param cachedOutputTokens - The number of cached output tokens
*/
export declare function setTokenUsageAttributes(span: Span, promptTokens?: number, completionTokens?: number, cachedInputTokens?: number, cachedOutputTokens?: number): void;
/**
* Get the truncated JSON string for a string or array of strings.
*
* @param value - The string or array of strings to truncate
* @returns The truncated JSON string
*/
export declare function getTruncatedJsonString<T>(value: T | T[]): string;
/**
* Extract system instructions from messages array.
* Finds the first system message and formats it according to OpenTelemetry semantic conventions.
*
* @param messages - Array of messages to extract system instructions from
* @returns systemInstructions (JSON string) and filteredMessages (without system message)
*/
export declare function extractSystemInstructions(messages: unknown[] | unknown): {
systemInstructions: string | undefined;
filteredMessages: unknown[] | unknown;
};
//# sourceMappingURL=utils.d.ts.map