ai
Version:
AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.
22 lines (19 loc) • 551 B
text/typescript
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,
};
}