@coze/realtime-api 1.0.4 → 1.0.5-beta.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.
@@ -1 +1,23 @@
1
+ /*!
2
+ * Reconnecting WebSocket
3
+ * by Pedro Ladaria <pedro.ladaria@gmail.com>
4
+ * https://github.com/pladaria/reconnecting-websocket
5
+ * License MIT
6
+ */
7
+
8
+ /*! *****************************************************************************
9
+ Copyright (c) Microsoft Corporation. All rights reserved.
10
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
11
+ this file except in compliance with the License. You may obtain a copy of the
12
+ License at http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17
+ MERCHANTABLITY OR NON-INFRINGEMENT.
18
+
19
+ See the Apache Version 2.0 License for specific language governing permissions
20
+ and limitations under the License.
21
+ ***************************************************************************** */
22
+
1
23
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
@@ -1,4 +1,4 @@
1
- import { type AudioPropertiesConfig, type onUserJoinedEvent, type onUserLeaveEvent, type UserMessageEvent } from '@volcengine/rtc';
1
+ import { type AudioPropertiesConfig, type IRTCEngine, type onUserJoinedEvent, type onUserLeaveEvent, type UserMessageEvent } from '@volcengine/rtc';
2
2
  import { RealtimeEventHandler } from './event-handler';
3
3
  import { type VideoConfig } from '.';
4
4
  export declare class EngineClient extends RealtimeEventHandler {
@@ -43,4 +43,5 @@ export declare class EngineClient extends RealtimeEventHandler {
43
43
  changeAIAnsExtension(enable: boolean): void;
44
44
  startAudioPlaybackDeviceTest(): Promise<void>;
45
45
  stopAudioPlaybackDeviceTest(): void;
46
+ getRtcEngine(): IRTCEngine;
46
47
  }
@@ -1,5 +1,5 @@
1
- import { type ScreenConfig, type AudioPropertiesConfig } from '@volcengine/rtc';
2
- import { type GetToken } from '@coze/api';
1
+ import { type ScreenConfig, type AudioPropertiesConfig, type IRTCEngine } from '@volcengine/rtc';
2
+ import { type CreateRoomData, type GetToken } from '@coze/api';
3
3
  import * as RealtimeUtils from './utils';
4
4
  import { RealtimeEventHandler, EventNames } from './event-handler';
5
5
  import { RealtimeAPIError, RealtimeError } from './error';
@@ -14,8 +14,11 @@ export interface RealtimeClientConfig {
14
14
  botId: string /** required, Bot Id */;
15
15
  voiceId?: string /** optional, Voice Id */;
16
16
  conversationId?: string /** optional, Conversation Id */;
17
+ userId?: string /** optional, User Id */;
18
+ workflowId?: string /** optional, Workflow Id */;
17
19
  baseURL?: string /** optional, defaults to "https://api.coze.cn" */;
18
20
  debug?: boolean /** optional, defaults to false */;
21
+ getRoomInfo?: () => Promise<CreateRoomData> /** optional, Customize get room info */;
19
22
  /** Whether Personal Access Tokens (PAT) are allowed in browser environments */
20
23
  allowPersonalAccessTokenInBrowser?: boolean;
21
24
  /** Whether to mute by default, defaults to false
@@ -48,6 +51,8 @@ declare class RealtimeClient extends RealtimeEventHandler {
48
51
  * 可选,音色Id。
49
52
  * @param config.conversationId - Optional, Conversation Id. |
50
53
  * 可选,会话Id。
54
+ * @param config.userId - Optional, User Id. |
55
+ * 可选,用户Id。
51
56
  * @param config.baseURL - Optional, defaults to "https://api.coze.cn". |
52
57
  * 可选,默认值为 "https://api.coze.cn"。
53
58
  * @param config.debug - Optional, defaults to false.
@@ -138,5 +143,11 @@ declare class RealtimeClient extends RealtimeEventHandler {
138
143
  */
139
144
  setAudioOutputDevice(deviceId: string): Promise<void>;
140
145
  setVideoInputDevice(deviceId: string): Promise<void>;
146
+ /**
147
+ * en: Get the RTC engine instance, for detail visit https://www.volcengine.com/docs/6348/104481
148
+ *
149
+ * zh: 获取 RTC 引擎实例,详情请访问 https://www.volcengine.com/docs/6348/104481
150
+ */
151
+ getRtcEngine(): IRTCEngine | undefined;
141
152
  }
142
153
  export { RealtimeUtils, RealtimeClient, RealtimeAPIError, RealtimeError, EventNames, };