@ibiz-template-plugin/ai-chat 0.0.94 → 0.0.96
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Signal } from '@preact/signals';
|
|
2
2
|
import { QXEvent } from 'qx-util';
|
|
3
3
|
import { AIAgent, ChatMessage, KnowledgeBase } from '../../entity';
|
|
4
|
-
import { ITopic, IMaterial, IChatMessage, IChatOptions, IChatUIAction, IAIAgentConfig, IChatSuggestion, IResourceOptions, IChatMessageUsage } from '../../interface';
|
|
4
|
+
import { ITopic, IMaterial, IChatMessage, IChatOptions, IChatUIAction, IAIAgentConfig, IChatSuggestion, IResourceOptions, IChatMessageUsage, ITopicOptions } from '../../interface';
|
|
5
5
|
import { AiTopicController } from '../ai-topic/ai-topic.controller';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -15,9 +15,10 @@ import { AiTopicController } from '../ai-topic/ai-topic.controller';
|
|
|
15
15
|
export declare class AiChatController {
|
|
16
16
|
readonly opts: IChatOptions;
|
|
17
17
|
readonly resourceOptions: IResourceOptions | undefined;
|
|
18
|
+
readonly topicOptions: ITopicOptions | undefined;
|
|
18
19
|
/**
|
|
19
20
|
* 事件触发器
|
|
20
|
-
* @type {
|
|
21
|
+
* @type {QXEvent}
|
|
21
22
|
*/
|
|
22
23
|
evt: QXEvent<{
|
|
23
24
|
[p: string]: (...args: any[]) => any;
|
|
@@ -221,8 +222,9 @@ export declare class AiChatController {
|
|
|
221
222
|
* @date 2023-10-15 19:10:34
|
|
222
223
|
* @param {IChatOptions} opts 聊天配置
|
|
223
224
|
* @param {IChatOptions} resourceOptions 资源配置
|
|
225
|
+
* @param {ITopicOptions} topicOptions 会话配置
|
|
224
226
|
*/
|
|
225
|
-
constructor(opts: IChatOptions, resourceOptions: IResourceOptions | undefined);
|
|
227
|
+
constructor(opts: IChatOptions, resourceOptions: IResourceOptions | undefined, topicOptions: ITopicOptions | undefined);
|
|
226
228
|
/**
|
|
227
229
|
* 更新会话数据(当前若存在正在处理的消息则不做处理,不存在则重新构建相关数据)
|
|
228
230
|
* @returns
|
|
@@ -220,6 +220,12 @@ export interface IChatOptions extends IChat {
|
|
|
220
220
|
* @type {boolean}
|
|
221
221
|
*/
|
|
222
222
|
enableKnowledgeBaseSelect: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* 话题标题计算模式
|
|
225
|
+
*
|
|
226
|
+
* @type {('history' | 'question' | 'none')} history:如果获取到的history内容中包含user信息,则取最后一条user信息计算标题;question:默认值,等待用户输入第一个user消息后计算标题;none:不进行计算,由外部传入标题决定
|
|
227
|
+
*/
|
|
228
|
+
captionComputedMode: 'history' | 'question' | 'none';
|
|
223
229
|
/**
|
|
224
230
|
* 是否允许设置召回参数
|
|
225
231
|
*
|