test-chat-sdk 0.0.0
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/.prettierrc.js +24 -0
- package/README.md +46 -0
- package/config/env.js +104 -0
- package/config/getHttpsConfig.js +66 -0
- package/config/jest/babelTransform.js +29 -0
- package/config/jest/cssTransform.js +14 -0
- package/config/jest/fileTransform.js +40 -0
- package/config/modules.js +134 -0
- package/config/paths.js +77 -0
- package/config/webpack/persistentCache/createEnvironmentHash.js +9 -0
- package/config/webpack.config.js +785 -0
- package/config/webpackDevServer.config.js +127 -0
- package/dist/Chat/AgentList/index.d.ts +9 -0
- package/dist/Chat/ChatFooter/index.d.ts +17 -0
- package/dist/Chat/Conversation/index.d.ts +11 -0
- package/dist/Chat/MessageContainer/index.d.ts +19 -0
- package/dist/Chat/MobileAgents/index.d.ts +11 -0
- package/dist/Chat/components/AgentTip/index.d.ts +8 -0
- package/dist/Chat/components/ConversationModal/index.d.ts +10 -0
- package/dist/Chat/components/CopilotAvatar/index.d.ts +2 -0
- package/dist/Chat/components/Message.d.ts +10 -0
- package/dist/Chat/components/RecommendQuestions/index.d.ts +6 -0
- package/dist/Chat/components/Text.d.ts +9 -0
- package/dist/Chat/constants.d.ts +19 -0
- package/dist/Chat/index.d.ts +17 -0
- package/dist/Chat/service.d.ts +11 -0
- package/dist/Chat/type.d.ts +97 -0
- package/dist/Copilot/constants.d.ts +11 -0
- package/dist/Copilot/index.d.ts +13 -0
- package/dist/ShowCase/index.d.ts +8 -0
- package/dist/ShowCase/service.d.ts +2 -0
- package/dist/ShowCase/type.d.ts +11 -0
- package/dist/common/constants.d.ts +58 -0
- package/dist/common/env.d.ts +3 -0
- package/dist/common/type.d.ts +247 -0
- package/dist/components/ChatItem/ExecuteItem.d.ts +25 -0
- package/dist/components/ChatItem/ExpandParseTip.d.ts +20 -0
- package/dist/components/ChatItem/FilterItem.d.ts +17 -0
- package/dist/components/ChatItem/Loading.d.ts +2 -0
- package/dist/components/ChatItem/ParseTip.d.ts +26 -0
- package/dist/components/ChatItem/ParseTipUtils.d.ts +10 -0
- package/dist/components/ChatItem/SimilarQuestionItem.d.ts +10 -0
- package/dist/components/ChatItem/SqlItem.d.ts +17 -0
- package/dist/components/ChatItem/SwitchEntity.d.ts +9 -0
- package/dist/components/ChatItem/Text.d.ts +6 -0
- package/dist/components/ChatItem/Typing.d.ts +2 -0
- package/dist/components/ChatItem/index.d.ts +33 -0
- package/dist/components/ChatMsg/ApplyAuth/index.d.ts +7 -0
- package/dist/components/ChatMsg/Bar/index.d.ts +13 -0
- package/dist/components/ChatMsg/DateOptions/index.d.ts +9 -0
- package/dist/components/ChatMsg/FilterSection/index.d.ts +8 -0
- package/dist/components/ChatMsg/MarkDown/index.d.ts +10 -0
- package/dist/components/ChatMsg/Message/index.d.ts +18 -0
- package/dist/components/ChatMsg/MetricCard/PeriodCompareItem.d.ts +7 -0
- package/dist/components/ChatMsg/MetricCard/index.d.ts +10 -0
- package/dist/components/ChatMsg/MetricTrend/MetricInfo.d.ts +8 -0
- package/dist/components/ChatMsg/MetricTrend/MetricTrendChart.d.ts +14 -0
- package/dist/components/ChatMsg/MetricTrend/MultiMetricsTrendChart.d.ts +12 -0
- package/dist/components/ChatMsg/MetricTrend/index.d.ts +16 -0
- package/dist/components/ChatMsg/NoPermissionChart/index.d.ts +8 -0
- package/dist/components/ChatMsg/Pie/PieChart.d.ts +11 -0
- package/dist/components/ChatMsg/Pie/index.d.ts +14 -0
- package/dist/components/ChatMsg/Table/index.d.ts +12 -0
- package/dist/components/ChatMsg/Text/index.d.ts +9 -0
- package/dist/components/ChatMsg/WebPage/index.d.ts +8 -0
- package/dist/components/ChatMsg/index.d.ts +15 -0
- package/dist/components/DrillDownDimensions/DimensionSection.d.ts +11 -0
- package/dist/components/DrillDownDimensions/index.d.ts +13 -0
- package/dist/components/IconFont/index.d.ts +3 -0
- package/dist/components/MetricOptions/index.d.ts +11 -0
- package/dist/components/RecommendOptions/index.d.ts +9 -0
- package/dist/components/Tools/FeedbackModal.d.ts +9 -0
- package/dist/components/Tools/index.d.ts +12 -0
- package/dist/demo/Chat.d.ts +2 -0
- package/dist/demo/ChatDemo.d.ts +4 -0
- package/dist/demo/CopilotDemo.d.ts +2 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useComposing.d.ts +5 -0
- package/dist/hooks/useExportByEcharts.d.ts +10 -0
- package/dist/hooks/useMethodRegister.d.ts +4 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.es.js +1 -0
- package/dist/service/axiosInstance.d.ts +3 -0
- package/dist/service/index.d.ts +25 -0
- package/dist/utils/utils.d.ts +45 -0
- package/package.json +214 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/manifest.json +15 -0
- package/public/robots.txt +3 -0
- package/rollup/rollup.config.mjs +37 -0
- package/rollup/rollup.esm.config.mjs +21 -0
- package/rollup/rollup.umd.config.mjs +30 -0
- package/scripts/build.js +217 -0
- package/scripts/start.js +154 -0
- package/scripts/test.js +52 -0
- package/src/Chat/AgentList/index.tsx +52 -0
- package/src/Chat/AgentList/style.module.less +83 -0
- package/src/Chat/ChatFooter/index.tsx +423 -0
- package/src/Chat/ChatFooter/style.module.less +225 -0
- package/src/Chat/Conversation/index.tsx +236 -0
- package/src/Chat/Conversation/style.module.less +171 -0
- package/src/Chat/MessageContainer/index.tsx +145 -0
- package/src/Chat/MessageContainer/style.module.less +53 -0
- package/src/Chat/MobileAgents/index.tsx +62 -0
- package/src/Chat/MobileAgents/style.module.less +55 -0
- package/src/Chat/components/AgentTip/index.tsx +48 -0
- package/src/Chat/components/AgentTip/style.module.less +44 -0
- package/src/Chat/components/ConversationModal/index.tsx +65 -0
- package/src/Chat/components/CopilotAvatar/index.tsx +8 -0
- package/src/Chat/components/CopilotAvatar/style.module.less +13 -0
- package/src/Chat/components/Message.tsx +38 -0
- package/src/Chat/components/RecommendQuestions/index.tsx +64 -0
- package/src/Chat/components/RecommendQuestions/style.module.less +36 -0
- package/src/Chat/components/Text.tsx +42 -0
- package/src/Chat/components/style.module.less +311 -0
- package/src/Chat/constants.ts +37 -0
- package/src/Chat/index.tsx +526 -0
- package/src/Chat/service.ts +49 -0
- package/src/Chat/style.module.less +119 -0
- package/src/Chat/type.ts +107 -0
- package/src/Copilot/constants.ts +11 -0
- package/src/Copilot/index.tsx +149 -0
- package/src/Copilot/style.module.less +151 -0
- package/src/ShowCase/index.tsx +120 -0
- package/src/ShowCase/service.ts +12 -0
- package/src/ShowCase/style.module.less +46 -0
- package/src/ShowCase/type.ts +14 -0
- package/src/common/constants.ts +93 -0
- package/src/common/env.ts +5 -0
- package/src/common/type.ts +270 -0
- package/src/components/ChatItem/ExecuteItem.tsx +210 -0
- package/src/components/ChatItem/ExpandParseTip.tsx +333 -0
- package/src/components/ChatItem/FilterItem.tsx +209 -0
- package/src/components/ChatItem/Loading.tsx +14 -0
- package/src/components/ChatItem/ParseTip.tsx +322 -0
- package/src/components/ChatItem/ParseTipUtils.tsx +205 -0
- package/src/components/ChatItem/SimilarQuestionItem.tsx +84 -0
- package/src/components/ChatItem/SqlItem.tsx +410 -0
- package/src/components/ChatItem/SwitchEntity.tsx +52 -0
- package/src/components/ChatItem/Text.tsx +17 -0
- package/src/components/ChatItem/Typing.tsx +19 -0
- package/src/components/ChatItem/index.tsx +843 -0
- package/src/components/ChatItem/style.less +670 -0
- package/src/components/ChatMsg/ApplyAuth/index.tsx +30 -0
- package/src/components/ChatMsg/ApplyAuth/style.less +13 -0
- package/src/components/ChatMsg/Bar/index.tsx +208 -0
- package/src/components/ChatMsg/Bar/style.less +60 -0
- package/src/components/ChatMsg/DateOptions/index.tsx +46 -0
- package/src/components/ChatMsg/DateOptions/style.less +43 -0
- package/src/components/ChatMsg/FilterSection/index.tsx +42 -0
- package/src/components/ChatMsg/FilterSection/style.less +37 -0
- package/src/components/ChatMsg/MarkDown/index.tsx +26 -0
- package/src/components/ChatMsg/MarkDown/style.less +9 -0
- package/src/components/ChatMsg/Message/index.tsx +105 -0
- package/src/components/ChatMsg/Message/style.less +119 -0
- package/src/components/ChatMsg/MetricCard/PeriodCompareItem.tsx +29 -0
- package/src/components/ChatMsg/MetricCard/index.tsx +80 -0
- package/src/components/ChatMsg/MetricCard/style.less +126 -0
- package/src/components/ChatMsg/MetricTrend/MetricInfo.tsx +60 -0
- package/src/components/ChatMsg/MetricTrend/MetricTrendChart.tsx +235 -0
- package/src/components/ChatMsg/MetricTrend/MultiMetricsTrendChart.tsx +162 -0
- package/src/components/ChatMsg/MetricTrend/index.tsx +127 -0
- package/src/components/ChatMsg/MetricTrend/style.less +195 -0
- package/src/components/ChatMsg/NoPermissionChart/index.tsx +28 -0
- package/src/components/ChatMsg/NoPermissionChart/style.less +26 -0
- package/src/components/ChatMsg/Pie/PieChart.tsx +120 -0
- package/src/components/ChatMsg/Pie/index.tsx +88 -0
- package/src/components/ChatMsg/Pie/style.less +43 -0
- package/src/components/ChatMsg/Table/index.tsx +103 -0
- package/src/components/ChatMsg/Table/style.less +131 -0
- package/src/components/ChatMsg/Text/index.tsx +70 -0
- package/src/components/ChatMsg/Text/style.less +38 -0
- package/src/components/ChatMsg/WebPage/index.tsx +125 -0
- package/src/components/ChatMsg/index.tsx +428 -0
- package/src/components/ChatMsg/style.less +28 -0
- package/src/components/DrillDownDimensions/DimensionSection.tsx +99 -0
- package/src/components/DrillDownDimensions/index.tsx +76 -0
- package/src/components/DrillDownDimensions/style.less +64 -0
- package/src/components/IconFont/index.tsx +7 -0
- package/src/components/MetricOptions/index.tsx +75 -0
- package/src/components/MetricOptions/style.less +69 -0
- package/src/components/RecommendOptions/index.tsx +126 -0
- package/src/components/RecommendOptions/style.less +24 -0
- package/src/components/Tools/FeedbackModal.tsx +55 -0
- package/src/components/Tools/index.tsx +126 -0
- package/src/components/Tools/style.less +67 -0
- package/src/demo/Chat.tsx +73 -0
- package/src/demo/ChatDemo.tsx +14 -0
- package/src/demo/CopilotDemo.tsx +43 -0
- package/src/demo/style.module.less +19 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useComposing.ts +31 -0
- package/src/hooks/useExportByEcharts.ts +41 -0
- package/src/hooks/useMethodRegister.ts +25 -0
- package/src/index.tsx +44 -0
- package/src/service/axiosInstance.ts +58 -0
- package/src/service/index.ts +174 -0
- package/src/setupProxy.js +18 -0
- package/src/setupTests.ts +5 -0
- package/src/styles/global.less +52 -0
- package/src/styles/index.less +39 -0
- package/src/styles/reboot.less +14 -0
- package/src/styles/variables.less +80 -0
- package/src/typings.d.ts +179 -0
- package/src/utils/utils.ts +346 -0
- package/tsconfig.build.json +20 -0
- package/tsconfig.json +27 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
|
|
5
|
+
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
|
|
6
|
+
const ignoredFiles = require('react-dev-utils/ignoredFiles');
|
|
7
|
+
const redirectServedPath = require('react-dev-utils/redirectServedPathMiddleware');
|
|
8
|
+
const paths = require('./paths');
|
|
9
|
+
const getHttpsConfig = require('./getHttpsConfig');
|
|
10
|
+
|
|
11
|
+
const host = process.env.HOST || '0.0.0.0';
|
|
12
|
+
const sockHost = process.env.WDS_SOCKET_HOST;
|
|
13
|
+
const sockPath = process.env.WDS_SOCKET_PATH; // default: '/ws'
|
|
14
|
+
const sockPort = process.env.WDS_SOCKET_PORT;
|
|
15
|
+
|
|
16
|
+
module.exports = function (proxy, allowedHost) {
|
|
17
|
+
const disableFirewall =
|
|
18
|
+
!proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true';
|
|
19
|
+
return {
|
|
20
|
+
// WebpackDevServer 2.4.3 introduced a security fix that prevents remote
|
|
21
|
+
// websites from potentially accessing local content through DNS rebinding:
|
|
22
|
+
// https://github.com/webpack/webpack-dev-server/issues/887
|
|
23
|
+
// https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
|
|
24
|
+
// However, it made several existing use cases such as development in cloud
|
|
25
|
+
// environment or submodels in development significantly more complicated:
|
|
26
|
+
// https://github.com/facebook/create-react-app/issues/2271
|
|
27
|
+
// https://github.com/facebook/create-react-app/issues/2233
|
|
28
|
+
// While we're investigating better solutions, for now we will take a
|
|
29
|
+
// compromise. Since our WDS configuration only serves files in the `public`
|
|
30
|
+
// folder we won't consider accessing them a vulnerability. However, if you
|
|
31
|
+
// use the `proxy` feature, it gets more dangerous because it can expose
|
|
32
|
+
// remote code execution vulnerabilities in backends like Django and Rails.
|
|
33
|
+
// So we will disable the host check normally, but enable it if you have
|
|
34
|
+
// specified the `proxy` setting. Finally, we let you override it if you
|
|
35
|
+
// really know what you're doing with a special environment variable.
|
|
36
|
+
// Note: ["localhost", ".localhost"] will support submodels - but we might
|
|
37
|
+
// want to allow setting the allowedHosts manually for more complex setups
|
|
38
|
+
allowedHosts: disableFirewall ? 'all' : [allowedHost],
|
|
39
|
+
headers: {
|
|
40
|
+
'Access-Control-Allow-Origin': '*',
|
|
41
|
+
'Access-Control-Allow-Methods': '*',
|
|
42
|
+
'Access-Control-Allow-Headers': '*',
|
|
43
|
+
},
|
|
44
|
+
// Enable gzip compression of generated files.
|
|
45
|
+
compress: true,
|
|
46
|
+
static: {
|
|
47
|
+
// By default WebpackDevServer serves physical files from current directory
|
|
48
|
+
// in addition to all the virtual build products that it serves from memory.
|
|
49
|
+
// This is confusing because those files won’t automatically be available in
|
|
50
|
+
// production build folder unless we copy them. However, copying the whole
|
|
51
|
+
// project directory is dangerous because we may expose sensitive files.
|
|
52
|
+
// Instead, we establish a convention that only files in `public` directory
|
|
53
|
+
// get served. Our build script will copy `public` into the `build` folder.
|
|
54
|
+
// In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
|
|
55
|
+
// <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
|
|
56
|
+
// In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
|
|
57
|
+
// Note that we only recommend to use `public` folder as an escape hatch
|
|
58
|
+
// for files like `favicon.ico`, `manifest.json`, and libraries that are
|
|
59
|
+
// for some reason broken when imported through webpack. If you just want to
|
|
60
|
+
// use an image, put it in `src` and `import` it from JavaScript instead.
|
|
61
|
+
directory: paths.appPublic,
|
|
62
|
+
publicPath: [paths.publicUrlOrPath],
|
|
63
|
+
// By default files from `contentBase` will not trigger a page reload.
|
|
64
|
+
watch: {
|
|
65
|
+
// Reportedly, this avoids CPU overload on some systems.
|
|
66
|
+
// https://github.com/facebook/create-react-app/issues/293
|
|
67
|
+
// src/node_modules is not ignored to support absolute imports
|
|
68
|
+
// https://github.com/facebook/create-react-app/issues/1065
|
|
69
|
+
ignored: ignoredFiles(paths.appSrc),
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
client: {
|
|
73
|
+
webSocketURL: {
|
|
74
|
+
// Enable custom sockjs pathname for websocket connection to hot reloading server.
|
|
75
|
+
// Enable custom sockjs hostname, pathname and port for websocket connection
|
|
76
|
+
// to hot reloading server.
|
|
77
|
+
hostname: sockHost,
|
|
78
|
+
pathname: sockPath,
|
|
79
|
+
port: sockPort,
|
|
80
|
+
},
|
|
81
|
+
overlay: {
|
|
82
|
+
errors: true,
|
|
83
|
+
warnings: false,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
devMiddleware: {
|
|
87
|
+
// It is important to tell WebpackDevServer to use the same "publicPath" path as
|
|
88
|
+
// we specified in the webpack config. When homepage is '.', default to serving
|
|
89
|
+
// from the root.
|
|
90
|
+
// remove last slash so user can land on `/test` instead of `/test/`
|
|
91
|
+
publicPath: paths.publicUrlOrPath.slice(0, -1),
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
https: getHttpsConfig(),
|
|
95
|
+
host,
|
|
96
|
+
historyApiFallback: {
|
|
97
|
+
// Paths with dots should still use the history fallback.
|
|
98
|
+
// See https://github.com/facebook/create-react-app/issues/387.
|
|
99
|
+
disableDotRule: true,
|
|
100
|
+
index: paths.publicUrlOrPath,
|
|
101
|
+
},
|
|
102
|
+
// `proxy` is run between `before` and `after` `webpack-dev-server` hooks
|
|
103
|
+
proxy,
|
|
104
|
+
onBeforeSetupMiddleware(devServer) {
|
|
105
|
+
// Keep `evalSourceMapMiddleware`
|
|
106
|
+
// middlewares before `redirectServedPath` otherwise will not have any effect
|
|
107
|
+
// This lets us fetch source contents from webpack for the error overlay
|
|
108
|
+
devServer.app.use(evalSourceMapMiddleware(devServer));
|
|
109
|
+
|
|
110
|
+
if (fs.existsSync(paths.proxySetup)) {
|
|
111
|
+
// This registers user provided middleware for proxy reasons
|
|
112
|
+
require(paths.proxySetup)(devServer.app);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
onAfterSetupMiddleware(devServer) {
|
|
116
|
+
// Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
|
|
117
|
+
devServer.app.use(redirectServedPath(paths.publicUrlOrPath));
|
|
118
|
+
|
|
119
|
+
// This service worker file is effectively a 'no-op' that will reset any
|
|
120
|
+
// previous service worker registered for the same host:port combination.
|
|
121
|
+
// We do this in development to avoid hitting the production cache if
|
|
122
|
+
// it used the same host and port.
|
|
123
|
+
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
|
|
124
|
+
devServer.app.use(noopServiceWorkerMiddleware(paths.publicUrlOrPath));
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AgentType } from '../type';
|
|
3
|
+
type Props = {
|
|
4
|
+
inputMsg: string;
|
|
5
|
+
chatId?: number;
|
|
6
|
+
currentAgent?: AgentType;
|
|
7
|
+
agentList: AgentType[];
|
|
8
|
+
onToggleHistoryVisible: () => void;
|
|
9
|
+
onOpenAgents: () => void;
|
|
10
|
+
onInputMsgChange: (value: string) => void;
|
|
11
|
+
onSendMsg: (msg: string, dataSetId?: number) => void;
|
|
12
|
+
onAddConversation: (agent?: AgentType) => void;
|
|
13
|
+
onSelectAgent: (agent: AgentType) => void;
|
|
14
|
+
onOpenShowcase: () => void;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<any>>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AgentType, ConversationDetailType } from '../type';
|
|
3
|
+
type Props = {
|
|
4
|
+
currentAgent?: AgentType;
|
|
5
|
+
currentConversation?: ConversationDetailType;
|
|
6
|
+
historyVisible?: boolean;
|
|
7
|
+
onSelectConversation: (conversation: ConversationDetailType, sendMsgParams?: any, isAdd?: boolean) => void;
|
|
8
|
+
onCloseConversation: () => void;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<any>>>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AgentType, MessageItem } from '../type';
|
|
3
|
+
import { MsgDataType } from '../../common/type';
|
|
4
|
+
type Props = {
|
|
5
|
+
id: string;
|
|
6
|
+
chatId: number;
|
|
7
|
+
messageList: MessageItem[];
|
|
8
|
+
historyVisible: boolean;
|
|
9
|
+
currentAgent?: AgentType;
|
|
10
|
+
chatVisible?: boolean;
|
|
11
|
+
isDeveloper?: boolean;
|
|
12
|
+
integrateSystem?: string;
|
|
13
|
+
isSimpleMode?: boolean;
|
|
14
|
+
isDebugMode?: boolean;
|
|
15
|
+
onMsgDataLoaded: (data: MsgDataType, questionId: string | number, question: string, valid: boolean, isRefresh?: boolean) => void;
|
|
16
|
+
onSendMsg: (value: string) => void;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import("react").NamedExoticComponent<Props>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AgentType } from '../type';
|
|
3
|
+
type Props = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
agentList: AgentType[];
|
|
6
|
+
currentAgent?: AgentType;
|
|
7
|
+
onSelectAgent: (agent: AgentType) => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
};
|
|
10
|
+
declare const MobileAgents: React.FC<Props>;
|
|
11
|
+
export default MobileAgents;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ConversationDetailType } from '../../type';
|
|
3
|
+
type Props = {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
editConversation?: ConversationDetailType;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onFinish: (conversationName: string) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const ConversationModal: React.FC<Props>;
|
|
10
|
+
export default ConversationModal;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
position: 'left' | 'right';
|
|
4
|
+
width?: number | string;
|
|
5
|
+
height?: number | string;
|
|
6
|
+
bubbleClassName?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
declare const Message: React.FC<Props>;
|
|
10
|
+
export default Message;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum SemanticTypeEnum {
|
|
2
|
+
MODEL = "MODEL",
|
|
3
|
+
DIMENSION = "DIMENSION",
|
|
4
|
+
METRIC = "METRIC",
|
|
5
|
+
VALUE = "VALUE",
|
|
6
|
+
TERM = "TERM"
|
|
7
|
+
}
|
|
8
|
+
export declare const SEMANTIC_TYPE_MAP: {
|
|
9
|
+
MODEL: string;
|
|
10
|
+
DIMENSION: string;
|
|
11
|
+
METRIC: string;
|
|
12
|
+
VALUE: string;
|
|
13
|
+
TERM: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const AGENT_ICONS: string[];
|
|
16
|
+
export declare const HOLDER_TAG = "@_supersonic_@";
|
|
17
|
+
export declare const DEFAULT_CONVERSATION_NAME = "\u65B0\u95EE\u7B54\u5BF9\u8BDD";
|
|
18
|
+
export declare const PLACE_HOLDER = "\u8BF7\u8F93\u5165\u60A8\u7684\u95EE\u9898\uFF0C\u6216\u8F93\u5165\u201C/\u201D\u5207\u6362\u52A9\u7406";
|
|
19
|
+
export declare const SIMPLE_PLACE_HOLDER = "\u8BF7\u8F93\u5165\u60A8\u7684\u95EE\u9898";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AgentType } from './type';
|
|
3
|
+
import 'dayjs/locale/zh-cn';
|
|
4
|
+
type Props = {
|
|
5
|
+
token?: string;
|
|
6
|
+
agentIds?: number[];
|
|
7
|
+
initialAgentId?: number;
|
|
8
|
+
chatVisible?: boolean;
|
|
9
|
+
noInput?: boolean;
|
|
10
|
+
isDeveloper?: boolean;
|
|
11
|
+
integrateSystem?: string;
|
|
12
|
+
isCopilot?: boolean;
|
|
13
|
+
onCurrentAgentChange?: (agent?: AgentType) => void;
|
|
14
|
+
onReportMsgEvent?: (msg: string, valid: boolean) => void;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<any>>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AgentType, ModelType } from './type';
|
|
2
|
+
export declare function saveConversation(chatName: string, agentId: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
3
|
+
export declare function updateConversationName(chatName: string, chatId?: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
4
|
+
export declare function deleteConversation(chatId: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
5
|
+
export declare function getAllConversations(agentId?: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
6
|
+
export declare function getModelList(): Promise<import("axios").AxiosResponse<ModelType[], any, {}>>;
|
|
7
|
+
export declare function updateQAFeedback(questionId: number, score: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
8
|
+
export declare function queryMetricSuggestion(modelId: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
9
|
+
export declare function querySuggestion(modelId: number): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
10
|
+
export declare function queryRecommendQuestions(): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
11
|
+
export declare function queryAgentList(): Promise<import("axios").AxiosResponse<AgentType[], any, {}>>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ChatContextType, MsgDataType, ParseTimeCostType, SendMsgParamsType } from '../common/type';
|
|
2
|
+
export declare enum MessageTypeEnum {
|
|
3
|
+
TEXT = "text",
|
|
4
|
+
QUESTION = "question",
|
|
5
|
+
TAG = "tag",
|
|
6
|
+
SUGGESTION = "suggestion",
|
|
7
|
+
NO_PERMISSION = "no_permission",
|
|
8
|
+
SEMANTIC_DETAIL = "semantic_detail",
|
|
9
|
+
PLUGIN = "PLUGIN",
|
|
10
|
+
WEB_PAGE = "WEB_PAGE",
|
|
11
|
+
RECOMMEND_QUESTIONS = "recommend_questions",
|
|
12
|
+
AGENT_LIST = "agent_list"
|
|
13
|
+
}
|
|
14
|
+
export type MessageItem = {
|
|
15
|
+
id: string | number;
|
|
16
|
+
type?: MessageTypeEnum;
|
|
17
|
+
msg?: string;
|
|
18
|
+
questionId?: number;
|
|
19
|
+
msgValue?: string;
|
|
20
|
+
identityMsg?: string;
|
|
21
|
+
modelId?: number;
|
|
22
|
+
agentId?: number;
|
|
23
|
+
entityId?: string;
|
|
24
|
+
parseInfos?: ChatContextType[];
|
|
25
|
+
parseTimeCost?: ParseTimeCostType;
|
|
26
|
+
msgData?: MsgDataType;
|
|
27
|
+
quote?: string;
|
|
28
|
+
score?: number;
|
|
29
|
+
feedback?: string;
|
|
30
|
+
filters?: any;
|
|
31
|
+
};
|
|
32
|
+
export type ConversationDetailType = {
|
|
33
|
+
chatId: number;
|
|
34
|
+
chatName: string;
|
|
35
|
+
createTime?: string;
|
|
36
|
+
creator?: string;
|
|
37
|
+
lastQuestion?: string;
|
|
38
|
+
lastTime?: string;
|
|
39
|
+
initialMsgParams?: SendMsgParamsType;
|
|
40
|
+
isAdd?: boolean;
|
|
41
|
+
};
|
|
42
|
+
export declare enum MessageModeEnum {
|
|
43
|
+
INTERPRET = "interpret"
|
|
44
|
+
}
|
|
45
|
+
export type ModelType = {
|
|
46
|
+
id: number;
|
|
47
|
+
name: string;
|
|
48
|
+
bizName: string;
|
|
49
|
+
};
|
|
50
|
+
export declare enum PluginShowTypeEnum {
|
|
51
|
+
DASHBOARD = "DASHBOARD",
|
|
52
|
+
WIDGET = "WIDGET",
|
|
53
|
+
URL = "URL",
|
|
54
|
+
TAG = "TAG"
|
|
55
|
+
}
|
|
56
|
+
export type PluginType = {
|
|
57
|
+
id: number;
|
|
58
|
+
name: string;
|
|
59
|
+
comment: string;
|
|
60
|
+
};
|
|
61
|
+
export type SuggestionItemType = {
|
|
62
|
+
id: number;
|
|
63
|
+
model: number;
|
|
64
|
+
name: string;
|
|
65
|
+
bizName: string;
|
|
66
|
+
};
|
|
67
|
+
export type SuggestionType = {
|
|
68
|
+
dimensions: SuggestionItemType[];
|
|
69
|
+
metrics: SuggestionItemType[];
|
|
70
|
+
};
|
|
71
|
+
export type AgentType = {
|
|
72
|
+
id: number;
|
|
73
|
+
name: string;
|
|
74
|
+
description: string;
|
|
75
|
+
examples: string[];
|
|
76
|
+
status: 0 | 1;
|
|
77
|
+
initialSendMsgParams?: SendMsgParamsType;
|
|
78
|
+
createdBy: string;
|
|
79
|
+
updatedBy: string;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
updatedAt: string;
|
|
82
|
+
enableSearch: number;
|
|
83
|
+
enableFeedback: number;
|
|
84
|
+
toolConfig: string;
|
|
85
|
+
modelConfig: {
|
|
86
|
+
provider: string;
|
|
87
|
+
baseUrl: string;
|
|
88
|
+
apiKey: string;
|
|
89
|
+
modelName: string;
|
|
90
|
+
temperature: number;
|
|
91
|
+
timeOut: number;
|
|
92
|
+
};
|
|
93
|
+
multiTurnConfig: {
|
|
94
|
+
enableMultiTurn: boolean;
|
|
95
|
+
};
|
|
96
|
+
dataSetIds: number[];
|
|
97
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type Props = {
|
|
3
|
+
token?: string;
|
|
4
|
+
agentIds?: number[];
|
|
5
|
+
noInput?: boolean;
|
|
6
|
+
isDeveloper?: boolean;
|
|
7
|
+
integrateSystem?: string;
|
|
8
|
+
apiUrl?: string;
|
|
9
|
+
onReportMsgEvent?: (msg: string, valid: boolean) => void;
|
|
10
|
+
onOpenChatPage?: (agentId?: number) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<any>>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HistoryMsgItemType } from "../common/type";
|
|
2
|
+
export type ShowCaseMapType = Record<number, HistoryMsgItemType[]>;
|
|
3
|
+
export type ShowCaseItemType = {
|
|
4
|
+
caseId: string;
|
|
5
|
+
msgList: HistoryMsgItemType[];
|
|
6
|
+
};
|
|
7
|
+
export type ShowCaseType = {
|
|
8
|
+
showCaseMap: ShowCaseMapType;
|
|
9
|
+
current: number;
|
|
10
|
+
pageSize: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare enum NumericUnit {
|
|
2
|
+
None = "\u65E0",
|
|
3
|
+
TenThousand = "\u4E07",
|
|
4
|
+
EnTenThousand = "w",
|
|
5
|
+
OneHundredMillion = "\u4EBF",
|
|
6
|
+
Thousand = "k",
|
|
7
|
+
Million = "M",
|
|
8
|
+
Giga = "G"
|
|
9
|
+
}
|
|
10
|
+
export declare const PRIMARY_COLOR = "#f87653";
|
|
11
|
+
export declare const CHART_BLUE_COLOR = "#446dff";
|
|
12
|
+
export declare const CHAT_BLUE = "#1b4aef";
|
|
13
|
+
export declare const CHART_SECONDARY_COLOR = "rgba(153, 153, 153, 0.3)";
|
|
14
|
+
export declare const CLS_PREFIX = "ss-chat";
|
|
15
|
+
export declare const DATE_TYPES: {
|
|
16
|
+
DAY: {
|
|
17
|
+
label: string;
|
|
18
|
+
value: number;
|
|
19
|
+
}[];
|
|
20
|
+
WEEK: {
|
|
21
|
+
label: string;
|
|
22
|
+
value: number;
|
|
23
|
+
}[];
|
|
24
|
+
MONTH: {
|
|
25
|
+
label: string;
|
|
26
|
+
value: number;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
export declare const THEME_COLOR_LIST: string[];
|
|
30
|
+
export declare const PARSE_ERROR_TIP = "\u667A\u80FD\u52A9\u7406\u4E0D\u592A\u61C2\u60A8\u8BF4\u4EC0\u4E48\u5450\uFF0C\u56DE\u53BB\u4E00\u5B9A\u8865\u5145\u77E5\u8BC6";
|
|
31
|
+
export declare const SEARCH_EXCEPTION_TIP = "\u67E5\u8BE2\u51FA\u9519\u5566\uFF0C\u6570\u636E\u5E93\u53EF\u80FD\u51FA\u73B0\u5F02\u5E38\u6216\u8005\u8D1F\u8F7D\u7E41\u5FD9\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u8005\u7A0D\u540E\u91CD\u8BD5";
|
|
32
|
+
export declare const MSG_VALID_TIP: {
|
|
33
|
+
1: string;
|
|
34
|
+
3: string;
|
|
35
|
+
};
|
|
36
|
+
export declare const PREFIX_CLS = "ss-chat";
|
|
37
|
+
export declare const AGG_TYPE_MAP: {
|
|
38
|
+
SUM: string;
|
|
39
|
+
AVG: string;
|
|
40
|
+
MAX: string;
|
|
41
|
+
MIN: string;
|
|
42
|
+
};
|
|
43
|
+
export declare enum MsgContentTypeEnum {
|
|
44
|
+
TEXT = "TEXT",
|
|
45
|
+
METRIC_CARD = "METRIC_CARD",
|
|
46
|
+
TABLE = "TABLE",
|
|
47
|
+
METRIC_TREND = "METRIC_TREND",
|
|
48
|
+
METRIC_BAR = "METRIC_BAR",
|
|
49
|
+
MARKDOWN = "MARKDOWN",
|
|
50
|
+
METRIC_PIE = "METRIC_PIE"
|
|
51
|
+
}
|
|
52
|
+
export declare enum ChatContextTypeQueryTypeEnum {
|
|
53
|
+
AGGREGATE = "AGGREGATE",
|
|
54
|
+
METRIC_TAG = "METRIC_TAG",
|
|
55
|
+
ID = "ID",
|
|
56
|
+
DETAIL = "DETAIL",
|
|
57
|
+
OTHER = "OTHER"
|
|
58
|
+
}
|