mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
fix(Anthropic Chat Model Node): Fix LmChatAnthropic node to work when both thinking is enabled and tools used (#16010)
This commit is contained in:
committed by
GitHub
parent
0bea193814
commit
e662998c67
@@ -75,8 +75,8 @@ export class ToolExecutor implements INodeType {
|
||||
}
|
||||
} else {
|
||||
// Handle single tool
|
||||
if (!toolName || toolName === (tool as Tool).name) {
|
||||
const result = await executeTool(tool as Tool, parsedQuery);
|
||||
if (!toolName || toolName === tool.name) {
|
||||
const result = await executeTool(tool, parsedQuery);
|
||||
resultData.push(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import type { StructuredTool } from 'langchain/tools';
|
||||
import type { Tool } from '@langchain/core/tools';
|
||||
import { type IDataObject, type INodeExecutionData } from 'n8n-workflow';
|
||||
|
||||
import { convertObjectBySchema } from './convertToSchema';
|
||||
|
||||
export async function executeTool(
|
||||
tool: StructuredTool,
|
||||
query: string | object,
|
||||
): Promise<INodeExecutionData> {
|
||||
export async function executeTool(tool: Tool, query: string | object): Promise<INodeExecutionData> {
|
||||
let convertedQuery: string | object = query;
|
||||
if ('schema' in tool && tool.schema) {
|
||||
convertedQuery = convertObjectBySchema(query, tool.schema);
|
||||
|
||||
Reference in New Issue
Block a user