{"record":{"id":"13e35f3cc4d4d4c0","repo":"FlowiseAI/Flowise","slug":"llm-node-only-compatible-with-function-calling-mod","errorCode":null,"errorMessage":"LLM Node only compatible with function calling models.","messagePattern":"LLM Node only compatible with function calling models\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/sequentialagents/LLMNode/LLMNode.ts","lineNumber":505,"sourceCode":"    }\n}\n\nasync function createAgent(\n    nodeData: INodeData,\n    options: ICommonObject,\n    llmNodeName: string,\n    state: ISeqAgentsState,\n    llm: BaseChatModel,\n    tools: any[],\n    systemPrompt: string,\n    humanPrompt: string,\n    multiModalMessageContent: MessageContentImageUrl[],\n    llmNodeInputVariablesValues: ICommonObject,\n    llmStructuredOutput: string\n): Promise<AgentExecutor | RunnableSequence> {\n    if (tools.length) {\n        if (llm.bindTools === undefined) {\n            throw new Error(`LLM Node only compatible with function calling models.`)\n        }\n        // @ts-ignore\n        llm = llm.bindTools(tools)\n    }\n\n    if (llmStructuredOutput && llmStructuredOutput !== '[]') {\n        try {\n            const structuredOutput = z.object(convertStructuredSchemaToZod(llmStructuredOutput))\n\n            // @ts-ignore\n            llm = llm.withStructuredOutput(structuredOutput, {\n                method: 'functionCalling'\n            })\n        } catch (exception) {\n            console.error(exception)\n        }\n    }\n","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/sequentialagents/LLMNode/LLMNode.ts#L487-L523","documentation":"When tools are attached to the LLM Node, the model must support tool/function calling via bindTools. If llm.bindTools is undefined (the integration does not implement function calling), the node refuses to build the agent because tool calls could never be produced. Checked inside createAgent at init.","triggerScenarios":"tools.length > 0 and the selected model's LangChain integration does not expose bindTools — e.g. an older completion-style model, some local/Ollama models without function calling, or a langchain integration package too old to implement bindTools.","commonSituations":"Selecting a non-function-calling model while tools are wired; upgrading Flowise but not the model integration packages; mixing a vision-only or text-only model with tool nodes.","solutions":["Switch the LLM Node's model to a function-calling-capable one (e.g. gpt-4/gpt-4o, Claude, Mistral-Large, Gemini).","Remove the tools from the node if tool calling is not required.","Upgrade the relevant langchain model-integration package so bindTools is present on the model class."],"exampleFix":"// before: non-FC model with tools\nmodel: ChatOpenAI({...}) // older integration w/o bindTools\ntools: [searchTool]\n\n// after: use a supported FC model and current integration\nmodel: new ChatOpenAI({ model: 'gpt-4o', ... }) // bindTools available\ntools: [searchTool]","handlingStrategy":"type-guard","validationCode":"if (tools.length && typeof (model as any).bindTools !== 'function') {\n  throw new Error(`Model ${/* name */ ''} does not support function calling (bindTools). Remove tools or pick an FC model.`)\n}","typeGuard":"const supportsFunctionCalling = (m: any): boolean => typeof m?.bindTools === 'function'","tryCatchPattern":null,"preventionTips":["Pair tools only with known function-calling models.","Keep langchain model-integration packages current so bindTools is present.","When in doubt, check `typeof model.bindTools === 'function'` before attaching tools."],"tags":["llm-node","function-calling","tools","model-compat","init"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}