{"record":{"id":"9e93ca61410b2e1e","repo":"FlowiseAI/Flowise","slug":"this-agent-only-compatible-with-function-calling-m-9e93ca","errorCode":null,"errorMessage":"This agent only compatible with function calling models.","messagePattern":"This agent only compatible with function calling models\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/multiagents/Worker/Worker.ts","lineNumber":200,"sourceCode":"            new MessagesPlaceholder('agent_scratchpad')\n            /* Gettind rid of this for now because other LLMs dont support system message at later stage\n            [\n                'system',\n                [\n                    'Supervisor instructions: {instructions}\\n' + tools.length\n                        ? `Remember, you individually can only use these tools: ${toolNames}`\n                        : '' + '\\n\\nEnd if you have already completed the requested task. Communicate the work completed.'\n                ].join('\\n')\n            ]*/\n        ])\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 (!workerInputVariablesValues || !Object.keys(workerInputVariablesValues).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            ])\n        } else {\n            agent = RunnableSequence.from([\n                RunnablePassthrough.assign({","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/multiagents/Worker/Worker.ts#L182-L218","documentation":"Worker's createAgent helper throws when `llm.bindTools === undefined` after assembling its prompt and splicing in any multimodal message template. The worker agent uses `llm.bindTools(tools)` to construct the tool-calling chain; without bindTools the agent cannot invoke its tools.","triggerScenarios":"Passing a non-function-calling model to a Worker that has tools attached; using a model integration that lacks bindTools in the installed LangChain version.","commonSituations":"Authoring a tool-using worker against a base/text-only model; downgrading LangChain; mixing in a custom model class.","solutions":["Choose a tool-calling-capable model for any worker that has tools.","If the worker has no tools, consider a code path that skips bindTools (requires a code change).","Ensure the LangChain model package version exposes bindTools.","Validate at flow-save: refuse to attach tools to a non-tool-calling model."],"exampleFix":"// before\nif (llm.bindTools === undefined) {\n  throw new Error(`This agent only compatible with function calling models.`)\n}\n// after\nif (typeof llm.bindTools !== 'function') {\n  throw new Error(`Worker needs a tool-calling model. ${llm?.constructor?.name ?? 'Model'} does not implement bindTools.`)\n}","handlingStrategy":"type-guard","validationCode":"if (typeof llm.bindTools !== 'function') {\n  throw new Error('Worker requires a tool-calling model.')\n}","typeGuard":"const isToolCallingModel = (m: any): boolean => typeof m?.bindTools === 'function'","tryCatchPattern":null,"preventionTips":["Only attach tools to workers backed by tool-calling models.","Validate at flow-save: refuse tools on non-tool-calling models."],"tags":["langchain","multiagent","function-calling","worker"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}