react-native-langflow-chat
Version:
A native React Native component for integrating LangFlow chat with streaming support, citation bubbles, react-native-marked rendering, and customizable UI
65 lines • 2.07 kB
TypeScript
import { TextStyle, ViewStyle } from "react-native";
export interface LangFlowMessage {
type: "user_message" | "bot_message" | "system" | "error";
text: string;
timestamp?: number;
metadata?: Record<string, any>;
}
export interface LangFlowError {
message: string;
code?: string;
details?: any;
}
export type ChatPosition = "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-right" | "bottom-center" | "bottom-left";
export interface LangFlowChatWidgetProps {
flowId: string;
hostUrl: string;
apiKey?: string;
windowTitle?: string;
chatInputs?: Record<string, any>;
chatInputField?: string;
tweaks?: Record<string, any>;
sessionId?: string;
additionalHeaders?: Record<string, any>;
placeholder?: string;
placeholderSending?: string;
inputType?: string;
outputType?: string;
outputComponent?: string;
loadingText?: string;
errorMessage?: string;
fallbackMessage?: string;
sourceTooltipTitle?: string;
pageText?: string;
ofText?: string;
closeButtonAriaLabel?: string;
chatPosition?: ChatPosition;
height?: number;
width?: number;
online?: boolean;
startOpen?: boolean;
debugEnabled?: boolean;
enableMarkdown?: boolean;
fontSize?: number;
botMessageStyle?: ViewStyle & TextStyle;
chatWindowStyle?: ViewStyle;
errorMessageStyle?: ViewStyle & TextStyle;
inputContainerStyle?: ViewStyle;
inputStyle?: ViewStyle & TextStyle;
sendButtonStyle?: ViewStyle & TextStyle;
userMessageStyle?: ViewStyle & TextStyle;
citationBubbleColor?: string;
triggerComponent?: React.ReactNode;
triggerButtonStyle?: ViewStyle;
onMessage?: (message: LangFlowMessage) => void;
onError?: (error: LangFlowError) => void;
onLoad?: () => void;
onModalVisibilityChange?: (isVisible: boolean) => void;
}
export interface ChatMessage {
id: string;
type: "user" | "bot" | "system" | "error";
text: string;
timestamp: number;
}
//# sourceMappingURL=index.d.ts.map