{"record":{"id":"02cc40c12f00d052","repo":"FlowiseAI/Flowise","slug":"this-agent-only-compatible-with-function-calling-m-02cc40","errorCode":null,"errorMessage":"This agent only compatible with function calling models.","messagePattern":"This agent only compatible with function calling models\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/sequentialagents/Agent/Agent.ts","lineNumber":651,"sourceCode":"): Promise<any> {\n    if (tools.length && !interrupt) {\n        const promptArrays = [\n            new MessagesPlaceholder('messages'),\n            new MessagesPlaceholder('agent_scratchpad')\n        ] as BaseMessagePromptTemplateLike[]\n        if (systemPrompt) promptArrays.unshift(['system', systemPrompt])\n        if (humanPrompt) promptArrays.push(['human', humanPrompt])\n\n        let prompt = ChatPromptTemplate.fromMessages(promptArrays)\n        prompt = await checkMessageHistory(nodeData, options, prompt, promptArrays, systemPrompt)\n\n        if (multiModalMessageContent.length) {\n            const msg = HumanMessagePromptTemplate.fromTemplate([...multiModalMessageContent])\n            prompt.promptMessages.splice(1, 0, msg)\n        }\n\n        if (llm.bindTools === undefined) {\n            throw new Error(`This agent only compatible with function calling models.`)\n        }\n        const modelWithTools = llm.bindTools(tools)\n\n        let agent\n\n        if (!agentInputVariablesValues || !Object.keys(agentInputVariablesValues).length) {\n            agent = RunnableSequence.from([\n                RunnablePassthrough.assign({\n                    //@ts-ignore\n                    agent_scratchpad: (input: { steps: ToolsAgentStep[] }) => formatToOpenAIToolMessages(input.steps)\n                }),\n                prompt,\n                modelWithTools,\n                new ToolCallingAgentOutputParser()\n            ]).withConfig({\n                metadata: { sequentialNodeName: agentName }\n            })\n        } else {","sourceCodeStart":633,"sourceCodeEnd":669,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/sequentialagents/Agent/Agent.ts#L633-L669","documentation":"Thrown on the non-interrupt tool-calling path when `llm.bindTools === undefined`. The Agent builds a `RunnableSequence` ending in `modelWithTools = llm.bindTools(tools)`, which only exists on chat models that support OpenAI-style function/tool calling. Without `bindTools`, the agent cannot attach tools at all, so init aborts before constructing the runnable.","triggerScenarios":"Calling Agent.init with `tools.length > 0` and `interrupt` falsy, where the resolved `llm` (either `nodeData.inputs.model` or `sequentialNodes[0].startLLM`) does not expose a `bindTools` method.","commonSituations":"Chose a non-function-calling chat model (older base model, a simple ChatModel integration, a model whose provider integration lacks tool support); using an older @langchain/core where `bindTools` had not yet been added; the `model` input was left empty and the Start node's LLM is non-tool-calling.","solutions":["Switch the Agent (or the Start node) to a function-calling-capable model — e.g. gpt-4o, gpt-3.5-turbo-0613+, Claude 3+, Gemini 1.5+.","Upgrade `@langchain/core` and the relevant provider package to a version that implements `bindTools`.","Remove the attached tools if you do not actually need tool calling on this agent.","Set the Agent's `model` input explicitly rather than relying on the inherited Start LLM."],"exampleFix":"// before: Start node model is a basic chat model with no bindTools\nnodeData.inputs.model = basicChatModel\nnodeData.inputs.tools = [searchTool] // throws [283]\n\n// after\nnodeData.inputs.model = new ChatOpenAI({ modelName: 'gpt-4o' }) // supports bindTools","handlingStrategy":"type-guard","validationCode":"function assertFunctionCallingModel(llm) {\n  if (typeof llm?.bindTools !== 'function') {\n    throw new Error(\n      `Model ${llm?.constructor?.name ?? typeof llm} does not support tool calling. Use a function-calling-capable model (gpt-4o, Claude 3+, Gemini 1.5+).`\n    )\n  }\n}\n\nassertFunctionCallingModel(llm)","typeGuard":"function supportsFunctionCalling(llm): llm is BaseChatModel & { bindTools: (tools: unknown[]) => unknown } {\n  return typeof (llm as any)?.bindTools === 'function'\n}","tryCatchPattern":null,"preventionTips":["Always set the Agent's `model` input explicitly to a known function-calling model when tools are attached.","Upgrade @langchain/core and the provider integration so bindTools is present.","Do not rely on the inherited Start LLM being tool-capable unless you have verified it."],"tags":["llm","function-calling","tools","model-compat","langchain"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}