@cognizant-ai-lab/ui-common 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AgentChat/ChatCommon.d.ts +94 -0
- package/dist/components/AgentChat/ChatCommon.js +581 -0
- package/dist/components/AgentChat/ControlButtons.d.ts +16 -0
- package/dist/components/AgentChat/ControlButtons.js +24 -0
- package/dist/components/AgentChat/FormattedMarkdown.d.ts +32 -0
- package/dist/components/AgentChat/FormattedMarkdown.js +82 -0
- package/dist/components/AgentChat/Greetings.d.ts +1 -0
- package/dist/components/AgentChat/Greetings.js +38 -0
- package/dist/components/AgentChat/LlmChatButton.d.ts +12 -0
- package/dist/components/AgentChat/LlmChatButton.js +33 -0
- package/dist/components/AgentChat/SendButton.d.ts +12 -0
- package/dist/components/AgentChat/SendButton.js +28 -0
- package/dist/components/AgentChat/SyntaxHighlighterThemes.d.ts +14 -0
- package/dist/components/AgentChat/SyntaxHighlighterThemes.js +27 -0
- package/dist/components/AgentChat/Types.d.ts +17 -0
- package/dist/components/AgentChat/Types.js +26 -0
- package/dist/components/AgentChat/UserQueryDisplay.d.ts +5 -0
- package/dist/components/AgentChat/UserQueryDisplay.js +33 -0
- package/dist/components/AgentChat/Utils.d.ts +11 -0
- package/dist/components/AgentChat/Utils.js +64 -0
- package/dist/components/AgentChat/VoiceChat/MicrophoneButton.d.ts +29 -0
- package/dist/components/AgentChat/VoiceChat/MicrophoneButton.js +55 -0
- package/dist/components/AgentChat/VoiceChat/VoiceChat.d.ts +33 -0
- package/dist/components/AgentChat/VoiceChat/VoiceChat.js +180 -0
- package/dist/components/Authentication/Auth.d.ts +14 -0
- package/dist/components/Authentication/Auth.js +58 -0
- package/dist/components/ChatBot/ChatBot.d.ts +20 -0
- package/dist/components/ChatBot/ChatBot.js +75 -0
- package/dist/components/Common/Breadcrumbs.d.ts +6 -0
- package/dist/components/Common/Breadcrumbs.js +36 -0
- package/dist/components/Common/LlmChatOptionsButton.d.ts +9 -0
- package/dist/components/Common/LlmChatOptionsButton.js +31 -0
- package/dist/components/Common/LoadingSpinner.d.ts +10 -0
- package/dist/components/Common/LoadingSpinner.js +24 -0
- package/dist/components/Common/MUIAccordion.d.ts +17 -0
- package/dist/components/Common/MUIAccordion.js +76 -0
- package/dist/components/Common/MUIAlert.d.ts +11 -0
- package/dist/components/Common/MUIAlert.js +41 -0
- package/dist/components/Common/MUIDialog.d.ts +16 -0
- package/dist/components/Common/MUIDialog.js +40 -0
- package/dist/components/Common/Navbar.d.ts +15 -0
- package/dist/components/Common/Navbar.js +137 -0
- package/dist/components/Common/PageLoader.d.ts +5 -0
- package/dist/components/Common/PageLoader.js +26 -0
- package/dist/components/Common/Snackbar.d.ts +5 -0
- package/dist/components/Common/Snackbar.js +84 -0
- package/dist/components/Common/confirmationModal.d.ts +14 -0
- package/dist/components/Common/confirmationModal.js +65 -0
- package/dist/components/Common/notification.d.ts +18 -0
- package/dist/components/Common/notification.js +79 -0
- package/dist/components/ErrorPage/ErrorBoundary.d.ts +38 -0
- package/dist/components/ErrorPage/ErrorBoundary.js +77 -0
- package/dist/components/ErrorPage/ErrorPage.d.ts +12 -0
- package/dist/components/ErrorPage/ErrorPage.js +46 -0
- package/dist/components/MultiAgentAccelerator/AgentFlow.d.ts +21 -0
- package/dist/components/MultiAgentAccelerator/AgentFlow.js +394 -0
- package/dist/components/MultiAgentAccelerator/AgentNode.d.ts +18 -0
- package/dist/components/MultiAgentAccelerator/AgentNode.js +129 -0
- package/dist/components/MultiAgentAccelerator/GraphLayouts.d.ts +33 -0
- package/dist/components/MultiAgentAccelerator/GraphLayouts.js +297 -0
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.d.ts +17 -0
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.js +208 -0
- package/dist/components/MultiAgentAccelerator/PlasmaEdge.d.ts +3 -0
- package/dist/components/MultiAgentAccelerator/PlasmaEdge.js +124 -0
- package/dist/components/MultiAgentAccelerator/Sidebar.d.ts +12 -0
- package/dist/components/MultiAgentAccelerator/Sidebar.js +204 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleEdge.d.ts +12 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleEdge.js +15 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleOverlay.d.ts +11 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleOverlay.js +466 -0
- package/dist/components/MultiAgentAccelerator/const.d.ts +7 -0
- package/dist/components/MultiAgentAccelerator/const.js +39 -0
- package/dist/const.d.ts +10 -0
- package/dist/const.js +30 -0
- package/dist/controller/agent/Agent.d.ts +56 -0
- package/dist/controller/agent/Agent.js +162 -0
- package/dist/controller/llm/LlmChat.d.ts +18 -0
- package/dist/controller/llm/LlmChat.js +65 -0
- package/dist/controller/llm/endpoints.d.ts +1 -0
- package/dist/controller/llm/endpoints.js +17 -0
- package/dist/generated/neuro-san/NeuroSanClient.d.ts +413 -0
- package/dist/generated/neuro-san/NeuroSanClient.js +28 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +52 -0
- package/dist/state/UserInfo.d.ts +16 -0
- package/dist/state/UserInfo.js +27 -0
- package/dist/state/environment.d.ts +18 -0
- package/dist/state/environment.js +33 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/utils/Authentication.d.ts +31 -0
- package/dist/utils/Authentication.js +94 -0
- package/dist/utils/BrowserNavigation.d.ts +5 -0
- package/dist/utils/BrowserNavigation.js +22 -0
- package/dist/utils/Theme.d.ts +7 -0
- package/dist/utils/Theme.js +7 -0
- package/dist/utils/agentConversations.d.ts +24 -0
- package/dist/utils/agentConversations.js +113 -0
- package/dist/utils/text.d.ts +28 -0
- package/dist/utils/text.js +64 -0
- package/dist/utils/title.d.ts +1 -0
- package/dist/utils/title.js +20 -0
- package/dist/utils/types.d.ts +17 -0
- package/dist/utils/types.js +16 -0
- package/dist/utils/useLocalStorage.d.ts +1 -0
- package/dist/utils/useLocalStorage.js +55 -0
- package/dist/utils/zIndexLayers.d.ts +2 -0
- package/dist/utils/zIndexLayers.js +29 -0
- package/package.json +69 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { CombinedAgentType } from "./Types.js";
|
|
3
|
+
export interface ChatCommonProps {
|
|
4
|
+
/**
|
|
5
|
+
* HTML id to use for the outer component
|
|
6
|
+
*/
|
|
7
|
+
readonly id: string;
|
|
8
|
+
/**
|
|
9
|
+
* The current username of the logged-in user. Used for fetching things from APIs mainly
|
|
10
|
+
*/
|
|
11
|
+
readonly currentUser: string;
|
|
12
|
+
/**
|
|
13
|
+
* Path to image for user avatar
|
|
14
|
+
*/
|
|
15
|
+
readonly userImage: string;
|
|
16
|
+
/**
|
|
17
|
+
* Function to set the state of the component to indicate whether we are awaiting a response from the LLM
|
|
18
|
+
*/
|
|
19
|
+
readonly setIsAwaitingLlm: Dispatch<SetStateAction<boolean>>;
|
|
20
|
+
/**
|
|
21
|
+
* Whether we are currently awaiting a response from the LLM
|
|
22
|
+
*/
|
|
23
|
+
readonly isAwaitingLlm: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The agent to send the request to.
|
|
26
|
+
*/
|
|
27
|
+
readonly targetAgent: string;
|
|
28
|
+
/**
|
|
29
|
+
* Special endpoint for legacy agents since they do not have a single unified endpoint like Neuro-san agents.
|
|
30
|
+
*/
|
|
31
|
+
readonly legacyAgentEndpoint?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Optional extra callback for containers to do extra things with the chunks as they are received. Parent
|
|
34
|
+
* returns true if it believes the chunk indicates that the interaction with the agent was successful and no
|
|
35
|
+
* retries are necessary.
|
|
36
|
+
*/
|
|
37
|
+
readonly onChunkReceived?: (chunk: string) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Will be called when the streaming is started, before any chunks are received.
|
|
40
|
+
*/
|
|
41
|
+
readonly onStreamingStarted?: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Will be called when the streaming is complete, whatever the reason for termination (normal or error)
|
|
44
|
+
*/
|
|
45
|
+
readonly onStreamingComplete?: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Optional callback to modify the query before sending it to the server. This is useful for adding extra
|
|
48
|
+
* information to the query before sending it or totally modifying the user query before sending.
|
|
49
|
+
*/
|
|
50
|
+
readonly onSend?: (query: string) => string;
|
|
51
|
+
/**
|
|
52
|
+
* Lifted state for parent to manage the previous response from the agent.
|
|
53
|
+
*/
|
|
54
|
+
readonly setPreviousResponse?: (agent: CombinedAgentType, response: string) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Optional placeholders for input to agents.
|
|
57
|
+
*/
|
|
58
|
+
readonly agentPlaceholders?: Partial<Record<CombinedAgentType, string>>;
|
|
59
|
+
/**
|
|
60
|
+
* Whether to clear the chat window and history when the user starts chatting with a new agent or network.
|
|
61
|
+
* Defaults to not clearing the chat.
|
|
62
|
+
*/
|
|
63
|
+
readonly clearChatOnNewAgent?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Extra parameters to send to the server to be forwarded to the agent or used by the server.
|
|
66
|
+
* @note This is only used for legacy agents to aid in UI consolidation, only Neuro-san agents.
|
|
67
|
+
*/
|
|
68
|
+
readonly extraParams?: Record<string, unknown>;
|
|
69
|
+
/**
|
|
70
|
+
* Background color for the chat window. Helps when there are multiple chats on a single page.
|
|
71
|
+
*/
|
|
72
|
+
readonly backgroundColor?: string;
|
|
73
|
+
/**
|
|
74
|
+
* If present, the chat window will have a title bar with this title.
|
|
75
|
+
*/
|
|
76
|
+
readonly title?: string;
|
|
77
|
+
/**
|
|
78
|
+
* If present, the chat window will have a close button that will call this function when clicked.
|
|
79
|
+
*/
|
|
80
|
+
readonly onClose?: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* The neuro-san server URL
|
|
83
|
+
*/
|
|
84
|
+
readonly neuroSanURL?: string;
|
|
85
|
+
}
|
|
86
|
+
export type ChatCommonHandle = {
|
|
87
|
+
handleStop: () => void;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Common chat component for agent chat. This component is used by all agent chat components to provide a consistent
|
|
91
|
+
* experience for users when chatting with agents. It handles user input as well as displaying and nicely formatting
|
|
92
|
+
* agent responses. Customization for inputs and outputs is provided via event handlers-like props.
|
|
93
|
+
*/
|
|
94
|
+
export declare const ChatCommon: import("react").ForwardRefExoticComponent<ChatCommonProps & import("react").RefAttributes<ChatCommonHandle>>;
|