mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
refactor: Update Langchain to 0.1.41 & add support for Claude 3 (#8825)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com> Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -170,7 +170,7 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
|
||||
let after: string | undefined;
|
||||
|
||||
do {
|
||||
const response = await apiRequest.call(this, 'GET', '/assistants', {
|
||||
const response = (await apiRequest.call(this, 'GET', '/assistants', {
|
||||
headers: {
|
||||
'OpenAI-Beta': 'assistants=v1',
|
||||
},
|
||||
@@ -178,16 +178,16 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
|
||||
limit: 100,
|
||||
after,
|
||||
},
|
||||
});
|
||||
})) as { data: IDataObject[]; has_more: boolean; last_id: string };
|
||||
|
||||
for (const assistant of response.data || []) {
|
||||
assistants.push(assistant.name);
|
||||
assistants.push(assistant.name as string);
|
||||
}
|
||||
|
||||
has_more = response.has_more;
|
||||
|
||||
if (has_more) {
|
||||
after = response.last_id as string;
|
||||
after = response.last_id;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { zodToJsonSchema } from 'zod-to-json-schema';
|
||||
import type { OpenAI as OpenAIClient } from 'openai';
|
||||
import type { StructuredTool } from 'langchain/tools';
|
||||
import type { OpenAIClient } from '@langchain/openai';
|
||||
import type { StructuredTool } from '@langchain/core/tools';
|
||||
|
||||
// Copied from langchain(`langchain/src/tools/convert_to_openai.ts`)
|
||||
// since these functions are not exported
|
||||
|
||||
Reference in New Issue
Block a user