UNPKG

ai

Version:

AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript

22 lines (19 loc) 551 B
import { TelemetrySettings } from './telemetry-settings'; export function assembleOperationName({ operationId, telemetry, }: { operationId: string; telemetry?: TelemetrySettings; }) { return { // standardized operation and resource name: 'operation.name': `${operationId}${ telemetry?.functionId != null ? ` ${telemetry.functionId}` : '' }`, 'resource.name': telemetry?.functionId, // detailed, AI SDK specific data: 'ai.operationId': operationId, 'ai.telemetry.functionId': telemetry?.functionId, }; }