mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(Google Gemini Node): Error when used as tool with "Message a model" operation (#17491)
This commit is contained in:
@@ -51,6 +51,7 @@ describe('GoogleGemini Node', () => {
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
executeFunctionsMock.getNodeInputs.mockReturnValue([{ type: 'main' }, { type: 'ai_tool' }]);
|
||||
getConnectedToolsMock.mockResolvedValue([]);
|
||||
apiRequestMock.mockResolvedValue({
|
||||
candidates: [
|
||||
|
||||
@@ -236,7 +236,10 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
|
||||
responseMimeType: jsonOutput ? 'application/json' : undefined,
|
||||
};
|
||||
|
||||
const availableTools = await getConnectedTools(this, true);
|
||||
const nodeInputs = this.getNodeInputs();
|
||||
const availableTools = nodeInputs.some((i) => i.type === 'ai_tool')
|
||||
? await getConnectedTools(this, true)
|
||||
: [];
|
||||
const tools: Tool[] = [
|
||||
{
|
||||
functionDeclarations: availableTools.map((t) => ({
|
||||
|
||||
Reference in New Issue
Block a user