UNPKG

@n8n/n8n-nodes-langchain

Version:
24 lines (23 loc) • 1.68 kB
import type { BaseMessage } from '@langchain/core/messages'; import { Tool } from '@langchain/core/tools'; import type { ICredentialDataDecryptedObject, IDataObject, IExecuteFunctions, ISupplyDataFunctions, IWebhookFunctions } from 'n8n-workflow'; export declare function parseJsonParameter<T>(value: unknown, errorMessage: string): T; export declare function getPromptInputByType(options: { ctx: IExecuteFunctions | ISupplyDataFunctions; i: number; promptTypeKey: string; inputKey: string; }): string; export declare function coerceSessionIdToString(ctx: ISupplyDataFunctions | IWebhookFunctions, sessionId: unknown, itemIndex: number): string; export declare function getSessionId(ctx: ISupplyDataFunctions | IWebhookFunctions, itemIndex: number, selectorKey?: string, autoSelect?: string, customKey?: string): string; export declare function serializeChatHistory(chatHistory: BaseMessage[]): string; export declare function escapeSingleCurlyBrackets(text?: string): string | undefined; export declare const getConnectedTools: (ctx: IExecuteFunctions | IWebhookFunctions | ISupplyDataFunctions, enforceUniqueNames: boolean, convertStructuredTool?: boolean, escapeCurlyBrackets?: boolean, options?: { inputData?: IDataObject; }) => Promise<Tool[]>; export declare function getCustomCredentialHeader(credentials: ICredentialDataDecryptedObject): { name: string; value: string; } | undefined; export declare function mergeCustomHeaders(credentials: ICredentialDataDecryptedObject, defaultHeaders: Record<string, string>): Record<string, string>; export declare function unwrapNestedOutput(output: Record<string, unknown>): Record<string, unknown>;