Bugfix/Tool Agent output message (#2990)

* add fix for tool agent output message

* pin langchain core dependency
This commit is contained in:
Henry Heng
2024-08-10 13:56:08 +01:00
committed by GitHub
parent 376e644cec
commit d4b41689da
5 changed files with 7536 additions and 5751 deletions
@@ -135,7 +135,12 @@ class ToolAgent_Agents implements INode {
}
}
let output = res?.output as string
let output = res?.output
if (Array.isArray(output)) {
output = output[0]?.text || ''
} else if (typeof output === 'object') {
output = output?.text || ''
}
// Claude 3 Opus tends to spit out <thinking>..</thinking> as well, discard that in final output
const regexPattern: RegExp = /<thinking>[\s\S]*?<\/thinking>/