UNPKG

langflow-chatbot

Version:

Add a Langflow-powered chatbot to your website.

46 lines (45 loc) 1.68 kB
import { LogLevel } from '../utils/logger'; export interface LangflowChatbotInitConfig { containerId?: string; profileId: string; proxyApiBasePath: string; sessionId?: string; mode?: 'floating' | 'embedded'; useFloating?: boolean; enableStream?: boolean; widgetTitle?: string; userSender?: string; botSender?: string; messageTemplate?: string; mainContainerTemplate?: string; inputAreaTemplate?: string; floatPosition?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'; onSessionIdChanged?: (sessionId: string) => void; logLevel?: LogLevel; datetimeFormat?: string; floatingPanelWidth?: string; } export declare class LangflowChatbotInstance { private initialConfig; private serverProfile; private chatClient; private widgetInstance; private isInitialized; private listeners; private logger; constructor(config: LangflowChatbotInitConfig); on(event: string, handler: (data: any) => void): void; private _emit; private _handleInternalSessionIdUpdate; /** * Returns the container element for attaching listeners or custom behavior. * For floating widgets, this returns the element specified by containerId (if provided). * For embedded widgets, this returns the container element where the widget is embedded. * @returns {HTMLElement | null} The container element, or null if not available. */ getContainerElement(): HTMLElement | null; private _determineFloatingMode; init(): Promise<void>; destroy(): void; } export declare function init(config: LangflowChatbotInitConfig): Promise<LangflowChatbotInstance>;