Skip to content

Commit 91d2eec

Browse files
committed
refactor: Improve code readability by formatting object literals in ToolAgent methods
1 parent afd11ab commit 91d2eec

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/components/nodes/agents/ToolAgent/ToolAgent.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,12 @@ class ToolAgent_Agents implements INode {
116116
}
117117

118118
async init(nodeData: INodeData, input: string, options: ICommonObject): Promise<any> {
119-
return prepareAgent(nodeData, options, { sessionId: this.sessionId, chatId: options.chatId, input, sseStreamer: options.sseStreamer })
119+
return prepareAgent(nodeData, options, {
120+
sessionId: this.sessionId,
121+
chatId: options.chatId,
122+
input,
123+
sseStreamer: options.sseStreamer
124+
})
120125
}
121126

122127
async run(nodeData: INodeData, input: string, options: ICommonObject): Promise<string | ICommonObject> {
@@ -141,7 +146,12 @@ class ToolAgent_Agents implements INode {
141146
}
142147
}
143148

144-
const executor = await prepareAgent(nodeData, options, { sessionId: this.sessionId, chatId: options.chatId, input, sseStreamer: options.sseStreamer })
149+
const executor = await prepareAgent(nodeData, options, {
150+
sessionId: this.sessionId,
151+
chatId: options.chatId,
152+
input,
153+
sseStreamer: options.sseStreamer
154+
})
145155

146156
const loggerHandler = new ConsoleCallbackHandler(options.logger, options?.orgId)
147157
const callbacks = await additionalCallbacks(nodeData, options)
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { z } from 'zod'
2-
31
export const MCP_STREAMING_CONFIG = {
42
DEFAULT_COMPLETION_TIMEOUT: 600000, // 10 minutes fallback - only as safety net
53
NOTIFICATION_DELAY: 1000, // 1 second delay before cleanup
64
SUPPORTED_NOTIFICATION_TYPES: ['logging/message', 'progress'],
75
STREAMING_MARKER: '[MCP Streaming]'
8-
}
6+
}

0 commit comments

Comments
 (0)