From 4c89bf36d150ffa5de74a32483dc9dc789c9e5ce Mon Sep 17 00:00:00 2001 From: RulaKhaled Date: Thu, 11 Dec 2025 11:57:47 +0100 Subject: [PATCH] fix(tracing): Set span operations for AI spans with model ID only --- packages/core/src/tracing/vercel-ai/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/core/src/tracing/vercel-ai/index.ts b/packages/core/src/tracing/vercel-ai/index.ts index 62272d222fd5..93be1ca33423 100644 --- a/packages/core/src/tracing/vercel-ai/index.ts +++ b/packages/core/src/tracing/vercel-ai/index.ts @@ -24,7 +24,6 @@ import { import type { ProviderMetadata } from './vercel-ai-attributes'; import { AI_MODEL_ID_ATTRIBUTE, - AI_MODEL_PROVIDER_ATTRIBUTE, AI_PROMPT_MESSAGES_ATTRIBUTE, AI_PROMPT_TOOLS_ATTRIBUTE, AI_RESPONSE_OBJECT_ATTRIBUTE, @@ -65,12 +64,10 @@ function onVercelAiSpanStart(span: Span): void { return; } - // The AI and Provider must be defined for generate, stream, and embed spans. - // The id of the model + // The AI model ID must be defined for generate, stream, and embed spans. + // The provider is optional and may not always be present. const aiModelId = attributes[AI_MODEL_ID_ATTRIBUTE]; - // the provider of the model - const aiModelProvider = attributes[AI_MODEL_PROVIDER_ATTRIBUTE]; - if (typeof aiModelId !== 'string' || typeof aiModelProvider !== 'string' || !aiModelId || !aiModelProvider) { + if (typeof aiModelId !== 'string' || !aiModelId) { return; }