@ibiz-template-plugin/ai-chat 0.0.54 → 0.0.56
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/index.es.js +6079 -5242
- package/dist/index.legacy.js +1 -1
- package/dist/polyfills.legacy.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/chat-agent-setting/chat-agent-setting.d.ts +10 -0
- package/dist/types/components/chat-search/chat-search.d.ts +6 -0
- package/dist/types/components/common/index.d.ts +4 -1
- package/dist/types/components/common/loading/loading.d.ts +8 -0
- package/dist/types/components/common/multiple-select/multiple-select.d.ts +52 -0
- package/dist/types/components/common/single-select/single-select.d.ts +66 -0
- package/dist/types/components/common/slider/slider-button/slider-button.d.ts +40 -0
- package/dist/types/components/common/slider/slider.d.ts +30 -0
- package/dist/types/components/common/switch/switch.d.ts +15 -0
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +42 -2
- package/dist/types/entity/ai-agent/ai-agent.d.ts +6 -1
- package/dist/types/entity/index.d.ts +1 -0
- package/dist/types/entity/knowledge-base/knowledge-base.d.ts +10 -0
- package/dist/types/icons/agent.d.ts +1 -0
- package/dist/types/icons/index.d.ts +3 -3
- package/dist/types/icons/loading-svg.d.ts +1 -0
- package/dist/types/icons/tool-call-svg.d.ts +1 -0
- package/dist/types/interface/i-ai-agent/i-ai-agent.d.ts +37 -1
- package/dist/types/interface/i-chat-options/i-chat-options.d.ts +18 -3
- package/dist/types/interface/i-knowledge-base/i-knowledge-base.d.ts +10 -0
- package/dist/types/interface/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/types/components/common/common-select/common-select.d.ts +0 -68
|
@@ -1,7 +1,35 @@
|
|
|
1
|
+
export interface IAIKnowledgeBase {
|
|
2
|
+
/**
|
|
3
|
+
* 知识库标识
|
|
4
|
+
*/
|
|
5
|
+
ai_knowledge_base_id: string;
|
|
6
|
+
/**
|
|
7
|
+
* 知识库名称
|
|
8
|
+
*/
|
|
9
|
+
ai_knowledge_base_name: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 智能体配置
|
|
13
|
+
*/
|
|
14
|
+
export interface IAIAgentConfig {
|
|
15
|
+
/**
|
|
16
|
+
* 召回重排
|
|
17
|
+
* (禁用|启用|自动)
|
|
18
|
+
*/
|
|
19
|
+
rerank: 0 | 1 | 2;
|
|
20
|
+
/**
|
|
21
|
+
* 最大召回数量
|
|
22
|
+
*/
|
|
23
|
+
maxchunks: number;
|
|
24
|
+
/**
|
|
25
|
+
* 召回相似度阈值
|
|
26
|
+
*/
|
|
27
|
+
chunkthreshold: number;
|
|
28
|
+
}
|
|
1
29
|
/**
|
|
2
30
|
* ai代理接口
|
|
3
31
|
*/
|
|
4
|
-
export interface IAIAgent {
|
|
32
|
+
export interface IAIAgent extends IAIAgentConfig {
|
|
5
33
|
/**
|
|
6
34
|
* 代理标识
|
|
7
35
|
*/
|
|
@@ -18,4 +46,12 @@ export interface IAIAgent {
|
|
|
18
46
|
* 排序
|
|
19
47
|
*/
|
|
20
48
|
order: number | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* 知识库数据
|
|
51
|
+
*/
|
|
52
|
+
knowledge_bases?: IAIKnowledgeBase[];
|
|
53
|
+
/**
|
|
54
|
+
* 是否允许任意知识库
|
|
55
|
+
*/
|
|
56
|
+
allow_any_knowledge_base: 0 | 1;
|
|
21
57
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AiChatController, AiTopicController } from '../../controller';
|
|
2
|
-
import { IAIAgent } from '../i-ai-agent/i-ai-agent';
|
|
2
|
+
import { IAIAgent, IAIAgentConfig } from '../i-ai-agent/i-ai-agent';
|
|
3
3
|
import { IChatMessage } from '../i-chat-message/i-chat-message';
|
|
4
4
|
import { IChatToolbarItem } from '../i-chat-toolbar-item/i-chat-toolbar-item';
|
|
5
5
|
import { FileUploaderOptions } from '../i-file-uploader-options/i-file-uploader-options';
|
|
6
6
|
import { ITopic } from '../i-topic-options/i-topic-options';
|
|
7
|
+
import { IKnowledgeBase } from '../i-knowledge-base/i-knowledge-base';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* 聊天数据
|
|
@@ -123,6 +124,14 @@ export interface IChat {
|
|
|
123
124
|
* @type {IAIAgent[]}
|
|
124
125
|
*/
|
|
125
126
|
aiAgentlist?: IAIAgent[];
|
|
127
|
+
/**
|
|
128
|
+
* AI知识库列表
|
|
129
|
+
*/
|
|
130
|
+
aiknowledgeBasesList?: IKnowledgeBase[];
|
|
131
|
+
/**
|
|
132
|
+
* 选中知识库ID
|
|
133
|
+
*/
|
|
134
|
+
selectAIKnowledgeBaseId?: string;
|
|
126
135
|
/**
|
|
127
136
|
* 模式参数,用于业务区分
|
|
128
137
|
*/
|
|
@@ -188,7 +197,7 @@ export interface IChatOptions extends IChat {
|
|
|
188
197
|
* @param {IChatMessage[]} question 提问历史内容(包含当前提问)
|
|
189
198
|
* @return {*} {Promise<boolean>} 等待回答,用于显示 loading 并获取最终成功与否
|
|
190
199
|
*/
|
|
191
|
-
question(aiChat: AiChatController, context: object, params: object, otherParams: object, question: IChatMessage[], sessionid: string, srfaiagent: string | undefined, srfmode: string | undefined): Promise<boolean>;
|
|
200
|
+
question(aiChat: AiChatController, context: object, params: object, otherParams: object, question: IChatMessage[], sessionid: string, srfaiagent: string | undefined, srfmode: string | undefined, srfaiknowledgebases: string | undefined, srfaiagentconfig: IAIAgentConfig): Promise<boolean>;
|
|
192
201
|
/**
|
|
193
202
|
* 中断消息
|
|
194
203
|
* @param aiChat
|
|
@@ -247,7 +256,13 @@ export interface IChatOptions extends IChat {
|
|
|
247
256
|
* @date 2025-02-28 14:02:41
|
|
248
257
|
* @type {FileUploaderOptions<object>}
|
|
249
258
|
*/
|
|
250
|
-
fetchAgentList?: () => Promise<IAIAgent[]>;
|
|
259
|
+
fetchAgentList?: (query?: string) => Promise<IAIAgent[]>;
|
|
260
|
+
/**
|
|
261
|
+
* 获取AI知识库列表
|
|
262
|
+
*
|
|
263
|
+
* @returns
|
|
264
|
+
*/
|
|
265
|
+
fetchKnowledgeBaseList?: () => Promise<IKnowledgeBase[]>;
|
|
251
266
|
/**
|
|
252
267
|
* 文件上传配置
|
|
253
268
|
*
|
|
@@ -11,8 +11,9 @@ export type { FileUploaderOptions } from './i-file-uploader-options/i-file-uploa
|
|
|
11
11
|
export type { IAutoClose, IChatContainerOptions, } from './i-chat-container/i-chat-container';
|
|
12
12
|
export type { IChatSuggestion } from './i-chat-suggestion/i-chat-suggestion';
|
|
13
13
|
export type { IChatToolCall } from './i-chat-tool-call/i-chat-tool-call';
|
|
14
|
-
export type { IAIAgent } from './i-ai-agent/i-ai-agent';
|
|
14
|
+
export type { IAIAgent, IAIAgentConfig, IAIKnowledgeBase, } from './i-ai-agent/i-ai-agent';
|
|
15
15
|
export type { IResourceOptions } from './i-resource-options/i-resource-options';
|
|
16
16
|
export type { IRemoteSession, IRemoteMessage, } from './i-remote-resource/i-remote-resource';
|
|
17
17
|
export type { IChatStep } from './i-chat-step/i-chat-step';
|
|
18
18
|
export type { IChatUIAction } from './i-chat-uiaction/i-chat-uiaction';
|
|
19
|
+
export type { IKnowledgeBase } from './i-knowledge-base/i-knowledge-base';
|
package/package.json
CHANGED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export interface CommonSelectOption {
|
|
3
|
-
/**
|
|
4
|
-
* 选项值
|
|
5
|
-
*
|
|
6
|
-
* @type {string}
|
|
7
|
-
* @memberof CommonSelectOption
|
|
8
|
-
*/
|
|
9
|
-
value: string;
|
|
10
|
-
/**
|
|
11
|
-
* 选项显示文本
|
|
12
|
-
*
|
|
13
|
-
* @type {string}
|
|
14
|
-
* @memberof CommonSelectOption
|
|
15
|
-
*/
|
|
16
|
-
label: string;
|
|
17
|
-
}
|
|
18
|
-
export interface CommonSelectProps {
|
|
19
|
-
/**
|
|
20
|
-
* 选项列表
|
|
21
|
-
*
|
|
22
|
-
* @type {CommonSelectOption[]}
|
|
23
|
-
* @memberof CommonSelectProps
|
|
24
|
-
*/
|
|
25
|
-
options: CommonSelectOption[];
|
|
26
|
-
/**
|
|
27
|
-
* 当前选中值
|
|
28
|
-
*
|
|
29
|
-
* @type {string}
|
|
30
|
-
* @memberof CommonSelectProps
|
|
31
|
-
*/
|
|
32
|
-
value?: string;
|
|
33
|
-
/**
|
|
34
|
-
* 默认值
|
|
35
|
-
*
|
|
36
|
-
* @type {string}
|
|
37
|
-
* @memberof CommonSelectProps
|
|
38
|
-
*/
|
|
39
|
-
defaultValue?: string;
|
|
40
|
-
/**
|
|
41
|
-
* 类名
|
|
42
|
-
*
|
|
43
|
-
* @type {string}
|
|
44
|
-
* @memberof CommonSelectProps
|
|
45
|
-
*/
|
|
46
|
-
className?: string;
|
|
47
|
-
/**
|
|
48
|
-
* 占位符文本
|
|
49
|
-
*
|
|
50
|
-
* @type {string}
|
|
51
|
-
* @memberof CommonSelectProps
|
|
52
|
-
*/
|
|
53
|
-
placeholder?: string;
|
|
54
|
-
/**
|
|
55
|
-
* 值改变回调
|
|
56
|
-
*
|
|
57
|
-
* @memberof CommonSelectProps
|
|
58
|
-
*/
|
|
59
|
-
onChange?: (value: string) => void;
|
|
60
|
-
/**
|
|
61
|
-
* 是否禁用
|
|
62
|
-
*
|
|
63
|
-
* @type {boolean}
|
|
64
|
-
* @memberof CommonSelectProps
|
|
65
|
-
*/
|
|
66
|
-
disabled?: boolean;
|
|
67
|
-
}
|
|
68
|
-
export declare const CommonSelect: (props: CommonSelectProps) => import("preact").JSX.Element;
|