Skip to content

Commit db1daef

Browse files
committed
Use shouldEnableTruncation in LangGraph integration
1 parent 670d7f6 commit db1daef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • packages/core/src/tracing/langgraph

packages/core/src/tracing/langgraph/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
getJsonString,
1818
getTruncatedJsonString,
1919
resolveAIRecordingOptions,
20+
shouldEnableTruncation,
2021
} from '../ai/utils';
2122
import type { LangChainMessage } from '../langchain/types';
2223
import { 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

0 commit comments

Comments
 (0)