omnirtc-web 1.7.3 → 1.7.4

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/omni.d.ts CHANGED
@@ -1,129 +1,5 @@
1
- declare function getRTCInstance(token: string, extraInfo?: string): IOmniRTC;
1
+ export declare function getRTCInstance(token: string, extraInfo?: string): IOmniRTC;
2
2
  export default getRTCInstance;
3
- import { AxiosRequestConfig, AxiosResponse } from 'axios';
4
-
5
- declare class Request {
6
- private axios;
7
- constructor(baseURL: string, appId: string);
8
- get(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
9
- post(url: string, data: any, config?: AxiosRequestConfig): Promise<AxiosResponse<any, any>>;
10
- }
11
-
12
- type TaskType = 'asr' | 'voicechat' | 'visionchat' | 'avatarchat';
13
- interface AsrConfig {
14
- vendor: number;
15
- }
16
- interface ChatConfig {
17
- /**
18
- * asr配置ID
19
- */
20
- asrConfig?: number;
21
- /**
22
- * llm配置ID
23
- */
24
- llmConfig?: number;
25
- /**
26
- * tts配置ID
27
- */
28
- ttsConfig?: number;
29
- /**
30
- * 聊天提示词
31
- */
32
- prompt?: string;
33
- /**
34
- * 欢迎语
35
- */
36
- welcome?: string;
37
- [key: string]: any;
38
- }
39
- interface AvatarConfig extends ChatConfig {
40
- /**
41
- * 数字人配置ID
42
- */
43
- avatarConfig?: number;
44
- }
45
- declare enum TaskTypeEnum {
46
- /**
47
- * 更新系统提示词
48
- */
49
- UPDATE_PROMPT = 1,
50
- /**
51
- * 打断AI回复
52
- */
53
- BREAK_AI_RESPONSE = 2,
54
- /**
55
- * 播报指定内容
56
- */
57
- BROADCAST_CONTENT = 3,
58
- /**
59
- * 指定内容调大模型
60
- */
61
- SEND_CONTENT_TO_LLM = 4,
62
- /**
63
- * 手动提交语音内容给大模型回复(仅手动提交模式任务下有效)
64
- */
65
- SUBMIT_VOICE_TO_LLM = 5,
66
- /**
67
- * 业务自定义信令推送到客户端,端上会收到onStreamMessage(uid, msg)回调
68
- */
69
- SEND_SIGNALING_TO_CLIENT = 6
70
- }
71
- interface SendPrompt {
72
- prompt: string;
73
- }
74
- interface BroadcastContent {
75
- content: string;
76
- }
77
- interface CustomSignaling {
78
- message: string;
79
- }
80
- declare class Aigc {
81
- static BASE_URL: string;
82
- static DICTIONARY: string;
83
- request: Request;
84
- config: Record<string, any>;
85
- taskId?: string;
86
- taskType?: TaskType;
87
- constructor(token: string);
88
- /**
89
- * 查询当前应用的AIGC配置
90
- * @returns
91
- */
92
- query(): Promise<AxiosResponse<any, any>>;
93
- /**
94
- *
95
- * @param taskType 使用的aigc类型
96
- * @param config 启动任务的参数
97
- * @param robotId 机器人id,纯数字字符串
98
- * @param options 附带信息
99
- * @returns
100
- */
101
- start(taskType: 'asr', config: AsrConfig, robotId: string, options?: Record<string, any>): any;
102
- start(taskType: 'voicechat' | 'visionchat', config: ChatConfig, robotId: string, options?: Record<string, any>): any;
103
- start(taskType: 'avatarchat', config: AvatarConfig, robotId: string, options?: Record<string, any>): any;
104
- /**
105
- * 停止当前aigc任务
106
- * @param options 附带信息
107
- * @returns
108
- */
109
- stop(options?: Record<string, any>): Promise<AxiosResponse<any, any>>;
110
- /**
111
- *
112
- * @param type 更新类型
113
- * @param config
114
- * @param options
115
- * @returns
116
- */
117
- update(type: TaskTypeEnum.UPDATE_PROMPT, config: SendPrompt, options?: Record<string, any>): any;
118
- update(type: TaskTypeEnum.BREAK_AI_RESPONSE, config: null, options?: Record<string, any>): any;
119
- update(type: TaskTypeEnum.BROADCAST_CONTENT, config: BroadcastContent, options?: Record<string, any>): any;
120
- update(type: TaskTypeEnum.SEND_CONTENT_TO_LLM, config: SendPrompt, options?: Record<string, any>): any;
121
- update(type: TaskTypeEnum.SUBMIT_VOICE_TO_LLM, config: null, options?: Record<string, any>): any;
122
- update(type: TaskTypeEnum.SEND_SIGNALING_TO_CLIENT, config: CustomSignaling, options?: Record<string, any>): any;
123
- generateTaskId(len?: number): string;
124
- }
125
-
126
- export { Aigc, AsrConfig, AvatarConfig, BroadcastContent, ChatConfig, CustomSignaling, SendPrompt, TaskType, TaskTypeEnum };
127
3
 
128
4
  declare class OmniRTCError extends Error {
129
5
  readonly code: OmniRTCErrorCode;
@@ -807,6 +683,7 @@ export declare interface IOmniRTCClient extends EventEmitter {
807
683
  // setStreamFallbackOption(uid: UID, fallbackType: RemoteStreamFallbackType): Promise<void>;
808
684
 
809
685
  // setEncryptionConfig(encryptionMode: EncryptionMode, secret: string, salt?: Uint8Array): void;
686
+ sendRoomBinaryMessage(message: Uint8Array): Promise<number>;
810
687
 
811
688
  renewToken(token: string): Promise<void>;
812
689