fix(OpenAI Node): Fix tool parameter parsing issue (#11201)

This commit is contained in:
Eugene 2024-10-10 13:50:30 +02:00 committed by GitHub
parent fade9e43c8
commit 5a1d81ad91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -278,7 +278,7 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
for (const tool of externalTools ?? []) {
if (tool.name === functionName) {
const parsedArgs: { input: string } = jsonParse(functionArgs);
const functionInput = parsedArgs.input ?? functionArgs;
const functionInput = parsedArgs.input ?? parsedArgs ?? functionArgs;
functionResponse = await tool.invoke(functionInput);
}
}