File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
packages/core/src/tracing/ai Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 33 */
44import { captureException } from '../../exports' ;
55import { getClient } from '../../currentScopes' ;
6+ import { hasSpanStreamingEnabled } from '../spans/hasSpanStreamingEnabled' ;
67import type { Span } from '../../types-hoist/span' ;
78import { isThenable } from '../../utils/is' ;
89import {
@@ -56,6 +57,16 @@ export function resolveAIRecordingOptions<T extends AIRecordingOptions>(options?
5657 } as T & Required < AIRecordingOptions > ;
5758}
5859
60+ /**
61+ * Resolves whether truncation should be enabled.
62+ * If the user explicitly set `enableTruncation`, that value is used.
63+ * Otherwise, truncation is disabled when span streaming is active.
64+ */
65+ export function shouldEnableTruncation ( enableTruncation : boolean | undefined ) : boolean {
66+ const client = getClient ( ) ;
67+ return enableTruncation ?? ! ( client && hasSpanStreamingEnabled ( client ) ) ;
68+ }
69+
5970/**
6071 * Build method path from current traversal
6172 */
You can’t perform that action at this time.
0 commit comments