UNPKG

n8n-nodes-sap-ai-core

Version:

n8n nodes for SAP AI Core LLM and embeddings integration

87 lines 2.88 kB
import type { IExecuteFunctions } from 'n8n-workflow'; /** * Get metadata filters values from node parameters */ export declare function getMetadataFiltersValues(ctx: IExecuteFunctions, itemIndex: number): any; /** * Check if object is a base chat memory instance */ export declare function isBaseChatMemory(obj: any): boolean; /** * Check if object is a base chat message history instance */ export declare function isBaseChatMessageHistory(obj: any): boolean; /** * Check if model is a chat instance */ export declare function isChatInstance(model: any): boolean; /** * Check if model is a tools instance */ export declare function isToolsInstance(model: any): boolean; /** * Get prompt input based on type configuration */ export declare function getPromptInputByType(options: { ctx: IExecuteFunctions; i: number; promptTypeKey: string; inputKey: string; }): any; /** * Get session ID from various sources */ export declare function getSessionId(ctx: IExecuteFunctions, itemIndex: number, selectorKey?: string, autoSelect?: string, customKey?: string): string; /** * Log AI events with proper error handling */ export declare function logAiEvent(executeFunctions: IExecuteFunctions, event: string, data?: any): void; /** * Serialize chat history to string format */ export declare function serializeChatHistory(chatHistory: any[]): string; /** * Escape single curly brackets for template safety */ export declare function escapeSingleCurlyBrackets(text?: string): string | undefined; /** * Enhanced getConnectedTools function with comprehensive tool discovery and validation * Based on OpenAI Assistant implementation with SAP AI Core adaptations */ export declare const getConnectedTools: (ctx: IExecuteFunctions, enforceUniqueNames: boolean, convertStructuredTool?: boolean, escapeCurlyBrackets?: boolean) => Promise<any[]>; /** * Unwrap nested output structures */ export declare function unwrapNestedOutput(output: any): any; /** * Check for long sequential character repeats (potential infinite loops) */ export declare function hasLongSequentialRepeat(text: string, threshold?: number): boolean; /** * Validate tool configuration */ export declare function validateTool(tool: any): { isValid: boolean; errors: string[]; }; /** * Get tool information for debugging */ export declare function getToolInfo(tool: any): any; /** * Create a safe wrapper for tool execution */ export declare function createSafeToolWrapper(tool: any, ctx: IExecuteFunctions): any; /** * Filter tools by capabilities */ export declare function filterToolsByCapability(tools: any[], capability: string): any[]; /** * Sort tools by priority */ export declare function sortToolsByPriority(tools: any[]): any[]; /** * Get tool statistics */ export declare function getToolStatistics(tools: any[]): any; //# sourceMappingURL=helpers.d.ts.map