fix(Anthropic Chat Model Node): Fix LmChatAnthropic node to work when both thinking is enabled and tools used (#16010)

This commit is contained in:
Yiorgis Gozadinos
2025-06-05 13:33:51 +02:00
committed by GitHub
parent 0bea193814
commit e662998c67
7 changed files with 177 additions and 141 deletions

View File

@@ -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);