File tree Expand file tree Collapse file tree
packages/core/src/tracing/langgraph Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717 getJsonString ,
1818 getTruncatedJsonString ,
1919 resolveAIRecordingOptions ,
20+ shouldEnableTruncation ,
2021} from '../ai/utils' ;
2122import type { LangChainMessage } from '../langchain/types' ;
2223import { normalizeLangChainMessages } from '../langchain/utils' ;
@@ -150,7 +151,7 @@ function instrumentCompiledGraphInvoke(
150151 span . setAttribute ( GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE , systemInstructions ) ;
151152 }
152153
153- const enableTruncation = options . enableTruncation ?? true ;
154+ const enableTruncation = shouldEnableTruncation ( options . enableTruncation ) ;
154155 const filteredLength = Array . isArray ( filteredMessages ) ? filteredMessages . length : 0 ;
155156 span . setAttributes ( {
156157 [ GEN_AI_INPUT_MESSAGES_ATTRIBUTE ] : enableTruncation
You can’t perform that action at this time.
0 commit comments