Bugfix/Gsuite tool params (#5189)

* fix gsuite tool params

* custom assistant only check for mandatory fields for visible params

* azure chat openai fix for gpt5

* return raw from executeJavaScriptCode

* add json5 for parsing

* azure chatopenai use maxCompletionTokens
This commit is contained in:
Henry Heng
2025-09-11 19:33:52 +01:00
committed by GitHub
parent 32bf030924
commit 6fb9bb559f
19 changed files with 541 additions and 736 deletions
@@ -1723,9 +1723,20 @@ class Agent_Agentflow implements INode {
}
console.error('Error invoking tool:', e)
const errMsg = getErrorMessage(e)
let toolInput = toolCall.args
if (typeof errMsg === 'string' && errMsg.includes(TOOL_ARGS_PREFIX)) {
const [_, args] = errMsg.split(TOOL_ARGS_PREFIX)
try {
toolInput = JSON.parse(args)
} catch (e) {
console.error('Error parsing tool input from tool:', e)
}
}
usedTools.push({
tool: selectedTool.name,
toolInput: toolCall.args,
toolInput,
toolOutput: '',
error: getErrorMessage(e)
})
@@ -1995,9 +2006,20 @@ class Agent_Agentflow implements INode {
}
console.error('Error invoking tool:', e)
const errMsg = getErrorMessage(e)
let toolInput = toolCall.args
if (typeof errMsg === 'string' && errMsg.includes(TOOL_ARGS_PREFIX)) {
const [_, args] = errMsg.split(TOOL_ARGS_PREFIX)
try {
toolInput = JSON.parse(args)
} catch (e) {
console.error('Error parsing tool input from tool:', e)
}
}
usedTools.push({
tool: selectedTool.name,
toolInput: toolCall.args,
toolInput,
toolOutput: '',
error: getErrorMessage(e)
})