Skip to content

Commit 60b6a51

Browse files
committed
Use shouldEnableTruncation in Vercel AI integration
1 parent 457e80e commit 60b6a51

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/core/src/tracing/vercel-ai

packages/core/src/tracing/vercel-ai/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable max-lines */
22
import type { Client } from '../../client';
33
import { getClient } from '../../currentScopes';
4-
import { hasSpanStreamingEnabled } from '../../tracing/spans/hasSpanStreamingEnabled';
54
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../../semanticAttributes';
5+
import { shouldEnableTruncation } from '../ai/utils';
66
import type { Event } from '../../types-hoist/event';
77
import type { Span, SpanAttributes, SpanAttributeValue, SpanJSON } from '../../types-hoist/span';
88
import { spanToJSON } from '../../utils/spanUtils';
@@ -120,7 +120,7 @@ function onVercelAiSpanStart(span: Span): void {
120120
const integration = client?.getIntegrationByName('VercelAI') as
121121
| { options?: { enableTruncation?: boolean } }
122122
| undefined;
123-
const enableTruncation = integration?.options?.enableTruncation ?? !(client && hasSpanStreamingEnabled(client));
123+
const enableTruncation = shouldEnableTruncation(integration?.options?.enableTruncation);
124124

125125
processGenerateSpan(span, name, attributes, enableTruncation);
126126
}

0 commit comments

Comments
 (0)