llmasaservice-ui
Version:
Prebuilt UI components for LLMAsAService.io
137 lines (133 loc) • 4.03 kB
TypeScript
import { LLMAsAServiceCustomer } from 'llmasaservice-client';
import React from 'react';
import PrismStyle from 'react-syntax-highlighter';
interface ChatPanelProps {
project_id: string;
initialPrompt?: string;
initialMessage?: string;
title?: string;
placeholder?: string;
hideInitialPrompt?: boolean;
customer?: LLMAsAServiceCustomer;
messages?: {
role: "user" | "assistant";
content: string;
}[];
data?: {
key: string;
data: string;
}[];
thumbsUpClick?: (callId: string) => void;
thumbsDownClick?: (callId: string) => void;
theme?: "light" | "dark";
cssUrl?: string;
markdownClass?: string;
width?: string;
height?: string;
url?: string | null;
scrollToEnd?: boolean;
prismStyle?: PrismStyle;
service?: string | null;
historyChangedCallback?: (history: {
[key: string]: {
content: string;
callId: string;
};
}) => void;
responseCompleteCallback?: (callId: string, prompt: string, response: string) => void;
promptTemplate?: string;
actions?: {
pattern: string;
type?: string;
markdown?: string;
callback?: (match: string, groups: any[]) => void;
clickCode?: string;
style?: string;
}[];
showSaveButton?: boolean;
showEmailButton?: boolean;
showNewConversationButton?: boolean;
followOnQuestions?: string[];
clearFollowOnQuestionsNextPrompt?: boolean;
followOnPrompt?: string;
showPoweredBy?: boolean;
agent?: string | null;
conversation?: string | null;
showCallToAction?: boolean;
callToActionButtonText?: string;
callToActionEmailAddress?: string;
callToActionEmailSubject?: string;
initialHistory?: {
[prompt: string]: {
content: string;
callId: string;
};
};
hideRagContextInPrompt?: boolean;
createConversationOnFirstChat?: boolean;
customerEmailCaptureMode?: "HIDE" | "OPTIONAL" | "REQUIRED";
customerEmailCapturePlaceholder?: string;
mcpServers?: [];
progressiveActions?: boolean;
}
interface ExtraProps$1 extends React.HTMLAttributes<HTMLElement> {
inline?: boolean;
}
declare const ChatPanel: React.FC<ChatPanelProps & ExtraProps$1>;
interface AgentPanelProps {
customer?: LLMAsAServiceCustomer;
messages?: {
role: "user" | "assistant";
content: string;
}[];
data?: {
key: string;
data: string;
}[];
thumbsUpClick?: (callId: string) => void;
thumbsDownClick?: (callId: string) => void;
theme?: "light" | "dark";
markdownClass?: string;
width?: string;
height?: string;
url?: string;
prismStyle?: PrismStyle;
service?: string | null;
historyChangedCallback?: (history: {
[key: string]: {
content: string;
callId: string;
};
}) => void;
responseCompleteCallback?: (callId: string, prompt: string, response: string) => void;
actions?: {
pattern: string;
type?: string;
markdown?: string;
callback?: (match: string, groups: any[]) => void;
clickCode?: string;
style?: string;
}[];
followOnQuestions?: string[];
clearFollowOnQuestionsNextPrompt?: boolean;
followOnPrompt?: string;
showPoweredBy?: boolean;
agent: string;
conversation?: string | null;
initialHistory?: {
[key: string]: {
content: string;
callId: string;
};
};
hideRagContextInPrompt?: boolean;
createConversationOnFirstChat?: boolean;
customerEmailCaptureMode?: "HIDE" | "OPTIONAL" | "REQUIRED";
customerEmailCapturePlaceholder?: string;
progressiveActions?: boolean;
}
interface ExtraProps extends React.HTMLAttributes<HTMLElement> {
inline?: boolean;
}
declare const AgentPanel: React.FC<AgentPanelProps & ExtraProps>;
export { AgentPanel, type AgentPanelProps, ChatPanel, type ChatPanelProps };