fmode-ng 0.0.75 → 0.0.76
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/esm2022/lib/aigc/agent/fm-agent-task/fm-agent-task.component.mjs +10 -0
- package/esm2022/lib/aigc/agent/index.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-list/chat-list.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-modal-input/modal-input.component.mjs +1 -1
- package/esm2022/lib/aigc/service-fmai/service-chat/chat-class.mjs +1 -1
- package/esm2022/lib/aigc/voice/stream.player.mjs +1 -1
- package/esm2022/lib/aigc/voice/tts/fmode-tts-class.mjs +1 -1
- package/esm2022/lib/core/agent/chat/completion/fmode-completion.mjs +10 -0
- package/esm2022/lib/core/agent/chat/completion/index.mjs +10 -0
- package/esm2022/lib/core/agent/chat/fmode-chat.mjs +10 -0
- package/esm2022/lib/core/agent/chat/index.mjs +10 -0
- package/esm2022/lib/core/agent/chat/interface.mjs +10 -0
- package/esm2022/lib/core/agent/index.mjs +10 -0
- package/esm2022/lib/core/agent/prompt/agent.prompt.mjs +10 -0
- package/esm2022/lib/core/agent/prompt/index.mjs +10 -0
- package/esm2022/lib/core/agent/prompt/prompt-util.mjs +10 -0
- package/esm2022/lib/core/agent/story/agent.story.mjs +10 -0
- package/esm2022/lib/core/agent/story/index.mjs +10 -0
- package/esm2022/lib/core/agent/task/agent.task.mjs +10 -0
- package/esm2022/lib/core/agent/task/index.mjs +10 -0
- package/esm2022/lib/core/voice/tts/index.mjs +10 -0
- package/esm2022/lib/storage/service-upload/nova-upload.service.mjs +1 -1
- package/esm2022/lib/user/login/auth.service.mjs +1 -1
- package/esm2022/lib/user/login/login.component.mjs +1 -1
- package/esm2022/lib/user/modal-user-login/modal-user-login.component.mjs +1 -1
- package/fesm2022/fmode-ng.mjs +1 -1
- package/fesm2022/fmode-ng.mjs.map +1 -1
- package/lib/aigc/agent/fm-agent-task/fm-agent-task.component.d.ts +34 -0
- package/lib/aigc/agent/index.d.ts +2 -1
- package/lib/aigc/chat/chat-list/chat-list.component.d.ts +3 -2
- package/lib/aigc/chat/chat-message-card/comp-message-card.component.d.ts +2 -1
- package/lib/aigc/chat/chat-modal-input/modal-input.component.d.ts +6 -4
- package/lib/aigc/chat/chat-panel/chat-panel.component.d.ts +2 -1
- package/lib/aigc/service-fmai/service-chat/chat-class.d.ts +1 -199
- package/lib/aigc/voice/stream.player.d.ts +1 -1
- package/lib/core/agent/chat/completion/fmode-completion.d.ts +29 -0
- package/lib/core/agent/chat/completion/index.d.ts +1 -0
- package/lib/core/agent/chat/fmode-chat.d.ts +137 -0
- package/lib/core/agent/chat/index.d.ts +3 -0
- package/lib/core/agent/chat/interface.d.ts +35 -0
- package/lib/core/agent/index.d.ts +4 -0
- package/lib/{aigc/agent → core/agent/prompt}/agent.prompt.d.ts +1 -4
- package/lib/core/agent/prompt/index.d.ts +1 -0
- package/lib/core/agent/prompt/prompt-util.d.ts +3 -0
- package/lib/core/agent/story/agent.story.d.ts +12 -0
- package/lib/core/agent/story/index.d.ts +1 -0
- package/lib/core/agent/task/agent.task.d.ts +51 -0
- package/lib/core/agent/task/index.d.ts +1 -0
- package/lib/core/voice/tts/index.d.ts +1 -0
- package/lib/storage/service-upload/nova-upload.service.d.ts +5 -1
- package/lib/user/login/auth.service.d.ts +10 -1
- package/lib/user/login/login.component.d.ts +9 -3
- package/lib/user/modal-user-login/modal-user-login.component.d.ts +9 -4
- package/package.json +1 -1
- package/esm2022/lib/aigc/agent/agent.prompt.mjs +0 -10
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
3
|
+
import { MatStepper } from '@angular/material/stepper';
|
|
4
|
+
import { AgentTaskStep } from "../../../core/agent/task/agent.task";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class FmAgentTaskComponent implements OnInit {
|
|
7
|
+
dialogRef: MatDialogRef<FmAgentTaskComponent>;
|
|
8
|
+
data: {
|
|
9
|
+
shareData?: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
stepsList?: Array<AgentTaskStep>;
|
|
13
|
+
};
|
|
14
|
+
stepper: MatStepper | undefined;
|
|
15
|
+
enabledClose: boolean;
|
|
16
|
+
currentStepIndex: number;
|
|
17
|
+
constructor(dialogRef: MatDialogRef<FmAgentTaskComponent>, data: {
|
|
18
|
+
shareData?: {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
stepsList?: Array<AgentTaskStep>;
|
|
22
|
+
});
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
hasError: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 启动执行任务
|
|
27
|
+
* @desc
|
|
28
|
+
* 首次启动从0开始,之后运行从未完成序列开始
|
|
29
|
+
*/
|
|
30
|
+
startTask(startIndex?: number): Promise<void>;
|
|
31
|
+
onNoClick(): void;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FmAgentTaskComponent, never>;
|
|
33
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FmAgentTaskComponent, "fm-agent-task", never, {}, {}, never, never, true, never>;
|
|
34
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "../../core/agent";
|
|
2
|
+
export * from "./fm-agent-task/fm-agent-task.component";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { AlertController, NavController } from '@ionic/angular/standalone';
|
|
1
|
+
import { AlertController, ModalController, NavController } from '@ionic/angular/standalone';
|
|
2
2
|
import { ChatService } from "../../service-fmai/service-chat/chat.service";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class ChatListComponent {
|
|
5
5
|
chatServ: ChatService;
|
|
6
6
|
private alertCtrl;
|
|
7
7
|
private navCtrl;
|
|
8
|
+
private modalCtrl;
|
|
8
9
|
chatList: Array<any>;
|
|
9
|
-
constructor(chatServ: ChatService, alertCtrl: AlertController, navCtrl: NavController);
|
|
10
|
+
constructor(chatServ: ChatService, alertCtrl: AlertController, navCtrl: NavController, modalCtrl: ModalController);
|
|
10
11
|
onItemClick: Function;
|
|
11
12
|
/** 默认头像*/
|
|
12
13
|
avatar: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { FmodeChat
|
|
1
|
+
import { FmodeChat } from '../../service-fmai/service-chat';
|
|
2
2
|
import Parse from "parse";
|
|
3
3
|
import { ClipboardService } from '../../comp-markdown-preview/clipboard.service';
|
|
4
4
|
import { FmodeTTS } from '../../voice/tts';
|
|
5
|
+
import { FmodeChatMessage } from '../../../core/agent/chat/interface';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class FmChatMessageCard {
|
|
7
8
|
private copyServ;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
3
|
import { AlertController, NavController, ToastController } from '@ionic/angular';
|
|
4
|
-
import { FmodeChat
|
|
4
|
+
import { FmodeChat } from '../../service-fmai/service-chat';
|
|
5
5
|
import { ChatService } from '../../service-fmai/service-chat';
|
|
6
6
|
import Parse from "parse";
|
|
7
7
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
8
8
|
import { ImagineService } from '../../service-fmai/service-imagine/imagine.service';
|
|
9
9
|
import { IonTextarea, ModalController } from '@ionic/angular/standalone';
|
|
10
10
|
import { ModalAudioMessageComponent } from "./modal-audio-message/modal-audio-message.component";
|
|
11
|
+
import { AccountService } from '../../../user/account/account.service';
|
|
12
|
+
import { FmodeChatMessage } from '../../../core/agent/chat/interface';
|
|
11
13
|
import * as i0 from "@angular/core";
|
|
12
14
|
export declare class FmChatModalInput implements OnInit {
|
|
13
15
|
private toastCtrl;
|
|
@@ -17,6 +19,7 @@ export declare class FmChatModalInput implements OnInit {
|
|
|
17
19
|
private router;
|
|
18
20
|
private imagineServ;
|
|
19
21
|
chatServ: ChatService;
|
|
22
|
+
private account;
|
|
20
23
|
private route;
|
|
21
24
|
private messages;
|
|
22
25
|
audioComp: ModalAudioMessageComponent;
|
|
@@ -30,15 +33,14 @@ export declare class FmChatModalInput implements OnInit {
|
|
|
30
33
|
closeAudio(): void;
|
|
31
34
|
audioModalHeightPoint: number;
|
|
32
35
|
startTalk(): Promise<void>;
|
|
33
|
-
account: any;
|
|
34
36
|
authServ: any;
|
|
35
|
-
constructor(toastCtrl: ToastController, alertCtrl: AlertController, modalCtrl: ModalController, navCtrl: NavController, router: Router, imagineServ: ImagineService, chatServ: ChatService, route: ActivatedRoute, messages: NzMessageService);
|
|
37
|
+
constructor(toastCtrl: ToastController, alertCtrl: AlertController, modalCtrl: ModalController, navCtrl: NavController, router: Router, imagineServ: ImagineService, chatServ: ChatService, account: AccountService, route: ActivatedRoute, messages: NzMessageService);
|
|
36
38
|
ngOnInit(): void;
|
|
37
39
|
loadModel(): Promise<void>;
|
|
38
40
|
setMessageImage(): Promise<void>;
|
|
39
41
|
onInputFocus(): void;
|
|
40
42
|
onKeyDown(event: KeyboardEvent): void;
|
|
41
|
-
sendMessage(): Promise<
|
|
43
|
+
sendMessage(): Promise<boolean>;
|
|
42
44
|
checkBalance(): Promise<boolean>;
|
|
43
45
|
getChatShare(): Promise<void>;
|
|
44
46
|
toggleChatShare(): Promise<void>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AfterViewInit, ElementRef, OnInit } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
-
import { FmodeChat
|
|
3
|
+
import { FmodeChat } from '../../service-fmai/service-chat';
|
|
4
4
|
import { ChatService } from '../../service-fmai/service-chat';
|
|
5
5
|
import { FmChatHeaderArea } from '../chat-header-area';
|
|
6
6
|
import { ModalController } from '@ionic/angular/standalone';
|
|
7
|
+
import { FmodeChatMessage } from '../../../core/agent/chat/interface';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export declare class ChatPanelComponent implements OnInit, AfterViewInit {
|
|
9
10
|
private route;
|
|
@@ -1,199 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import Parse from "parse";
|
|
3
|
-
import { FmodeTTS } from "../../voice/tts";
|
|
4
|
-
import { NovaCloudService } from "../../../nova-cloud";
|
|
5
|
-
import { NovaUploadService } from "../../../storage/service-upload/nova-upload.service";
|
|
6
|
-
export interface FmodeChatMessageVoice {
|
|
7
|
-
id: string;
|
|
8
|
-
duration?: number;
|
|
9
|
-
ssml?: string;
|
|
10
|
-
voiceUrl?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface FmodeChatEventMap {
|
|
13
|
-
onComplete?(FmodeChatMessage: any): void;
|
|
14
|
-
onSSMLComplete?(FmodeChatMessageVoice: any): void;
|
|
15
|
-
}
|
|
16
|
-
export interface FmodeChatVoiceConfig {
|
|
17
|
-
voice: string;
|
|
18
|
-
autoTalk: boolean;
|
|
19
|
-
welcome: {
|
|
20
|
-
enabled: true;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export declare function getMessageContentText(content: any | string | Array<ChatImageContentItem>): string;
|
|
24
|
-
export declare function getMessageImageUrl(content: any | string | Array<ChatImageContentItem>): any;
|
|
25
|
-
export interface ChatImageContentItem {
|
|
26
|
-
type: string;
|
|
27
|
-
text?: string;
|
|
28
|
-
image_url?: {
|
|
29
|
-
url: string;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export interface FmodeChatMessage {
|
|
33
|
-
role: string;
|
|
34
|
-
content: string | Array<ChatImageContentItem>;
|
|
35
|
-
json?: any;
|
|
36
|
-
hidden?: boolean;
|
|
37
|
-
createdAt?: Date;
|
|
38
|
-
complete?: boolean;
|
|
39
|
-
voice?: FmodeChatMessageVoice;
|
|
40
|
-
/**AI回复消息字段 */
|
|
41
|
-
cid?: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* FmodeChat 聊天对话类
|
|
45
|
-
* @public
|
|
46
|
-
*/
|
|
47
|
-
export declare class FmodeChat {
|
|
48
|
-
title: string;
|
|
49
|
-
sessionId: string;
|
|
50
|
-
ChatSession: any;
|
|
51
|
-
chatSession: Parse.Object;
|
|
52
|
-
role: any;
|
|
53
|
-
messageList: FmodeChatMessage[];
|
|
54
|
-
latestAIResponse: string | undefined;
|
|
55
|
-
chatServ: any;
|
|
56
|
-
userInput: string;
|
|
57
|
-
userImage: string;
|
|
58
|
-
isDirect: boolean;
|
|
59
|
-
mode: "modal" | "page";
|
|
60
|
-
/**
|
|
61
|
-
* 函数生命周期
|
|
62
|
-
*/
|
|
63
|
-
onChatSaved: (chat: FmodeChat) => void;
|
|
64
|
-
onMessage: (chat: FmodeChat, message: FmodeChatMessage) => void;
|
|
65
|
-
onUserSend: (chat: FmodeChat, message: FmodeChatMessage) => boolean | Promise<boolean>;
|
|
66
|
-
onClose: (chat: FmodeChat) => boolean | Promise<boolean>;
|
|
67
|
-
hideShare: boolean;
|
|
68
|
-
hideModalSelect: boolean;
|
|
69
|
-
hideInputPreview: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* 可选模型列表加载
|
|
72
|
-
*/
|
|
73
|
-
modelList: Array<Parse.Object>;
|
|
74
|
-
currentModel: Parse.Object;
|
|
75
|
-
loadModelList(model?: Parse.Object): Promise<void>;
|
|
76
|
-
/**
|
|
77
|
-
* 虚拟形象展示状态
|
|
78
|
-
*/
|
|
79
|
-
isAvatarShow: boolean;
|
|
80
|
-
avatarMode: string;
|
|
81
|
-
avatarConfig: any | undefined;
|
|
82
|
-
showAvatar(): void;
|
|
83
|
-
/**
|
|
84
|
-
* 预置提示词弹窗是否展示
|
|
85
|
-
*/
|
|
86
|
-
isPromptModalOpen: boolean;
|
|
87
|
-
isPromptMessageAreaShow: boolean;
|
|
88
|
-
promptList: any;
|
|
89
|
-
/**
|
|
90
|
-
* 输入按钮区域
|
|
91
|
-
*/
|
|
92
|
-
focusUserInput: Function;
|
|
93
|
-
navCtrl: any;
|
|
94
|
-
leftButtons: Array<any>;
|
|
95
|
-
/**
|
|
96
|
-
* 是否开启语音消息模式(单次)
|
|
97
|
-
*/
|
|
98
|
-
isVoiceInputMode: boolean;
|
|
99
|
-
isTexting: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* 是否开启实时对话模式(实时)
|
|
102
|
-
* @desc
|
|
103
|
-
* 开启ssml system提示词
|
|
104
|
-
* 开启回答文本除xml显示模式
|
|
105
|
-
*/
|
|
106
|
-
voiceConfig: FmodeChatVoiceConfig | undefined;
|
|
107
|
-
isTalkMode: boolean;
|
|
108
|
-
SSMLRoleVoice: string;
|
|
109
|
-
/**
|
|
110
|
-
* 滚动至消息区域底部方法
|
|
111
|
-
* @desc 通过chat-panel等聊天面板,赋值该方法
|
|
112
|
-
*/
|
|
113
|
-
scrollComp: any;
|
|
114
|
-
scrollToBottom(comp?: any): void;
|
|
115
|
-
/**
|
|
116
|
-
* 依赖服务
|
|
117
|
-
*/
|
|
118
|
-
ncloud: NovaCloudService;
|
|
119
|
-
uploadServ: NovaUploadService;
|
|
120
|
-
constructor(sessionId: string, role?: Parse.Object, chatSession?: Parse.Object, chatServ?: any, navCtrl?: any, //NavController,
|
|
121
|
-
ncloud?: NovaCloudService, uploadServ?: NovaUploadService);
|
|
122
|
-
/**
|
|
123
|
-
* 会话Avatar控制
|
|
124
|
-
*/
|
|
125
|
-
playAnimation: (animName: string) => void;
|
|
126
|
-
welcome: () => Promise<void>;
|
|
127
|
-
getTimeOfDay(): "早上" | "中午" | "下午" | "晚上";
|
|
128
|
-
self: {
|
|
129
|
-
Person?: Parse.Object | undefined;
|
|
130
|
-
Profile?: Parse.Object | undefined;
|
|
131
|
-
};
|
|
132
|
-
loadSelf(className: any, userKey: any): Promise<any>;
|
|
133
|
-
/**
|
|
134
|
-
* 对话模型提示词
|
|
135
|
-
*/
|
|
136
|
-
loadTalkSystemPrompt(role: Parse.Object): Promise<void>;
|
|
137
|
-
/**
|
|
138
|
-
* 角色提示词
|
|
139
|
-
* @returns
|
|
140
|
-
*/
|
|
141
|
-
loadRolePrompt(): void;
|
|
142
|
-
/**
|
|
143
|
-
* 发送消息
|
|
144
|
-
* @param message
|
|
145
|
-
* @param imageUrl
|
|
146
|
-
*/
|
|
147
|
-
sendMessage(message?: string, imageUrl?: string, onComplete?: Function, eventMap?: FmodeChatEventMap, voice?: FmodeChatMessageVoice): Promise<void>;
|
|
148
|
-
getVoiceByContentText(content: string | ChatImageContentItem[], eventMap?: FmodeChatEventMap, promptEnabled?: boolean): Promise<FmodeChatMessageVoice>;
|
|
149
|
-
getContentText(content: string | ChatImageContentItem[]): string;
|
|
150
|
-
/**
|
|
151
|
-
* TTS - 语音合成
|
|
152
|
-
*
|
|
153
|
-
*/
|
|
154
|
-
initTTS(): Promise<FmodeTTS | null>;
|
|
155
|
-
voiceMap: any;
|
|
156
|
-
VoiceTTSMap: {
|
|
157
|
-
[key: string]: FmodeTTS;
|
|
158
|
-
};
|
|
159
|
-
stopPlayingVoice(): void;
|
|
160
|
-
playChatVoice(voice: Parse.Object, eventMap?: any): Promise<FmodeTTS | null>;
|
|
161
|
-
/**
|
|
162
|
-
* 保存单次会话
|
|
163
|
-
*/
|
|
164
|
-
saveChatSession(): Promise<void>;
|
|
165
|
-
getInviteUrl(url: any): string;
|
|
166
|
-
genTitle(): string;
|
|
167
|
-
fixMessageList(messages: FmodeChatMessage[]): {
|
|
168
|
-
role: string;
|
|
169
|
-
content: string | ChatImageContentItem[];
|
|
170
|
-
}[];
|
|
171
|
-
nowStr(): string;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* FmodeChatCompletion 文本补全类
|
|
175
|
-
* @public
|
|
176
|
-
*/
|
|
177
|
-
export declare class FmodeChatCompletion {
|
|
178
|
-
indexOfList: number;
|
|
179
|
-
model: string;
|
|
180
|
-
messages: FmodeChatMessage[];
|
|
181
|
-
content: string;
|
|
182
|
-
contentBuffer: string[];
|
|
183
|
-
contentPusher: any;
|
|
184
|
-
isCompleted: boolean;
|
|
185
|
-
constructor(messages: FmodeChatMessage[], options?: {
|
|
186
|
-
model?: string;
|
|
187
|
-
});
|
|
188
|
-
/**
|
|
189
|
-
* @param options
|
|
190
|
-
* @param options.isDirect 是否不等待逐字获取,直接完成内容推送
|
|
191
|
-
* @param options.intTime 是否不等待逐字获取,直接完成内容推送
|
|
192
|
-
* @returns
|
|
193
|
-
*/
|
|
194
|
-
sendCompletion(options?: {
|
|
195
|
-
isDirect?: boolean;
|
|
196
|
-
intTime?: number;
|
|
197
|
-
onComplete?: Function;
|
|
198
|
-
}): Observable<FmodeChatMessage>;
|
|
199
|
-
}
|
|
1
|
+
export * from "../../../core/agent/chat";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PushAudioOutputStreamCallback } from "microsoft-cognitiveservices-speech-sdk";
|
|
1
|
+
import { PushAudioOutputStreamCallback } from "microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Audio/PushAudioOutputStreamCallback";
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
export declare class FmPushAudioOutputStreamCallback extends PushAudioOutputStreamCallback {
|
|
4
4
|
audioContext: AudioContext;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { FmodeChatMessage } from "../interface";
|
|
3
|
+
/**
|
|
4
|
+
* FmodeChatCompletion 文本补全类
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare class FmodeChatCompletion {
|
|
8
|
+
indexOfList: number;
|
|
9
|
+
model: string;
|
|
10
|
+
messages: FmodeChatMessage[];
|
|
11
|
+
content: string;
|
|
12
|
+
contentBuffer: string[];
|
|
13
|
+
contentPusher: any;
|
|
14
|
+
isCompleted: boolean;
|
|
15
|
+
constructor(messages: FmodeChatMessage[], options?: {
|
|
16
|
+
model?: string;
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* @param options
|
|
20
|
+
* @param options.isDirect 是否不等待逐字获取,直接完成内容推送
|
|
21
|
+
* @param options.intTime 是否不等待逐字获取,直接完成内容推送
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
sendCompletion(options?: {
|
|
25
|
+
isDirect?: boolean;
|
|
26
|
+
intTime?: number;
|
|
27
|
+
onComplete?: Function;
|
|
28
|
+
}): Observable<FmodeChatMessage>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./fmode-completion";
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import Parse from "parse";
|
|
2
|
+
import { FmodeTTS } from "../../voice/tts";
|
|
3
|
+
import { NovaCloudService } from "../../../nova-cloud";
|
|
4
|
+
import { NovaUploadService } from "../../../storage/service-upload/nova-upload.service";
|
|
5
|
+
import { ChatImageContentItem, FmodeChatEventMap, FmodeChatMessage, FmodeChatMessageVoice, FmodeChatVoiceConfig } from "./interface";
|
|
6
|
+
export declare function getMessageContentText(content: any | string | Array<ChatImageContentItem>): string;
|
|
7
|
+
export declare function getMessageImageUrl(content: any | string | Array<ChatImageContentItem>): any;
|
|
8
|
+
/**
|
|
9
|
+
* FmodeChat 聊天对话类
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare class FmodeChat {
|
|
13
|
+
title: string;
|
|
14
|
+
sessionId: string;
|
|
15
|
+
ChatSession: any;
|
|
16
|
+
chatSession: Parse.Object;
|
|
17
|
+
role: any;
|
|
18
|
+
messageList: FmodeChatMessage[];
|
|
19
|
+
latestAIResponse: string | undefined;
|
|
20
|
+
chatServ: any;
|
|
21
|
+
userInput: string;
|
|
22
|
+
userImage: string;
|
|
23
|
+
isDirect: boolean;
|
|
24
|
+
mode: "modal" | "page";
|
|
25
|
+
/**
|
|
26
|
+
* 函数生命周期
|
|
27
|
+
*/
|
|
28
|
+
onChatSaved: (chat: FmodeChat) => void;
|
|
29
|
+
onMessage: (chat: FmodeChat, message: FmodeChatMessage) => void;
|
|
30
|
+
onUserSend: (chat: FmodeChat, message: FmodeChatMessage) => boolean | Promise<boolean>;
|
|
31
|
+
onClose: (chat: FmodeChat) => boolean | Promise<boolean>;
|
|
32
|
+
hideShare: boolean;
|
|
33
|
+
hideModalSelect: boolean;
|
|
34
|
+
hideInputPreview: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 可选模型列表加载
|
|
37
|
+
*/
|
|
38
|
+
modelList: Array<Parse.Object>;
|
|
39
|
+
currentModel: Parse.Object;
|
|
40
|
+
loadModelList(model?: Parse.Object): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* 虚拟形象展示状态
|
|
43
|
+
*/
|
|
44
|
+
isAvatarShow: boolean;
|
|
45
|
+
avatarMode: string;
|
|
46
|
+
avatarConfig: any | undefined;
|
|
47
|
+
showAvatar(): void;
|
|
48
|
+
/**
|
|
49
|
+
* 预置提示词弹窗是否展示
|
|
50
|
+
*/
|
|
51
|
+
isPromptModalOpen: boolean;
|
|
52
|
+
isPromptMessageAreaShow: boolean;
|
|
53
|
+
promptList: any;
|
|
54
|
+
/**
|
|
55
|
+
* 输入按钮区域
|
|
56
|
+
*/
|
|
57
|
+
focusUserInput: Function;
|
|
58
|
+
navCtrl: any;
|
|
59
|
+
leftButtons: Array<any>;
|
|
60
|
+
/**
|
|
61
|
+
* 是否开启语音消息模式(单次)
|
|
62
|
+
*/
|
|
63
|
+
isVoiceInputMode: boolean;
|
|
64
|
+
isTexting: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* 是否开启实时对话模式(实时)
|
|
67
|
+
* @desc
|
|
68
|
+
* 开启ssml system提示词
|
|
69
|
+
* 开启回答文本除xml显示模式
|
|
70
|
+
*/
|
|
71
|
+
voiceConfig: FmodeChatVoiceConfig | undefined;
|
|
72
|
+
isTalkMode: boolean;
|
|
73
|
+
SSMLRoleVoice: string;
|
|
74
|
+
/**
|
|
75
|
+
* 滚动至消息区域底部方法
|
|
76
|
+
* @desc 通过chat-panel等聊天面板,赋值该方法
|
|
77
|
+
*/
|
|
78
|
+
scrollComp: any;
|
|
79
|
+
scrollToBottom(comp?: any): void;
|
|
80
|
+
/**
|
|
81
|
+
* 依赖服务
|
|
82
|
+
*/
|
|
83
|
+
ncloud: NovaCloudService;
|
|
84
|
+
uploadServ: NovaUploadService;
|
|
85
|
+
constructor(sessionId: string, role?: Parse.Object, chatSession?: Parse.Object, chatServ?: any, navCtrl?: any, //NavController,
|
|
86
|
+
ncloud?: NovaCloudService, uploadServ?: NovaUploadService);
|
|
87
|
+
/**
|
|
88
|
+
* 会话Avatar控制
|
|
89
|
+
*/
|
|
90
|
+
playAnimation: (animName: string) => void;
|
|
91
|
+
welcome: () => Promise<void>;
|
|
92
|
+
getTimeOfDay(): "早上" | "中午" | "下午" | "晚上";
|
|
93
|
+
self: {
|
|
94
|
+
Person?: Parse.Object | undefined;
|
|
95
|
+
Profile?: Parse.Object | undefined;
|
|
96
|
+
};
|
|
97
|
+
loadSelf(className: any, userKey: any): Promise<any>;
|
|
98
|
+
/**
|
|
99
|
+
* 对话模型提示词
|
|
100
|
+
*/
|
|
101
|
+
loadTalkSystemPrompt(role: Parse.Object): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* 角色提示词
|
|
104
|
+
* @returns
|
|
105
|
+
*/
|
|
106
|
+
loadRolePrompt(): void;
|
|
107
|
+
/**
|
|
108
|
+
* 发送消息
|
|
109
|
+
* @param message
|
|
110
|
+
* @param imageUrl
|
|
111
|
+
*/
|
|
112
|
+
sendMessage(message?: string, imageUrl?: string, onComplete?: Function, eventMap?: FmodeChatEventMap, voice?: FmodeChatMessageVoice): Promise<void>;
|
|
113
|
+
getVoiceByContentText(content: string | ChatImageContentItem[], eventMap?: FmodeChatEventMap, promptEnabled?: boolean): Promise<FmodeChatMessageVoice>;
|
|
114
|
+
getContentText(content: string | ChatImageContentItem[]): string;
|
|
115
|
+
/**
|
|
116
|
+
* TTS - 语音合成
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
initTTS(): Promise<FmodeTTS | null>;
|
|
120
|
+
voiceMap: any;
|
|
121
|
+
VoiceTTSMap: {
|
|
122
|
+
[key: string]: FmodeTTS;
|
|
123
|
+
};
|
|
124
|
+
stopPlayingVoice(): void;
|
|
125
|
+
playChatVoice(voice: Parse.Object, eventMap?: any): Promise<FmodeTTS | null>;
|
|
126
|
+
/**
|
|
127
|
+
* 保存单次会话
|
|
128
|
+
*/
|
|
129
|
+
saveChatSession(): Promise<void>;
|
|
130
|
+
getInviteUrl(url: any): string;
|
|
131
|
+
genTitle(): string;
|
|
132
|
+
fixMessageList(messages: FmodeChatMessage[]): {
|
|
133
|
+
role: string;
|
|
134
|
+
content: string | ChatImageContentItem[];
|
|
135
|
+
}[];
|
|
136
|
+
nowStr(): string;
|
|
137
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface FmodeChatMessageVoice {
|
|
2
|
+
id: string;
|
|
3
|
+
duration?: number;
|
|
4
|
+
ssml?: string;
|
|
5
|
+
voiceUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FmodeChatEventMap {
|
|
8
|
+
onComplete?(FmodeChatMessage: any): void;
|
|
9
|
+
onSSMLComplete?(FmodeChatMessageVoice: any): void;
|
|
10
|
+
}
|
|
11
|
+
export interface FmodeChatVoiceConfig {
|
|
12
|
+
voice: string;
|
|
13
|
+
autoTalk: boolean;
|
|
14
|
+
welcome: {
|
|
15
|
+
enabled: true;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface ChatImageContentItem {
|
|
19
|
+
type: string;
|
|
20
|
+
text?: string;
|
|
21
|
+
image_url?: {
|
|
22
|
+
url: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface FmodeChatMessage {
|
|
26
|
+
role: string;
|
|
27
|
+
content: string | Array<ChatImageContentItem>;
|
|
28
|
+
json?: any;
|
|
29
|
+
hidden?: boolean;
|
|
30
|
+
createdAt?: Date;
|
|
31
|
+
complete?: boolean;
|
|
32
|
+
voice?: FmodeChatMessageVoice;
|
|
33
|
+
/**AI回复消息字段 */
|
|
34
|
+
cid?: string;
|
|
35
|
+
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { PromptTemplate } from "@langchain/core/prompts";
|
|
2
1
|
import { Observable } from "rxjs";
|
|
3
|
-
import { FmodeChatMessage } from "../
|
|
2
|
+
import { FmodeChatMessage } from "../chat/interface";
|
|
4
3
|
export declare class AgentPrompt {
|
|
5
4
|
constructor();
|
|
6
5
|
jsonCompletion(prompt: string, model?: string): Observable<FmodeChatMessage | any>;
|
|
7
6
|
extractAndParseJson(inputString: string): any;
|
|
8
7
|
extractMarkdownToMultiArray(markdownText: string): any;
|
|
9
|
-
getFormatTpl(promptTplCode: string, paramsMap: any): Promise<string>;
|
|
10
|
-
getPromptTpl(code: string): Promise<PromptTemplate>;
|
|
11
8
|
getTokens(content: string): number;
|
|
12
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./agent.prompt";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Parse from "parse";
|
|
2
|
+
export declare class AgentStory {
|
|
3
|
+
Story: Parse.ObjectConstructor;
|
|
4
|
+
Document: Parse.ObjectConstructor;
|
|
5
|
+
story: Parse.Object | undefined;
|
|
6
|
+
docsList: Array<Parse.Object>;
|
|
7
|
+
constructor(story?: Parse.Object, person?: Parse.Object, book?: Parse.Object);
|
|
8
|
+
setAttachment(attach: {
|
|
9
|
+
id: string;
|
|
10
|
+
}): Promise<Parse.Object<Parse.Attributes>>;
|
|
11
|
+
loadSlipt(attach: Parse.Object): Promise<Parse.Object<Parse.Attributes>[]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./agent.story";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Subscription } from "rxjs";
|
|
2
|
+
import { FmAgentTaskComponent } from "../../../aigc/agent/fm-agent-task/fm-agent-task.component";
|
|
3
|
+
interface AgentTaskButton {
|
|
4
|
+
name: string;
|
|
5
|
+
handle: {
|
|
6
|
+
(options?: any): void;
|
|
7
|
+
};
|
|
8
|
+
isShow?: Function;
|
|
9
|
+
color?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class AgentTaskStep {
|
|
12
|
+
title: string;
|
|
13
|
+
shareData: any;
|
|
14
|
+
data: any;
|
|
15
|
+
parentComp: FmAgentTaskComponent | undefined;
|
|
16
|
+
parentIndex: number | undefined;
|
|
17
|
+
restart(): void;
|
|
18
|
+
buttons: Array<AgentTaskButton>;
|
|
19
|
+
restartButtonShow: boolean;
|
|
20
|
+
limitStart: boolean;
|
|
21
|
+
cancelAll: boolean;
|
|
22
|
+
progressHidden: boolean;
|
|
23
|
+
_simProgress: number;
|
|
24
|
+
_progress: number;
|
|
25
|
+
get progress(): number;
|
|
26
|
+
set progress(v: number);
|
|
27
|
+
message: string;
|
|
28
|
+
error: string;
|
|
29
|
+
logList: Array<string>;
|
|
30
|
+
constructor(metaData: {
|
|
31
|
+
title: string;
|
|
32
|
+
shareData?: any;
|
|
33
|
+
progressHidden?: boolean;
|
|
34
|
+
handle?: {
|
|
35
|
+
(): Promise<any>;
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* 任务处理函数
|
|
40
|
+
* @returns Promise<boolean>
|
|
41
|
+
* resolve(true) 执行成功
|
|
42
|
+
* resolve(false) 执行失败
|
|
43
|
+
* reject() 永不触发
|
|
44
|
+
* */
|
|
45
|
+
handle: {
|
|
46
|
+
(): Promise<boolean>;
|
|
47
|
+
} | undefined;
|
|
48
|
+
progressSub$: Subscription | undefined;
|
|
49
|
+
simulatorProgress(): Promise<unknown>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./agent.task";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../aigc/voice/tts";
|