@openk9ui/openk9-chatbot 3.0.1
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/README.md +50 -0
- package/dist/SingleMessage-Dyc7W2JZ.js +13738 -0
- package/dist/assets/Chatbot.css +107 -0
- package/dist/components/Chatbot.js +399 -0
- package/dist/components/LanguageContext.js +53 -0
- package/dist/components/Search.js +91 -0
- package/dist/components/SingleMessage.js +9 -0
- package/dist/components/Translate.js +69 -0
- package/dist/components/client.js +119 -0
- package/dist/components/styled.js +21 -0
- package/dist/components/useFocusTrap.js +95 -0
- package/dist/components/useGenerateResponse.js +271 -0
- package/dist/components/useLanguage.js +12 -0
- package/dist/lib/components/Chatbot.js +168 -0
- package/dist/lib/components/LanguageContext.js +63 -0
- package/dist/lib/components/Search.js +56 -0
- package/dist/lib/components/SingleMessage.js +385 -0
- package/dist/lib/components/Translate.js +71 -0
- package/dist/lib/components/client.js +170 -0
- package/dist/lib/components/styled.js +14 -0
- package/dist/lib/components/useFocusTrap.js +85 -0
- package/dist/lib/components/useGenerateResponse.js +310 -0
- package/dist/lib/components/useLanguage.js +16 -0
- package/dist/lib/main.js +8 -0
- package/dist/main.js +4 -0
- package/dist/src/theme.js +52 -0
- package/dist/types/lib/components/Chatbot.d.ts +26 -0
- package/dist/types/lib/components/LanguageContext.d.ts +12 -0
- package/dist/types/lib/components/Search.d.ts +9 -0
- package/dist/types/lib/components/SingleMessage.d.ts +19 -0
- package/dist/types/lib/components/Translate.d.ts +5 -0
- package/dist/types/lib/components/client.d.ts +91 -0
- package/dist/types/lib/components/styled.d.ts +13 -0
- package/dist/types/lib/components/useFocusTrap.d.ts +5 -0
- package/dist/types/lib/components/useGenerateResponse.d.ts +33 -0
- package/dist/types/lib/components/useLanguage.d.ts +4 -0
- package/dist/types/lib/main.d.ts +2 -0
- package/dist/types/src/theme.d.ts +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type Source = {
|
|
2
|
+
source?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
};
|
|
6
|
+
export interface Message {
|
|
7
|
+
id?: string;
|
|
8
|
+
question: string;
|
|
9
|
+
answer: string;
|
|
10
|
+
sendTime?: string | null;
|
|
11
|
+
responseTime?: string | null;
|
|
12
|
+
status?: "END" | "CHUNK" | "ERROR";
|
|
13
|
+
sources?: Source[];
|
|
14
|
+
chat_sequence_number: number;
|
|
15
|
+
timestamp?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const useGenerateResponse: ({ initialMessages, tenant, callbackAuthorization, }: {
|
|
18
|
+
initialMessages: Message[];
|
|
19
|
+
tenant: string;
|
|
20
|
+
callbackAuthorization?: () => string | null | undefined;
|
|
21
|
+
}) => {
|
|
22
|
+
messages: Message[];
|
|
23
|
+
generateResponse: (query: string) => Promise<void>;
|
|
24
|
+
cancelResponse: (id: string) => void;
|
|
25
|
+
cancelAllResponses: () => void;
|
|
26
|
+
isChatting: boolean;
|
|
27
|
+
isLoading: {
|
|
28
|
+
isLoading: boolean;
|
|
29
|
+
id: string;
|
|
30
|
+
};
|
|
31
|
+
resetMessage: () => void;
|
|
32
|
+
};
|
|
33
|
+
export default useGenerateResponse;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultThemeK9: import("@mui/material/styles").Theme;
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openk9ui/openk9-chatbot",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "3.0.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/main.js",
|
|
8
|
+
"types": "dist/types/main.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "vite --port 3001",
|
|
14
|
+
"build": "tsc -p ./tsconfig-build.json && vite build",
|
|
15
|
+
"lint": "eslint .",
|
|
16
|
+
"preview": "vite preview"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@emotion/react": "^11.13.3",
|
|
20
|
+
"@emotion/styled": "^11.13.0",
|
|
21
|
+
"@fontsource/roboto": "^5.1.0",
|
|
22
|
+
"@fontsource/titillium-web": "^5.1.0",
|
|
23
|
+
"@mui/material": "^6.1.6",
|
|
24
|
+
"@mui/icons-material": "^6.1.6",
|
|
25
|
+
"@mui/system": "^6.1.6",
|
|
26
|
+
"@mui/utils": "^6.1.6",
|
|
27
|
+
"react": "^18.0.0",
|
|
28
|
+
"react-dom": "^18.0.0",
|
|
29
|
+
"react-markdown": "^9.0.1",
|
|
30
|
+
"styled-components": "^6.1.13",
|
|
31
|
+
"uuid": "^11.0.2"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@eslint/js": "^9.13.0",
|
|
35
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
36
|
+
"@types/node": "^22.8.6",
|
|
37
|
+
"@types/react": "^18.3.12",
|
|
38
|
+
"@types/react-dom": "^18.3.1",
|
|
39
|
+
"@types/styled-components": "^5.1.34",
|
|
40
|
+
"@types/uuid": "^10.0.0",
|
|
41
|
+
"@vitejs/plugin-react": "^4.3.3",
|
|
42
|
+
"eslint": "^9.13.0",
|
|
43
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
44
|
+
"eslint-plugin-react-refresh": "^0.4.14",
|
|
45
|
+
"glob": "^11.0.0",
|
|
46
|
+
"globals": "^15.11.0",
|
|
47
|
+
"hoist-non-react-statics": "^3.3.2",
|
|
48
|
+
"typescript": "~5.6.2",
|
|
49
|
+
"typescript-eslint": "^8.11.0",
|
|
50
|
+
"vite": "^5.4.10",
|
|
51
|
+
"vite-plugin-commonjs": "^0.10.3",
|
|
52
|
+
"vite-plugin-dts": "^4.3.0",
|
|
53
|
+
"@fontsource/roboto": "^5.1.0",
|
|
54
|
+
"@fontsource/titillium-web": "^5.1.0",
|
|
55
|
+
"vite-plugin-lib-inject-css": "^2.1.1"
|
|
56
|
+
},
|
|
57
|
+
"resolutions": {
|
|
58
|
+
"prop-types": "^15.7.2"
|
|
59
|
+
},
|
|
60
|
+
"sideEffects": [
|
|
61
|
+
"**/*.css"
|
|
62
|
+
]
|
|
63
|
+
}
|