UNPKG

@n8n/n8n-nodes-langchain

Version:

![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)

11 lines (10 loc) 919 B
import type { BaseChatMemory } from '@langchain/classic/memory'; import type { BaseChatModel } from '@langchain/core/language_models/chat_models'; import type { BaseMessage } from '@langchain/core/messages'; import type { IDataObject, GenericValue } from 'n8n-workflow'; import type { ToolCallData } from './types'; export declare function extractToolCallId(toolCallId: IDataObject | GenericValue | GenericValue[] | IDataObject[], toolName: string): string; export declare function buildMessagesFromSteps(steps: ToolCallData[]): BaseMessage[]; export declare function buildToolContext(steps: ToolCallData[]): string; export declare function loadMemory(memory?: BaseChatMemory, model?: BaseChatModel, maxTokens?: number): Promise<BaseMessage[] | undefined>; export declare function saveToMemory(input: string, output: string, memory?: BaseChatMemory, steps?: ToolCallData[], previousStepsCount?: number): Promise<void>;