omnirtc-web 1.7.0 → 1.7.1

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/aigc.d.ts CHANGED
@@ -5,8 +5,8 @@ import { TurnServerConfig, RemoteStreamType, RemoteStreamFallbackType, Encryptio
5
5
  declare class Request {
6
6
  private axios;
7
7
  constructor(baseURL: string, appId: string);
8
- get(url: string, config?: AxiosRequestConfig): Record<string, any>;
9
- post(url: string, data: any, config?: AxiosRequestConfig): Record<string, any>;
8
+ get(url: string, config?: AxiosRequestConfig): Promise<Record<string, any>>;
9
+ post(url: string, data: any, config?: AxiosRequestConfig): Promise<Record<string, any>>;
10
10
  }
11
11
 
12
12
  declare interface OmniRTCStats {
@@ -815,7 +815,7 @@ declare class Aigc extends EventEmitter$2<EventMap> {
815
815
  * 查询当前应用的AIGC配置
816
816
  * @returns
817
817
  */
818
- query(): Record<string, any>;
818
+ query(): Promise<Record<string, any>>;
819
819
  /**
820
820
  *
821
821
  * @param taskType 使用的aigc类型
@@ -824,16 +824,16 @@ declare class Aigc extends EventEmitter$2<EventMap> {
824
824
  * @param options 附带信息
825
825
  * @returns
826
826
  */
827
- start(taskType: 'asr', config: AsrConfig, robotId: string, options?: Record<string, any>): Record<string, any>;
828
- start(taskType: 'voicechat' | 'visionchat', config: ChatConfig, robotId: string, options?: Record<string, any>): Record<string, any>;
829
- start(taskType: 'avatarchat', config: AvatarConfig, robotId: string, options?: Record<string, any>): Record<string, any>;
830
- start(taskType: TaskType, config: AsrConfig | ChatConfig | AvatarConfig, robotId: string, options?: Record<string, any>): Record<string, any>;
827
+ start(taskType: 'asr', config: AsrConfig, robotId: string, options?: Record<string, any>): Promise<Record<string, any>>;
828
+ start(taskType: 'voicechat' | 'visionchat', config: ChatConfig, robotId: string, options?: Record<string, any>): Promise<Record<string, any>>;
829
+ start(taskType: 'avatarchat', config: AvatarConfig, robotId: string, options?: Record<string, any>): Promise<Record<string, any>>;
830
+ start(taskType: TaskType, config: AsrConfig | ChatConfig | AvatarConfig, robotId: string, options?: Record<string, any>): Promise<Record<string, any>>;
831
831
  /**
832
832
  * 停止当前aigc任务
833
833
  * @param options 附带信息
834
834
  * @returns
835
835
  */
836
- stop(options?: Record<string, any>): Record<string, any>;
836
+ stop(options?: Record<string, any>): Promise<Record<string, any>>;
837
837
  /**
838
838
  *
839
839
  * @param type 更新类型
@@ -841,13 +841,13 @@ declare class Aigc extends EventEmitter$2<EventMap> {
841
841
  * @param options
842
842
  * @returns
843
843
  */
844
- update(type: TaskTypeEnum.UPDATE_PROMPT, config: SendPrompt, options?: Record<string, any>): Record<string, any>;
845
- update(type: TaskTypeEnum.BREAK_AI_RESPONSE, config: null, options?: Record<string, any>): Record<string, any>;
846
- update(type: TaskTypeEnum.BROADCAST_CONTENT, config: BroadcastContent, options?: Record<string, any>): Record<string, any>;
847
- update(type: TaskTypeEnum.SEND_CONTENT_TO_LLM, config: SendPrompt, options?: Record<string, any>): Record<string, any>;
848
- update(type: TaskTypeEnum.SUBMIT_VOICE_TO_LLM, config: null, options?: Record<string, any>): Record<string, any>;
849
- update(type: TaskTypeEnum.SEND_SIGNALING_TO_CLIENT, config: CustomSignaling, options?: Record<string, any>): Record<string, any>;
850
- update(type: TaskTypeEnum, config: SendPrompt | BroadcastContent | CustomSignaling | null, options?: Record<string, any>): Record<string, any>;
844
+ update(type: TaskTypeEnum.UPDATE_PROMPT, config: SendPrompt, options?: Record<string, any>): Promise<Record<string, any>>;
845
+ update(type: TaskTypeEnum.BREAK_AI_RESPONSE, config: null, options?: Record<string, any>): Promise<Record<string, any>>;
846
+ update(type: TaskTypeEnum.BROADCAST_CONTENT, config: BroadcastContent, options?: Record<string, any>): Promise<Record<string, any>>;
847
+ update(type: TaskTypeEnum.SEND_CONTENT_TO_LLM, config: SendPrompt, options?: Record<string, any>): Promise<Record<string, any>>;
848
+ update(type: TaskTypeEnum.SUBMIT_VOICE_TO_LLM, config: null, options?: Record<string, any>): Promise<Record<string, any>>;
849
+ update(type: TaskTypeEnum.SEND_SIGNALING_TO_CLIENT, config: CustomSignaling, options?: Record<string, any>): Promise<Record<string, any>>;
850
+ update(type: TaskTypeEnum, config: SendPrompt | BroadcastContent | CustomSignaling | null, options?: Record<string, any>): Promise<Record<string, any>>;
851
851
  /**
852
852
  * 绑定事件触发器
853
853
  */
@@ -5432,7 +5432,7 @@ _stream.addTrack(track.track);context=getAudioContext();source=context.createMed
5432
5432
  */function getAudioBuffer(source,cacheOnlineFile){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/regenerator.mark(function _callee228(){var arrayBuffer,cacheAudioBuffer,getFileArrayBuffer,audioBuffer;return regenerator.wrap(function _callee228$(_context243){while(1)switch(_context243.prev=_context243.next){case 0:if(!('string'==typeof source)){_context243.next=15;break;}cacheAudioBuffer=cacheMap.get(source);if(!cacheAudioBuffer){_context243.next=4;break;}return _context243.abrupt("return",cacheAudioBuffer);case 4:_context243.prev=4;_context243.next=7;return getStringArrayBuffer(source);case 7:arrayBuffer=_context243.sent;_context243.next=13;break;case 10:_context243.prev=10;_context243.t0=_context243["catch"](4);throw new CoreRTCError(CoreRTCErrorCode.CHECK_VIDEO_TRACK_ERROR,typeof _context243.t0==='string'?_context243.t0:'fetch audio file failed');case 13:_context243.next=19;break;case 15:getFileArrayBuffer=new Promise(function(resolve,reject){var fileReader=new FileReader();fileReader.addEventListener('load',function(res){if(res.target){resolve(res.target.result);}else {reject(new CoreRTCError(CoreRTCErrorCode.READ_LOCAL_AUDIO_FILE_ERROR,'read local audio file error'));}});fileReader.addEventListener('error',function(){reject(new CoreRTCError(CoreRTCErrorCode.READ_LOCAL_AUDIO_FILE_ERROR,'read local audio file error'));});fileReader.readAsArrayBuffer(source);});_context243.next=18;return getFileArrayBuffer;case 18:arrayBuffer=_context243.sent;case 19:_context243.next=21;return decodeAudioData(arrayBuffer);case 21:audioBuffer=_context243.sent;if('string'==typeof source&&cacheOnlineFile)cacheMap.set(source,audioBuffer);return _context243.abrupt("return",audioBuffer);case 24:case"end":return _context243.stop();}},_callee228,null,[[4,10]]);}));}
5433
5433
 
5434
5434
  var StaticConfig = {
5435
- agentVersion: "OmniRTC_Web_V1.7.0",
5435
+ agentVersion: "OmniRTC_Web_V1.7.1",
5436
5436
  logVersion: 1,
5437
5437
  serviceType: 320,
5438
5438
  logBackendUrl: "https://rtc-logs.magic-school.com/stream.gif"
@@ -8363,7 +8363,7 @@ function log(clsName) {
8363
8363
  sdk_api_name: '中间层-函数调用',
8364
8364
  message: "\u4E2D\u95F4\u5C42-".concat(clsName, ".").concat(name),
8365
8365
  from_encapsulation_layer: true,
8366
- encapsulation_layer_built_timestamp: '2026/3/19 19:55:21',
8366
+ encapsulation_layer_built_timestamp: '2026/3/23 10:36:58',
8367
8367
  });
8368
8368
  }
8369
8369
  }
@@ -5440,7 +5440,7 @@
5440
5440
  */function getAudioBuffer(source,cacheOnlineFile){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/regenerator.mark(function _callee228(){var arrayBuffer,cacheAudioBuffer,getFileArrayBuffer,audioBuffer;return regenerator.wrap(function _callee228$(_context243){while(1)switch(_context243.prev=_context243.next){case 0:if(!('string'==typeof source)){_context243.next=15;break;}cacheAudioBuffer=cacheMap.get(source);if(!cacheAudioBuffer){_context243.next=4;break;}return _context243.abrupt("return",cacheAudioBuffer);case 4:_context243.prev=4;_context243.next=7;return getStringArrayBuffer(source);case 7:arrayBuffer=_context243.sent;_context243.next=13;break;case 10:_context243.prev=10;_context243.t0=_context243["catch"](4);throw new CoreRTCError(CoreRTCErrorCode.CHECK_VIDEO_TRACK_ERROR,typeof _context243.t0==='string'?_context243.t0:'fetch audio file failed');case 13:_context243.next=19;break;case 15:getFileArrayBuffer=new Promise(function(resolve,reject){var fileReader=new FileReader();fileReader.addEventListener('load',function(res){if(res.target){resolve(res.target.result);}else {reject(new CoreRTCError(CoreRTCErrorCode.READ_LOCAL_AUDIO_FILE_ERROR,'read local audio file error'));}});fileReader.addEventListener('error',function(){reject(new CoreRTCError(CoreRTCErrorCode.READ_LOCAL_AUDIO_FILE_ERROR,'read local audio file error'));});fileReader.readAsArrayBuffer(source);});_context243.next=18;return getFileArrayBuffer;case 18:arrayBuffer=_context243.sent;case 19:_context243.next=21;return decodeAudioData(arrayBuffer);case 21:audioBuffer=_context243.sent;if('string'==typeof source&&cacheOnlineFile)cacheMap.set(source,audioBuffer);return _context243.abrupt("return",audioBuffer);case 24:case"end":return _context243.stop();}},_callee228,null,[[4,10]]);}));}
5441
5441
 
5442
5442
  var StaticConfig = {
5443
- agentVersion: "OmniRTC_Web_V1.7.0",
5443
+ agentVersion: "OmniRTC_Web_V1.7.1",
5444
5444
  logVersion: 1,
5445
5445
  serviceType: 320,
5446
5446
  logBackendUrl: "https://rtc-logs.magic-school.com/stream.gif"
@@ -8371,7 +8371,7 @@
8371
8371
  sdk_api_name: '中间层-函数调用',
8372
8372
  message: "\u4E2D\u95F4\u5C42-".concat(clsName, ".").concat(name),
8373
8373
  from_encapsulation_layer: true,
8374
- encapsulation_layer_built_timestamp: '2026/3/19 19:55:21',
8374
+ encapsulation_layer_built_timestamp: '2026/3/23 10:36:58',
8375
8375
  });
8376
8376
  }
8377
8377
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnirtc-web",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "",
5
5
  "main": "./dist/es-omnirtc-web.js",
6
6
  "module": "./dist/es-omnirtc-web.js",