@coze/realtime-api 1.3.0 → 1.3.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/umd/index.js CHANGED
@@ -350,6 +350,10 @@
350
350
  * en: Mode updated
351
351
  * zh: 更新房间模式成功
352
352
  */ EventNames["MODE_UPDATED"] = "server.mode.updated";
353
+ /**
354
+ * en: Live created
355
+ * zh: 直播创建
356
+ */ EventNames["LIVE_CREATED"] = "server.live.created";
353
357
  return EventNames;
354
358
  }(event_names_EventNames || {});
355
359
  /* ESM default export */ const event_names = event_names_EventNames;
@@ -692,6 +696,7 @@
692
696
  if (isTestEnv) rtc_default().setParameter('ICE_CONFIG_REQUEST_URLS', [
693
697
  'rtc-test.bytedance.com'
694
698
  ]);
699
+ else localStorage.removeItem('RTC_ACCESS_URLS-VolcEngine');
695
700
  this.engine = rtc_default().createEngine(appId);
696
701
  this.handleMessage = this.handleMessage.bind(this);
697
702
  this.handleUserJoin = this.handleUserJoin.bind(this);
@@ -725,7 +730,7 @@
725
730
  else {
726
731
  const config = {};
727
732
  if (this._config.prologueContent) config.prologue_content = this._config.prologueContent;
728
- if (void 0 !== this._config.roomMode && null !== this._config.roomMode) config.room_mode = this._config.roomMode;
733
+ if (void 0 !== this._config.roomMode && null !== this._config.roomMode) config.room_mode = this._config.roomMode || api_.RoomMode.Default;
729
734
  if (this._config.videoConfig) {
730
735
  if (isScreenShareDevice(this._config.videoConfig.videoInputDeviceId)) config.video_config = {
731
736
  stream_video_type: 'screen'
@@ -734,7 +739,8 @@
734
739
  stream_video_type: 'main'
735
740
  };
736
741
  }
737
- roomInfo = await this._api.audio.rooms.create({
742
+ if (this._config.translateConfig) config.translate_config = this._config.translateConfig;
743
+ const params = {
738
744
  bot_id: botId,
739
745
  conversation_id: conversationId || void 0,
740
746
  voice_id: voiceId && voiceId.length > 0 ? voiceId : void 0,
@@ -742,7 +748,8 @@
742
748
  uid: this._config.userId || void 0,
743
749
  workflow_id: this._config.workflowId || void 0,
744
750
  config
745
- });
751
+ };
752
+ roomInfo = await this._api.audio.rooms.create(params);
746
753
  }
747
754
  } catch (error) {
748
755
  this.dispatch(event_names.ERROR, error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze/realtime-api",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A powerful real-time communication SDK for voice interactions with Coze AI bots | 扣子官方实时通信 SDK,用于与 Coze AI bots 进行语音交互",
5
5
  "keywords": [
6
6
  "coze",
@@ -31,6 +31,11 @@
31
31
  "require": "./dist/cjs/event-names/index.js",
32
32
  "import": "./dist/esm/event-names/index.js",
33
33
  "types": "./dist/types/event-names/event-names.d.ts"
34
+ },
35
+ "./live": {
36
+ "require": "./dist/cjs/live/index.js",
37
+ "import": "./dist/esm/live/index.js",
38
+ "types": "./dist/types/live/live/index.d.ts"
34
39
  }
35
40
  },
36
41
  "main": "dist/cjs/index.js",
@@ -54,7 +59,7 @@
54
59
  "test:cov": "vitest --coverage --run"
55
60
  },
56
61
  "dependencies": {
57
- "@coze/api": "1.3.0",
62
+ "@coze/api": "1.3.3",
58
63
  "@volcengine/rtc": "~4.62.11"
59
64
  },
60
65
  "devDependencies": {
@@ -86,6 +91,11 @@
86
91
  "require": "./dist/cjs/event-names/index.js",
87
92
  "import": "./dist/esm/event-names/index.js",
88
93
  "types": "./dist/types/event-names/event-names.d.ts"
94
+ },
95
+ "./live": {
96
+ "require": "./dist/cjs/live/index.js",
97
+ "import": "./dist/esm/live/index.js",
98
+ "types": "./dist/types/live/live/index.d.ts"
89
99
  }
90
100
  },
91
101
  "main": "dist/cjs/index.js",