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;
|
return undefined;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
executeFunctionsMock.getNodeInputs.mockReturnValue([{ type: 'main' }, { type: 'ai_tool' }]);
|
||||||
getConnectedToolsMock.mockResolvedValue([]);
|
getConnectedToolsMock.mockResolvedValue([]);
|
||||||
apiRequestMock.mockResolvedValue({
|
apiRequestMock.mockResolvedValue({
|
||||||
candidates: [
|
candidates: [
|
||||||
|
|||||||
@@ -236,7 +236,10 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
|
|||||||
responseMimeType: jsonOutput ? 'application/json' : undefined,
|
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[] = [
|
const tools: Tool[] = [
|
||||||
{
|
{
|
||||||
functionDeclarations: availableTools.map((t) => ({
|
functionDeclarations: availableTools.map((t) => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user