@ray-js/api 1.7.80 → 1.7.82

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,23 +1,23 @@
1
1
  /**
2
2
  * AIStreamKit
3
3
  *
4
- * @version 2.1.0
4
+ * @version 2.2.14
5
5
  */
6
6
  declare namespace ty.aistream {
7
7
  /**
8
- * 获取通道连接状态
8
+ * Get channel connection status
9
9
  * @public
10
10
  * @since AIStreamKit 1.0.0
11
11
  * @platform iOS Android
12
12
  */
13
13
  export function isConnected(params: {
14
14
  /**
15
- * client 类型: 1-作为设备代理, 2-作为 App,3-作为开发者
15
+ * Client type: 1-device proxy, 2-App, 3-developer
16
16
  * @since AIStreamKit 1.0.0
17
17
  */
18
18
  clientType: number
19
19
  /**
20
- * 代理的设备ID, clientType == 1 时必传
20
+ * Proxy device ID, required when clientType == 1
21
21
  * @since AIStreamKit 1.0.0
22
22
  */
23
23
  deviceId?: string
@@ -26,22 +26,22 @@ declare namespace ty.aistream {
26
26
  /** 接口调用成功的回调函数 */
27
27
  success?: (params: {
28
28
  /**
29
- * 是否已连接
29
+ * Whether connected
30
30
  * @since AIStreamKit 1.0.0
31
31
  */
32
32
  connected: boolean
33
33
  /**
34
- * 通道连接状态: 0-初始化,1-连接中,2-鉴权中,3-已连接,4-被云端断开,5-主动关闭
34
+ * Channel connection state: 0-initialized, 1-connecting, 2-authenticating, 3-connected, 4-disconnected by cloud, 5-actively closed
35
35
  * @since AIStreamKit 1.0.0
36
36
  */
37
37
  state: number
38
38
  /**
39
- * client 类型: 1-作为设备代理, 2-作为 App,3-作为开发者
39
+ * Client type: 1-device proxy, 2-App, 3-developer
40
40
  * @since AIStreamKit 1.0.0
41
41
  */
42
42
  clientType?: number
43
43
  /**
44
- * 连接的唯一标识
44
+ * Unique connection identifier
45
45
  * @since AIStreamKit 1.0.0
46
46
  */
47
47
  connectionId?: string
@@ -63,48 +63,48 @@ declare namespace ty.aistream {
63
63
  }): void
64
64
 
65
65
  /**
66
- * 获取通道连接状态
66
+ * Get channel connection status
67
67
  * @public
68
68
  * @since AIStreamKit 1.0.0
69
69
  * @platform iOS Android
70
70
  */
71
71
  export function isConnectedSync(params?: ConnectParams): {
72
72
  /**
73
- * 是否已连接
73
+ * Whether connected
74
74
  * @since AIStreamKit 1.0.0
75
75
  */
76
76
  connected: boolean
77
77
  /**
78
- * 通道连接状态: 0-初始化,1-连接中,2-鉴权中,3-已连接,4-被云端断开,5-主动关闭
78
+ * Channel connection state: 0-initialized, 1-connecting, 2-authenticating, 3-connected, 4-disconnected by cloud, 5-actively closed
79
79
  * @since AIStreamKit 1.0.0
80
80
  */
81
81
  state: number
82
82
  /**
83
- * client 类型: 1-作为设备代理, 2-作为 App,3-作为开发者
83
+ * Client type: 1-device proxy, 2-App, 3-developer
84
84
  * @since AIStreamKit 1.0.0
85
85
  */
86
86
  clientType?: number
87
87
  /**
88
- * 连接的唯一标识
88
+ * Unique connection identifier
89
89
  * @since AIStreamKit 1.0.0
90
90
  */
91
91
  connectionId?: string
92
92
  }
93
93
 
94
94
  /**
95
- * 发起通道连接,若此前已连接会直接回调成功
95
+ * Initiate channel connection, will callback success directly if already connected
96
96
  * @public
97
97
  * @since AIStreamKit 1.0.0
98
98
  * @platform iOS Android
99
99
  */
100
100
  export function connect(params: {
101
101
  /**
102
- * client 类型: 1-作为设备代理, 2-作为 App,3-作为开发者
102
+ * Client type: 1-device proxy, 2-App, 3-developer
103
103
  * @since AIStreamKit 1.0.0
104
104
  */
105
105
  clientType: number
106
106
  /**
107
- * 代理的设备ID, clientType == 1 时必传
107
+ * Proxy device ID, required when clientType == 1
108
108
  * @since AIStreamKit 1.0.0
109
109
  */
110
110
  deviceId?: string
@@ -113,7 +113,7 @@ declare namespace ty.aistream {
113
113
  /** 接口调用成功的回调函数 */
114
114
  success?: (params: {
115
115
  /**
116
- * 连接的唯一标识
116
+ * Unique connection identifier
117
117
  * @since AIStreamKit 1.0.0
118
118
  */
119
119
  connectionId: string
@@ -135,34 +135,34 @@ declare namespace ty.aistream {
135
135
  }): void
136
136
 
137
137
  /**
138
- * 查询智能体 token,传递给 createSession
138
+ * Query agent token, pass to createSession
139
139
  * @public
140
140
  * @since AIStreamKit 1.0.0
141
141
  * @platform iOS Android
142
142
  */
143
143
  export function queryAgentToken(params: {
144
144
  /**
145
- * Owner ID: HomeIDclientType = 3 时可以为空
145
+ * Owner ID: HomeID, can be empty when clientType = 3
146
146
  * @since AIStreamKit 1.0.0
147
147
  */
148
148
  ownerId?: string
149
149
  /**
150
- * 智能解决方案 code
150
+ * Smart solution code
151
151
  * @since AIStreamKit 1.0.0
152
152
  */
153
153
  solutionCode: string
154
154
  /**
155
- * 业务接口
155
+ * Business API
156
156
  * @since AIStreamKit 1.0.0
157
157
  */
158
158
  api: string
159
159
  /**
160
- * 业务接口版本,clientType = 3 时可以为空
160
+ * Business API version, can be empty when clientType = 3
161
161
  * @since AIStreamKit 1.0.0
162
162
  */
163
163
  apiVersion?: string
164
164
  /**
165
- * 业务额外参数
165
+ * Business extra params
166
166
  * @since AIStreamKit 1.0.0
167
167
  */
168
168
  extParams: Record<string, string>
@@ -171,17 +171,17 @@ declare namespace ty.aistream {
171
171
  /** 接口调用成功的回调函数 */
172
172
  success?: (params: {
173
173
  /**
174
- * 智能体 token
174
+ * Agent token
175
175
  * @since AIStreamKit 1.0.0
176
176
  */
177
177
  agentToken: string
178
178
  /**
179
- * 业务配置
179
+ * Business config
180
180
  * @since AIStreamKit 1.0.0
181
181
  */
182
182
  bizConfig: BizConfig
183
183
  /**
184
- * 业务额外参数, 内容为 JSON String
184
+ * Business extra params, content is JSON String
185
185
  * @since AIStreamKit 1.3.3
186
186
  */
187
187
  extParams: string
@@ -203,46 +203,46 @@ declare namespace ty.aistream {
203
203
  }): void
204
204
 
205
205
  /**
206
- * 创建会话
206
+ * Create session
207
207
  * @public
208
208
  * @since AIStreamKit 1.0.0
209
209
  * @platform iOS Android
210
210
  */
211
211
  export function createSession(params: {
212
212
  /**
213
- * 业务 tag
213
+ * Business scene tag, default 0 indicates a general scene; specific values are defined by the business
214
214
  * @since AIStreamKit 1.0.0
215
215
  * @defaultValue 0
216
216
  */
217
217
  bizTag?: number
218
218
  /**
219
- * 智能体 token
219
+ * Agent token
220
220
  * @since AIStreamKit 1.0.0
221
221
  */
222
222
  agentToken: string
223
223
  /**
224
- * 会话 id. 不传递则自动生成,传递则使用传递的
224
+ * Session id. Auto-generated if not provided, otherwise uses provided value
225
225
  * @since AIStreamKit 1.0.0
226
226
  */
227
227
  sessionId?: string
228
228
  /**
229
- * 业务配置定义(通过 queryAgentToken 传递)
229
+ * Business config definition (passed via queryAgentToken)
230
230
  * @since AIStreamKit 1.0.0
231
231
  */
232
232
  bizConfig: BizConfig
233
233
  /**
234
- * 扩展属性。已废弃,请使用 userDataJson
234
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
235
235
  * @since AIStreamKit 1.0.0
236
236
  */
237
237
  userData?: Attribute[]
238
238
  /**
239
- * 扩展属性
239
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
240
240
  * @since AIStreamKit 2.0.0
241
241
  */
242
242
  userDataJson?: string
243
243
  /**
244
- * 是否复用数据通道,默认 不复用
245
- * 通道复用概念:多个 Session 可复用同一份数据,例如:有两个 Session,一个做转写,一个做翻译,同时共用同一份音频流数据处理
244
+ * Whether to reuse data channel, default is no reuse.
245
+ * Data channel reuse: multiple Sessions can reuse the same data, e.g. two Sessions, one for transcription and one for translation, sharing the same audio stream
246
246
  * @since AIStreamKit 1.0.0
247
247
  */
248
248
  reuseDataChannel?: boolean
@@ -251,23 +251,28 @@ declare namespace ty.aistream {
251
251
  /** 接口调用成功的回调函数 */
252
252
  success?: (params: {
253
253
  /**
254
- * 会话 id
254
+ * Session id
255
255
  * @since AIStreamKit 1.0.0
256
256
  */
257
257
  sessionId: string
258
258
  /**
259
- * 下发数据通道 DataChannel. (下发数据时,需要使用该列表中的 DataChannel)
260
- * 音频视频图片文件都只有一路时,例如 bizCode 65537 ["audio", "video", "text", "image"]
261
- * 有多路重复时,例如 双路音视频:["audio", "audio_1", "video", "video_1", "text", "image"]
259
+ * Send data channel DataChannel. (Use DataChannel from this list when sending data)
260
+ * When audio/video/image/file has single channel, e.g. bizCode 65537: ["audio", "video", "text", "image"]
261
+ * When there are multiple duplicate channels, e.g. dual audio/video: ["audio", "audio_1", "video", "video_1", "text", "image"]
262
262
  * @since AIStreamKit 1.0.0
263
263
  */
264
264
  sendDataChannels: string[]
265
265
  /**
266
- * 接收数据通道 DataChannel. (接收数据时,数据中会使用该列表中的 DataChannel 进行上报)
267
- * 接受通道不会复用,例如:文本、音频 ["text", "audio"]
266
+ * Receive data channel DataChannel. (Data will be reported using DataChannel from this list)
267
+ * Receive channels are not reused, e.g. text and audio: ["text", "audio"]
268
268
  * @since AIStreamKit 1.0.0
269
269
  */
270
270
  revDataChannels: string[]
271
+ /**
272
+ * Base cache directory
273
+ * @since AIStreamKit 2.2.5
274
+ */
275
+ baseCacheDir: string
271
276
  }) => void
272
277
  /** 接口调用失败的回调函数 */
273
278
  fail?: (params: {
@@ -286,26 +291,26 @@ declare namespace ty.aistream {
286
291
  }): void
287
292
 
288
293
  /**
289
- * 关闭会话
294
+ * Close session
290
295
  * @public
291
296
  * @since AIStreamKit 1.0.0
292
297
  * @platform iOS Android
293
298
  */
294
299
  export function closeSession(params: {
295
300
  /**
296
- * 会话 id
301
+ * Session id
297
302
  * @since AIStreamKit 1.0.0
298
303
  */
299
304
  sessionId: string
300
305
  /**
301
- * 关闭原因, 非异常则使用 200 来关闭
306
+ * Close reason, use 200 for normal close
302
307
  * @since AIStreamKit 1.0.0
303
308
  */
304
309
  code: number
305
310
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
306
311
  complete?: () => void
307
312
  /** 接口调用成功的回调函数 */
308
- success?: (params: null) => void
313
+ success?: () => void
309
314
  /** 接口调用失败的回调函数 */
310
315
  fail?: (params: {
311
316
  /** 错误信息 */
@@ -323,21 +328,21 @@ declare namespace ty.aistream {
323
328
  }): void
324
329
 
325
330
  /**
326
- * 关闭连接,主要针对作为设备代理的情况,以App身份使用时不需要调用
331
+ * Close connection, mainly for device proxy scenario, not needed when used as App identity
327
332
  * @public
328
333
  * @since AIStreamKit 1.0.0
329
334
  * @platform iOS Android
330
335
  */
331
336
  export function disconnect(params: {
332
337
  /**
333
- * 需要断连的 connection Id
338
+ * Connection Id to disconnect
334
339
  * @since AIStreamKit 1.0.0
335
340
  */
336
341
  connectionId: string
337
342
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
338
343
  complete?: () => void
339
344
  /** 接口调用成功的回调函数 */
340
- success?: (params: null) => void
345
+ success?: () => void
341
346
  /** 接口调用失败的回调函数 */
342
347
  fail?: (params: {
343
348
  /** 错误信息 */
@@ -355,31 +360,33 @@ declare namespace ty.aistream {
355
360
  }): void
356
361
 
357
362
  /**
358
- * 开始事件
363
+ * Start an AI stream event. Returns an eventId that must be reused for all subsequent
364
+ * sendEventPayloadEnd / sendEventEnd / sendEventChatBreak calls until a new sendEventStart
365
+ * is invoked to begin the next event.
359
366
  * @public
360
367
  * @since AIStreamKit 1.0.0
361
368
  * @platform iOS Android
362
369
  */
363
370
  export function sendEventStart(params: {
364
371
  /**
365
- * 会话 id
372
+ * Session id
366
373
  * @since AIStreamKit 1.0.0
367
374
  */
368
375
  sessionId: string
369
376
  /**
370
- * 扩展属性。已废弃,请使用 userDataJson
377
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
371
378
  * @since AIStreamKit 1.0.0
372
379
  */
373
380
  userData?: Attribute[]
374
381
  /**
375
- * 扩展属性
382
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
376
383
  * @since AIStreamKit 2.0.0
377
384
  */
378
385
  userDataJson?: string
379
386
  /**
380
- * Event ID 前缀。(可选)
381
- * 传递则格式为: "$prefix_event_$sessionId.sub(8)_$timestamp"
382
- * 不传递格式为: "ios_event_$sessionId.sub(8)_$timestamp""Android_Event_$sessionId.sub(8)_$timestamp"
387
+ * Event ID prefix. (Optional)
388
+ * If provided, format: "$prefix_event_$sessionId.sub(8)_$timestamp"
389
+ * If not provided, format: "ios_event_$sessionId.sub(8)_$timestamp" or "Android_Event_$sessionId.sub(8)_$timestamp"
383
390
  * @since AIStreamKit 1.3.2
384
391
  */
385
392
  eventIdPrefix?: string
@@ -388,7 +395,7 @@ declare namespace ty.aistream {
388
395
  /** 接口调用成功的回调函数 */
389
396
  success?: (params: {
390
397
  /**
391
- * 事件 id。此后 sendEventPayloadEndsendEventEndsendEventChatBreak 都需要使用该 eventId 直到下发一次 sendEventStart 生成新 eventId 之前。
398
+ * Event id. After this, sendEventPayloadEnd, sendEventEnd, sendEventChatBreak must use this eventId until a new sendEventStart generates a new eventId.
392
399
  * @since AIStreamKit 1.0.0
393
400
  */
394
401
  eventId: string
@@ -410,41 +417,41 @@ declare namespace ty.aistream {
410
417
  }): void
411
418
 
412
419
  /**
413
- * 某个数据流传输结束事件(新版本已经废弃,现内部实现为永远callback success,所有数据传递完毕后,直接使用 sendEventEnd 结束即可)
420
+ * Data stream transfer end event (deprecated in new version, internal implementation always callbacks success, use sendEventEnd directly after all data transfer is complete)
414
421
  * @public
415
422
  * @since AIStreamKit 1.0.0
416
423
  * @platform iOS Android
417
424
  */
418
425
  export function sendEventPayloadEnd(params: {
419
426
  /**
420
- * 事件 id
427
+ * Event id
421
428
  * @since AIStreamKit 1.0.0
422
429
  */
423
430
  eventId: string
424
431
  /**
425
- * 会话 id
432
+ * Session id
426
433
  * @since AIStreamKit 1.0.0
427
434
  */
428
435
  sessionId: string
429
436
  /**
430
- * 发送结束的数据通道
437
+ * Data channel to end sending
431
438
  * @since AIStreamKit 1.0.0
432
439
  */
433
440
  dataChannel: string
434
441
  /**
435
- * 扩展属性。已废弃,请使用 userDataJson
442
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
436
443
  * @since AIStreamKit 1.0.0
437
444
  */
438
445
  userData?: Attribute[]
439
446
  /**
440
- * 扩展属性
447
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
441
448
  * @since AIStreamKit 2.0.0
442
449
  */
443
450
  userDataJson?: string
444
451
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
445
452
  complete?: () => void
446
453
  /** 接口调用成功的回调函数 */
447
- success?: (params: null) => void
454
+ success?: () => void
448
455
  /** 接口调用失败的回调函数 */
449
456
  fail?: (params: {
450
457
  /** 错误信息 */
@@ -462,36 +469,37 @@ declare namespace ty.aistream {
462
469
  }): void
463
470
 
464
471
  /**
465
- * 结束事件
472
+ * End the current AI stream event. The supplied eventId is invalidated after this call;
473
+ * a new sendEventStart must be invoked to obtain a fresh eventId for the next event.
466
474
  * @public
467
475
  * @since AIStreamKit 1.0.0
468
476
  * @platform iOS Android
469
477
  */
470
478
  export function sendEventEnd(params: {
471
479
  /**
472
- * 事件 id
480
+ * Event id
473
481
  * @since AIStreamKit 1.0.0
474
482
  */
475
483
  eventId: string
476
484
  /**
477
- * 会话 id
485
+ * Session id
478
486
  * @since AIStreamKit 1.0.0
479
487
  */
480
488
  sessionId: string
481
489
  /**
482
- * 扩展属性。已废弃,请使用 userDataJson
490
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
483
491
  * @since AIStreamKit 1.0.0
484
492
  */
485
493
  userData?: Attribute[]
486
494
  /**
487
- * 扩展属性
495
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
488
496
  * @since AIStreamKit 2.0.0
489
497
  */
490
498
  userDataJson?: string
491
499
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
492
500
  complete?: () => void
493
501
  /** 接口调用成功的回调函数 */
494
- success?: (params: null) => void
502
+ success?: () => void
495
503
  /** 接口调用失败的回调函数 */
496
504
  fail?: (params: {
497
505
  /** 错误信息 */
@@ -509,36 +517,36 @@ declare namespace ty.aistream {
509
517
  }): void
510
518
 
511
519
  /**
512
- * 打断事件。用于:1. 中止自己的发送,2. 中止接收云端的回复
520
+ * Interrupt event. Used for: 1. abort own sending, 2. abort receiving cloud reply
513
521
  * @public
514
522
  * @since AIStreamKit 1.0.0
515
523
  * @platform iOS Android
516
524
  */
517
525
  export function sendEventChatBreak(params: {
518
526
  /**
519
- * 事件 id
527
+ * Event id
520
528
  * @since AIStreamKit 1.0.0
521
529
  */
522
530
  eventId: string
523
531
  /**
524
- * 会话 id
532
+ * Session id
525
533
  * @since AIStreamKit 1.0.0
526
534
  */
527
535
  sessionId: string
528
536
  /**
529
- * 扩展属性。已废弃,请使用 userDataJson
537
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
530
538
  * @since AIStreamKit 1.0.0
531
539
  */
532
540
  userData?: Attribute[]
533
541
  /**
534
- * 扩展属性
542
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
535
543
  * @since AIStreamKit 2.0.0
536
544
  */
537
545
  userDataJson?: string
538
546
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
539
547
  complete?: () => void
540
548
  /** 接口调用成功的回调函数 */
541
- success?: (params: null) => void
549
+ success?: () => void
542
550
  /** 接口调用失败的回调函数 */
543
551
  fail?: (params: {
544
552
  /** 错误信息 */
@@ -556,16 +564,84 @@ declare namespace ty.aistream {
556
564
  }): void
557
565
 
558
566
  /**
559
- * 初始化录制音频,默认配置: SampleRate=16000Hz, Channel=单声道, bitDepth=16位深, codec=PCM 编码。
560
- * 目前仅能定义 SampleRate采样率
567
+ * Send generic event (e.g. MCP response). Builds a StreamEvent with the given eventType and optional payload/userData, then sends it via the channel.
568
+ * @public
569
+ * @since AIStreamKit 2.2.0
570
+ * @platform iOS Android
571
+ */
572
+ export function sendEvent(params: {
573
+ /**
574
+ * Session id
575
+ * @since AIStreamKit 2.2.0
576
+ */
577
+ sessionId: string
578
+ /**
579
+ * Event id
580
+ * @since AIStreamKit 2.2.0
581
+ */
582
+ eventId: string
583
+ /**
584
+ * Event type
585
+ * - 0: Event Start
586
+ * - 1: Event Payload End
587
+ * - 2: Event End
588
+ * - 3: OneShot
589
+ * - 4: Chat Break
590
+ * - 5: Server VAD
591
+ * - 1000: MCP CMD
592
+ * - 1001: Server timeout
593
+ * - 1002: Update Context
594
+ * - 1003: Event trigger
595
+ * - 1004: Event sleep
596
+ * @since AIStreamKit 2.2.0
597
+ */
598
+ eventType: number
599
+ /**
600
+ * Payload string (will be converted to byte[] internally). Used for MCP responses etc.
601
+ * @since AIStreamKit 2.2.0
602
+ */
603
+ payload?: string
604
+ /**
605
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
606
+ * @since AIStreamKit 2.2.0
607
+ */
608
+ userData?: Attribute[]
609
+ /**
610
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
611
+ * @since AIStreamKit 2.2.0
612
+ */
613
+ userDataJson?: string
614
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
615
+ complete?: () => void
616
+ /** 接口调用成功的回调函数 */
617
+ success?: () => void
618
+ /** 接口调用失败的回调函数 */
619
+ fail?: (params: {
620
+ /** 错误信息 */
621
+ errorMsg: string
622
+ /** 错误码 */
623
+ errorCode: string | number
624
+ /** 错误扩展 */
625
+ innerError: {
626
+ /** 错误扩展码 */
627
+ errorCode: string | number
628
+ /** 错误扩展信息 */
629
+ errorMsg: string
630
+ }
631
+ }) => void
632
+ }): void
633
+
634
+ /**
635
+ * Initialize audio recorder, default config: SampleRate=16000Hz, Channel=mono, bitDepth=16bit, codec=PCM.
636
+ * Currently only SampleRate can be customized
561
637
  * @public
562
638
  * @since AIStreamKit 1.0.0
563
639
  * @platform iOS Android
564
640
  */
565
641
  export function initAudioRecorder(params?: {
566
642
  /**
567
- * 音频采样率,单位Hz, 默认 16000 Hz
568
- * 表示每秒采样次数,常见值:8000, 16000, 22050, 24000, 44100
643
+ * Audio sample rate in Hz, default 16000 Hz
644
+ * Number of samples per second, common values: 8000, 16000, 22050, 24000, 44100, etc.
569
645
  * @since AIStreamKit 1.1.0
570
646
  * @defaultValue 16000
571
647
  */
@@ -573,7 +649,7 @@ declare namespace ty.aistream {
573
649
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
574
650
  complete?: () => void
575
651
  /** 接口调用成功的回调函数 */
576
- success?: (params: null) => void
652
+ success?: () => void
577
653
  /** 接口调用失败的回调函数 */
578
654
  fail?: (params: {
579
655
  /** 错误信息 */
@@ -591,51 +667,51 @@ declare namespace ty.aistream {
591
667
  }): void
592
668
 
593
669
  /**
594
- * 开始录制并发送音频数据
595
- * 注意:初始化会有 300 ~ 600ms 的初始化耗时,此时说话无法采集,建议前置调用 `initAudioRecorder` 初始化音频参数
670
+ * Start recording and sending audio data
671
+ * Note: initialization takes 300 ~ 600ms, speech cannot be captured during this time, it is recommended to call `initAudioRecorder` in advance
596
672
  * @public
597
673
  * @since AIStreamKit 1.0.0
598
674
  * @platform iOS Android
599
675
  */
600
676
  export function startRecordAndSendAudioData(params: {
601
677
  /**
602
- * 会话 id
678
+ * Session id
603
679
  * @since AIStreamKit 1.0.0
604
680
  */
605
681
  sessionId: string
606
682
  /**
607
- * 下发数据通道 Code,当音频只有单路的时候,可以不传
683
+ * Send data channel code, optional when audio has only single channel
608
684
  * @since AIStreamKit 1.0.0
609
685
  */
610
686
  dataChannel?: string
611
687
  /**
612
- * 扩展属性。已废弃,请使用 userDataJson
688
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
613
689
  * @since AIStreamKit 1.0.0
614
690
  */
615
691
  userData?: Attribute[]
616
692
  /**
617
- * 是否需要保存录制的音频文件,仅单次录音周期生效。默认: false 不保存
693
+ * Whether to save recorded audio file, effective for single recording cycle only. Default: false
618
694
  * @since AIStreamKit 1.1.0
619
695
  * @defaultValue false
620
696
  */
621
697
  saveFile?: boolean
622
698
  /**
623
- * 录音初始化参数(若使用 initAudioRecorder 提前初始化过,可以不传)
624
- * 1. 不传递,则使用最后一次调用 `initAudioRecorder` 的值,从未调用过则会使用默认配置 16000Hz、单声道、16bit位深进行初始化。
625
- * 2. 当传递的参数与上一次不一致时,则会重新初始化。
626
- * 3. 初始化会有 300 ~ 600ms 的初始化耗时,此时说话无法采集,通常会丢 2 ~ 4 个汉字的音频,建议合适的时机提前调用 `initAudioRecorder` 完成初始化。
699
+ * Recording init params (optional if already initialized via initAudioRecorder)
700
+ * 1. If not provided, uses the value from last `initAudioRecorder` call; if never called, uses default config 16000Hz, mono, 16bit.
701
+ * 2. If provided params differ from previous, will re-initialize.
702
+ * 3. Initialization takes 300 ~ 600ms, speech cannot be captured during this time, it is recommended to call `initAudioRecorder` in advance.
627
703
  * @since AIStreamKit 1.1.0
628
704
  */
629
705
  recordInitParams?: RecordInitParams
630
706
  /**
631
- * 扩展属性
707
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
632
708
  * @since AIStreamKit 2.0.0
633
709
  */
634
710
  userDataJson?: string
635
711
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
636
712
  complete?: () => void
637
713
  /** 接口调用成功的回调函数 */
638
- success?: (params: null) => void
714
+ success?: () => void
639
715
  /** 接口调用失败的回调函数 */
640
716
  fail?: (params: {
641
717
  /** 错误信息 */
@@ -653,43 +729,43 @@ declare namespace ty.aistream {
653
729
  }): void
654
730
 
655
731
  /**
656
- * 结束录制并发送音频数据
732
+ * Stop recording and sending audio data
657
733
  * @public
658
734
  * @since AIStreamKit 1.0.0
659
735
  * @platform iOS Android
660
736
  */
661
737
  export function stopRecordAndSendAudioData(params: {
662
738
  /**
663
- * 会话 id
739
+ * Session id
664
740
  * @since AIStreamKit 1.0.0
665
741
  */
666
742
  sessionId: string
667
743
  /**
668
- * 下发数据通道 Code,当音频只有单路的时候,可以不传
744
+ * Send data channel code, optional when audio has only single channel
669
745
  * @since AIStreamKit 1.0.0
670
746
  */
671
747
  dataChannel?: string
672
748
  /**
673
- * 扩展属性。已废弃,请使用 userDataJson
749
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
674
750
  * @since AIStreamKit 1.0.0
675
751
  */
676
752
  userData?: Attribute[]
677
753
  /**
678
- * 是否需要保存录制的音频文件,仅单次录音周期生效。默认: false 不保存
754
+ * Whether to save recorded audio file, effective for single recording cycle only. Default: false
679
755
  * @since AIStreamKit 1.1.0
680
756
  * @defaultValue false
681
757
  */
682
758
  saveFile?: boolean
683
759
  /**
684
- * 录音初始化参数(若使用 initAudioRecorder 提前初始化过,可以不传)
685
- * 1. 不传递,则使用最后一次调用 `initAudioRecorder` 的值,从未调用过则会使用默认配置 16000Hz、单声道、16bit位深进行初始化。
686
- * 2. 当传递的参数与上一次不一致时,则会重新初始化。
687
- * 3. 初始化会有 300 ~ 600ms 的初始化耗时,此时说话无法采集,通常会丢 2 ~ 4 个汉字的音频,建议合适的时机提前调用 `initAudioRecorder` 完成初始化。
760
+ * Recording init params (optional if already initialized via initAudioRecorder)
761
+ * 1. If not provided, uses the value from last `initAudioRecorder` call; if never called, uses default config 16000Hz, mono, 16bit.
762
+ * 2. If provided params differ from previous, will re-initialize.
763
+ * 3. Initialization takes 300 ~ 600ms, speech cannot be captured during this time, it is recommended to call `initAudioRecorder` in advance.
688
764
  * @since AIStreamKit 1.1.0
689
765
  */
690
766
  recordInitParams?: RecordInitParams
691
767
  /**
692
- * 扩展属性
768
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
693
769
  * @since AIStreamKit 2.0.0
694
770
  */
695
771
  userDataJson?: string
@@ -698,32 +774,32 @@ declare namespace ty.aistream {
698
774
  /** 接口调用成功的回调函数 */
699
775
  success?: (params: {
700
776
  /**
701
- * 录音保存的文件路径,注意需要在 `startRecordAndSendAudioData` 中传递 `saveFile` true 时才会有值
777
+ * Saved audio file path, only has value when `saveFile` is set to true in `startRecordAndSendAudioData`
702
778
  * @since AIStreamKit 1.1.0
703
779
  */
704
780
  path?: string
705
781
  /**
706
- * 音频编码类型,表示音频数据的编码格式。目前仅保存为 WAV(PCM) 文件
707
- * - 1000: WAV(PCM) App本地定义
782
+ * Audio codec type. Currently only saves as WAV(PCM) file
783
+ * - 1000: WAV(PCM) App local definition
708
784
  * @since AIStreamKit 1.1.0
709
785
  */
710
786
  codecType: number
711
787
  /**
712
- * 音频采样率,单位Hz
713
- * 表示每秒采样次数,常见值:8000, 16000, 22050, 24000, 44100
788
+ * Audio sample rate in Hz
789
+ * Number of samples per second, common values: 8000, 16000, 22050, 24000, 44100, etc.
714
790
  * @since AIStreamKit 1.1.0
715
791
  */
716
792
  sampleRate: number
717
793
  /**
718
- * 音频通道数
719
- * - 0: 单声道
720
- * - 1: 立体声
794
+ * Audio channels (AIStreamKit < 2.0: mono=0, stereo=1), since >= 2.0 unified across platforms: 1-mono, 2-stereo
795
+ * - 1: mono
796
+ * - 2: stereo
721
797
  * @since AIStreamKit 1.1.0
722
798
  */
723
799
  channels: number
724
800
  /**
725
- * 音频位深,表示每个采样点的位数
726
- * 常见值:8, 16, 24, 32
801
+ * Audio bit depth, bits per sample
802
+ * Common values: 8, 16, 24, 32, etc.
727
803
  * @since AIStreamKit 1.1.0
728
804
  */
729
805
  bitDepth: number
@@ -745,46 +821,46 @@ declare namespace ty.aistream {
745
821
  }): void
746
822
 
747
823
  /**
748
- * 发送图片数据
824
+ * Send image data
749
825
  * @public
750
826
  * @since AIStreamKit 1.0.0
751
827
  * @platform iOS Android
752
828
  */
753
829
  export function sendImageData(params: {
754
830
  /**
755
- * 会话 id
831
+ * Session id
756
832
  * @since AIStreamKit 1.0.0
757
833
  */
758
834
  sessionId: string
759
835
  /**
760
- * 下发数据通道 Code,当音频只有单路的时候,可以不传
836
+ * Send data channel code, optional when audio has only single channel
761
837
  * @since AIStreamKit 1.0.0
762
838
  */
763
839
  dataChannel?: string
764
840
  /**
765
- * 图片路径
841
+ * Image path
766
842
  * @since AIStreamKit 1.0.0
767
843
  */
768
844
  path: string
769
845
  /**
770
- * 图片类型: 1-JPEG, 2-PNG
846
+ * Image format: 1-JPEG, 2-PNG
771
847
  * @since AIStreamKit 1.0.0
772
848
  */
773
849
  format: number
774
850
  /**
775
- * 扩展属性。已废弃,请使用 userDataJson
851
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
776
852
  * @since AIStreamKit 1.0.0
777
853
  */
778
854
  userData?: Attribute[]
779
855
  /**
780
- * 扩展属性
856
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
781
857
  * @since AIStreamKit 2.0.0
782
858
  */
783
859
  userDataJson?: string
784
860
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
785
861
  complete?: () => void
786
862
  /** 接口调用成功的回调函数 */
787
- success?: (params: null) => void
863
+ success?: () => void
788
864
  /** 接口调用失败的回调函数 */
789
865
  fail?: (params: {
790
866
  /** 错误信息 */
@@ -802,41 +878,41 @@ declare namespace ty.aistream {
802
878
  }): void
803
879
 
804
880
  /**
805
- * 发送文本数据
881
+ * Send text data
806
882
  * @public
807
883
  * @since AIStreamKit 1.0.0
808
884
  * @platform iOS Android
809
885
  */
810
886
  export function sendTextData(params: {
811
887
  /**
812
- * 会话 id
888
+ * Session id
813
889
  * @since AIStreamKit 1.0.0
814
890
  */
815
891
  sessionId: string
816
892
  /**
817
- * 下发数据通道 Code,当音频只有单路的时候,可以不传
893
+ * Send data channel code, optional when audio has only single channel
818
894
  * @since AIStreamKit 1.0.0
819
895
  */
820
896
  dataChannel?: string
821
897
  /**
822
- * 文本内容
898
+ * Text content
823
899
  * @since AIStreamKit 1.0.0
824
900
  */
825
901
  text: string
826
902
  /**
827
- * 扩展属性。已废弃,请使用 userDataJson
903
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
828
904
  * @since AIStreamKit 1.0.0
829
905
  */
830
906
  userData?: Attribute[]
831
907
  /**
832
- * 扩展属性
908
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
833
909
  * @since AIStreamKit 2.0.0
834
910
  */
835
911
  userDataJson?: string
836
912
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
837
913
  complete?: () => void
838
914
  /** 接口调用成功的回调函数 */
839
- success?: (params: null) => void
915
+ success?: () => void
840
916
  /** 接口调用失败的回调函数 */
841
917
  fail?: (params: {
842
918
  /** 错误信息 */
@@ -854,71 +930,71 @@ declare namespace ty.aistream {
854
930
  }): void
855
931
 
856
932
  /**
857
- * 批量查询记录
933
+ * Batch query records
858
934
  * @public
859
935
  * @since AIStreamKit 1.0.0
860
936
  * @platform iOS Android
861
937
  */
862
938
  export function queryRecordList(params?: {
863
939
  /**
864
- * 自增ID
940
+ * Auto-increment ID
865
941
  * @since AIStreamKit 1.0.0
866
942
  */
867
943
  id?: number[]
868
944
  /**
869
- * biz Code 大类目,可搜索
945
+ * Biz code category, searchable
870
946
  * @since AIStreamKit 1.0.0
871
947
  */
872
948
  bizCode?: number[]
873
949
  /**
874
- * 智能解决方案 code, 可搜索
950
+ * Smart solution code, searchable
875
951
  * @since AIStreamKit 1.0.0
876
952
  */
877
953
  solutionCode?: string[]
878
954
  /**
879
- * 设备 id,可搜索
955
+ * Device id, searchable
880
956
  * @since AIStreamKit 1.0.0
881
957
  */
882
958
  devId?: string[]
883
959
  /**
884
- * 家庭 id, 可搜索
960
+ * Home id, searchable
885
961
  * @since AIStreamKit 1.0.0
886
962
  */
887
963
  homeId?: number[]
888
964
  /**
889
- * type, 业务自行决定,可搜索
965
+ * Type, defined by business, searchable
890
966
  * @since AIStreamKit 1.0.0
891
967
  */
892
968
  type?: string[]
893
969
  /**
894
- * 索引, 业务自行决定,可搜索
970
+ * Index, defined by business, searchable
895
971
  * @since AIStreamKit 1.0.0
896
972
  */
897
973
  index?: string[]
898
974
  /**
899
- * 扩展索引1, 业务自行决定,可搜索
975
+ * Extended index 1, defined by business, searchable
900
976
  * @since AIStreamKit 1.0.0
901
977
  */
902
978
  index1?: string[]
903
979
  /**
904
- * 扩展索引2, 业务自行决定,可搜索
980
+ * Extended index 2, defined by business, searchable
905
981
  * @since AIStreamKit 1.0.0
906
982
  */
907
983
  index2?: string[]
908
984
  /**
909
- * offset 分页偏移量(删除时无需传递)
985
+ * Pagination offset (not needed for deletion)
910
986
  * @since AIStreamKit 1.0.0
911
987
  */
912
988
  offset?: number
913
989
  /**
914
- * limit 分页大小, 不传或传0则不分页(删除时无需传递)
990
+ * Pagination size, no pagination if not provided or 0 (not needed for deletion)
915
991
  * @since AIStreamKit 1.0.0
916
992
  */
917
993
  limit?: number
918
994
  /**
919
- * 排序方式,仅用于 `queryRecordList`
920
- * - 0: id 降序(默认)
921
- * - 1: id 升序
995
+ * Sort type, only for `queryRecordList`
996
+ * - 0: descending by id (default)
997
+ * - 1: ascending by id
922
998
  * @since AIStreamKit 1.0.0
923
999
  */
924
1000
  sortType?: number
@@ -927,12 +1003,12 @@ declare namespace ty.aistream {
927
1003
  /** 接口调用成功的回调函数 */
928
1004
  success?: (params: {
929
1005
  /**
930
- * 记录列表
1006
+ * Record list
931
1007
  * @since AIStreamKit 1.0.0
932
1008
  */
933
1009
  records: RecordBody[]
934
1010
  /**
935
- * 记录总数
1011
+ * Total record count
936
1012
  * @since AIStreamKit 1.0.0
937
1013
  */
938
1014
  total: number
@@ -954,78 +1030,78 @@ declare namespace ty.aistream {
954
1030
  }): void
955
1031
 
956
1032
  /**
957
- * 批量删除记录
1033
+ * Batch delete records
958
1034
  * @public
959
1035
  * @since AIStreamKit 1.0.0
960
1036
  * @platform iOS Android
961
1037
  */
962
1038
  export function deleteRecordList(params?: {
963
1039
  /**
964
- * 自增ID
1040
+ * Auto-increment ID
965
1041
  * @since AIStreamKit 1.0.0
966
1042
  */
967
1043
  id?: number[]
968
1044
  /**
969
- * biz Code 大类目,可搜索
1045
+ * Biz code category, searchable
970
1046
  * @since AIStreamKit 1.0.0
971
1047
  */
972
1048
  bizCode?: number[]
973
1049
  /**
974
- * 智能解决方案 code, 可搜索
1050
+ * Smart solution code, searchable
975
1051
  * @since AIStreamKit 1.0.0
976
1052
  */
977
1053
  solutionCode?: string[]
978
1054
  /**
979
- * 设备 id,可搜索
1055
+ * Device id, searchable
980
1056
  * @since AIStreamKit 1.0.0
981
1057
  */
982
1058
  devId?: string[]
983
1059
  /**
984
- * 家庭 id, 可搜索
1060
+ * Home id, searchable
985
1061
  * @since AIStreamKit 1.0.0
986
1062
  */
987
1063
  homeId?: number[]
988
1064
  /**
989
- * type, 业务自行决定,可搜索
1065
+ * Type, defined by business, searchable
990
1066
  * @since AIStreamKit 1.0.0
991
1067
  */
992
1068
  type?: string[]
993
1069
  /**
994
- * 索引, 业务自行决定,可搜索
1070
+ * Index, defined by business, searchable
995
1071
  * @since AIStreamKit 1.0.0
996
1072
  */
997
1073
  index?: string[]
998
1074
  /**
999
- * 扩展索引1, 业务自行决定,可搜索
1075
+ * Extended index 1, defined by business, searchable
1000
1076
  * @since AIStreamKit 1.0.0
1001
1077
  */
1002
1078
  index1?: string[]
1003
1079
  /**
1004
- * 扩展索引2, 业务自行决定,可搜索
1080
+ * Extended index 2, defined by business, searchable
1005
1081
  * @since AIStreamKit 1.0.0
1006
1082
  */
1007
1083
  index2?: string[]
1008
1084
  /**
1009
- * offset 分页偏移量(删除时无需传递)
1085
+ * Pagination offset (not needed for deletion)
1010
1086
  * @since AIStreamKit 1.0.0
1011
1087
  */
1012
1088
  offset?: number
1013
1089
  /**
1014
- * limit 分页大小, 不传或传0则不分页(删除时无需传递)
1090
+ * Pagination size, no pagination if not provided or 0 (not needed for deletion)
1015
1091
  * @since AIStreamKit 1.0.0
1016
1092
  */
1017
1093
  limit?: number
1018
1094
  /**
1019
- * 排序方式,仅用于 `queryRecordList`
1020
- * - 0: id 降序(默认)
1021
- * - 1: id 升序
1095
+ * Sort type, only for `queryRecordList`
1096
+ * - 0: descending by id (default)
1097
+ * - 1: ascending by id
1022
1098
  * @since AIStreamKit 1.0.0
1023
1099
  */
1024
1100
  sortType?: number
1025
1101
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1026
1102
  complete?: () => void
1027
1103
  /** 接口调用成功的回调函数 */
1028
- success?: (params: null) => void
1104
+ success?: () => void
1029
1105
  /** 接口调用失败的回调函数 */
1030
1106
  fail?: (params: {
1031
1107
  /** 错误信息 */
@@ -1043,81 +1119,81 @@ declare namespace ty.aistream {
1043
1119
  }): void
1044
1120
 
1045
1121
  /**
1046
- * 更新单条记录
1122
+ * Update single record
1047
1123
  * @public
1048
1124
  * @since AIStreamKit 1.0.0
1049
1125
  * @platform iOS Android
1050
1126
  */
1051
1127
  export function updateRecord(params?: {
1052
1128
  /**
1053
- * 记录ID, 自增. (insertRecord 不传, updateRecord 必传, 作为 Response 返回时必有值)
1129
+ * Record ID, auto-increment. (Not required for insertRecord, required for updateRecord, always present in Response)
1054
1130
  * @since AIStreamKit 1.0.0
1055
1131
  */
1056
1132
  id?: number
1057
1133
  /**
1058
- * biz Code 大类目,可搜索
1134
+ * Biz code category, searchable
1059
1135
  * @since AIStreamKit 1.0.0
1060
1136
  */
1061
1137
  bizCode?: number
1062
1138
  /**
1063
- * 智能解决方案 code, 可搜索
1139
+ * Smart solution code, searchable
1064
1140
  * @since AIStreamKit 1.0.0
1065
1141
  */
1066
1142
  solutionCode?: string
1067
1143
  /**
1068
- * 设备 id,可搜索
1144
+ * Device id, searchable
1069
1145
  * @since AIStreamKit 1.0.0
1070
1146
  */
1071
1147
  devId?: string
1072
1148
  /**
1073
- * 家庭 id, 可搜索
1149
+ * Home id, searchable
1074
1150
  * @since AIStreamKit 1.0.0
1075
1151
  */
1076
1152
  homeId?: number
1077
1153
  /**
1078
- * type, 业务自行决定,可搜索
1154
+ * Type, defined by business, searchable
1079
1155
  * @since AIStreamKit 1.0.0
1080
1156
  */
1081
1157
  type?: string
1082
1158
  /**
1083
- * 索引, 业务自行决定,可搜索
1159
+ * Index, defined by business, searchable
1084
1160
  * @since AIStreamKit 1.0.0
1085
1161
  */
1086
1162
  index?: string
1087
1163
  /**
1088
- * 扩展索引1, 业务自行决定,可搜索
1164
+ * Extended index 1, defined by business, searchable
1089
1165
  * @since AIStreamKit 1.0.0
1090
1166
  */
1091
1167
  index1?: string
1092
1168
  /**
1093
- * 扩展索引2, 业务自行决定,可搜索
1169
+ * Extended index 2, defined by business, searchable
1094
1170
  * @since AIStreamKit 1.0.0
1095
1171
  */
1096
1172
  index2?: string
1097
1173
  /**
1098
- * 缓存数据,JSON格式,不可搜索
1174
+ * Cache data, JSON format, not searchable
1099
1175
  * @since AIStreamKit 1.0.0
1100
1176
  */
1101
1177
  data?: string
1102
1178
  /**
1103
- * 值,不可搜索
1179
+ * Value, not searchable
1104
1180
  * @since AIStreamKit 1.0.0
1105
1181
  */
1106
1182
  value?: string
1107
1183
  /**
1108
- * 扩展值1,不可搜索
1184
+ * Extended value 1, not searchable
1109
1185
  * @since AIStreamKit 1.0.0
1110
1186
  */
1111
1187
  value1?: string
1112
1188
  /**
1113
- * 扩展值2,不可搜索
1189
+ * Extended value 2, not searchable
1114
1190
  * @since AIStreamKit 1.0.0
1115
1191
  */
1116
1192
  value2?: string
1117
1193
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1118
1194
  complete?: () => void
1119
1195
  /** 接口调用成功的回调函数 */
1120
- success?: (params: null) => void
1196
+ success?: () => void
1121
1197
  /** 接口调用失败的回调函数 */
1122
1198
  fail?: (params: {
1123
1199
  /** 错误信息 */
@@ -1135,74 +1211,74 @@ declare namespace ty.aistream {
1135
1211
  }): void
1136
1212
 
1137
1213
  /**
1138
- * 插入单条记录
1214
+ * Insert single record
1139
1215
  * @public
1140
1216
  * @since AIStreamKit 1.0.0
1141
1217
  * @platform iOS Android
1142
1218
  */
1143
1219
  export function insertRecord(params?: {
1144
1220
  /**
1145
- * 记录ID, 自增. (insertRecord 不传, updateRecord 必传, 作为 Response 返回时必有值)
1221
+ * Record ID, auto-increment. (Not required for insertRecord, required for updateRecord, always present in Response)
1146
1222
  * @since AIStreamKit 1.0.0
1147
1223
  */
1148
1224
  id?: number
1149
1225
  /**
1150
- * biz Code 大类目,可搜索
1226
+ * Biz code category, searchable
1151
1227
  * @since AIStreamKit 1.0.0
1152
1228
  */
1153
1229
  bizCode?: number
1154
1230
  /**
1155
- * 智能解决方案 code, 可搜索
1231
+ * Smart solution code, searchable
1156
1232
  * @since AIStreamKit 1.0.0
1157
1233
  */
1158
1234
  solutionCode?: string
1159
1235
  /**
1160
- * 设备 id,可搜索
1236
+ * Device id, searchable
1161
1237
  * @since AIStreamKit 1.0.0
1162
1238
  */
1163
1239
  devId?: string
1164
1240
  /**
1165
- * 家庭 id, 可搜索
1241
+ * Home id, searchable
1166
1242
  * @since AIStreamKit 1.0.0
1167
1243
  */
1168
1244
  homeId?: number
1169
1245
  /**
1170
- * type, 业务自行决定,可搜索
1246
+ * Type, defined by business, searchable
1171
1247
  * @since AIStreamKit 1.0.0
1172
1248
  */
1173
1249
  type?: string
1174
1250
  /**
1175
- * 索引, 业务自行决定,可搜索
1251
+ * Index, defined by business, searchable
1176
1252
  * @since AIStreamKit 1.0.0
1177
1253
  */
1178
1254
  index?: string
1179
1255
  /**
1180
- * 扩展索引1, 业务自行决定,可搜索
1256
+ * Extended index 1, defined by business, searchable
1181
1257
  * @since AIStreamKit 1.0.0
1182
1258
  */
1183
1259
  index1?: string
1184
1260
  /**
1185
- * 扩展索引2, 业务自行决定,可搜索
1261
+ * Extended index 2, defined by business, searchable
1186
1262
  * @since AIStreamKit 1.0.0
1187
1263
  */
1188
1264
  index2?: string
1189
1265
  /**
1190
- * 缓存数据,JSON格式,不可搜索
1266
+ * Cache data, JSON format, not searchable
1191
1267
  * @since AIStreamKit 1.0.0
1192
1268
  */
1193
1269
  data?: string
1194
1270
  /**
1195
- * 值,不可搜索
1271
+ * Value, not searchable
1196
1272
  * @since AIStreamKit 1.0.0
1197
1273
  */
1198
1274
  value?: string
1199
1275
  /**
1200
- * 扩展值1,不可搜索
1276
+ * Extended value 1, not searchable
1201
1277
  * @since AIStreamKit 1.0.0
1202
1278
  */
1203
1279
  value1?: string
1204
1280
  /**
1205
- * 扩展值2,不可搜索
1281
+ * Extended value 2, not searchable
1206
1282
  * @since AIStreamKit 1.0.0
1207
1283
  */
1208
1284
  value2?: string
@@ -1211,7 +1287,7 @@ declare namespace ty.aistream {
1211
1287
  /** 接口调用成功的回调函数 */
1212
1288
  success?: (params: {
1213
1289
  /**
1214
- * 记录ID
1290
+ * Record ID
1215
1291
  * @since AIStreamKit 1.0.0
1216
1292
  */
1217
1293
  id: number
@@ -1233,21 +1309,21 @@ declare namespace ty.aistream {
1233
1309
  }): void
1234
1310
 
1235
1311
  /**
1236
- * 注册音频幅度监听(通过 `onRecordAmplitudes` 回调)
1312
+ * Register audio amplitude listener (via `onRecordAmplitudes` callback)
1237
1313
  * @public
1238
1314
  * @since AIStreamKit 1.0.0
1239
1315
  * @platform iOS Android
1240
1316
  */
1241
1317
  export function registerRecordAmplitudes(params: {
1242
1318
  /**
1243
- * 振幅柱状数据数量
1319
+ * Amplitude bar data count
1244
1320
  * @since AIStreamKit 1.0.0
1245
1321
  */
1246
1322
  count: number
1247
1323
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1248
1324
  complete?: () => void
1249
1325
  /** 接口调用成功的回调函数 */
1250
- success?: (params: null) => void
1326
+ success?: () => void
1251
1327
  /** 接口调用失败的回调函数 */
1252
1328
  fail?: (params: {
1253
1329
  /** 错误信息 */
@@ -1265,7 +1341,7 @@ declare namespace ty.aistream {
1265
1341
  }): void
1266
1342
 
1267
1343
  /**
1268
- * 注销音频振幅监听
1344
+ * Unregister audio amplitude listener
1269
1345
  * @public
1270
1346
  * @since AIStreamKit 1.0.0
1271
1347
  * @platform iOS Android
@@ -1274,7 +1350,7 @@ declare namespace ty.aistream {
1274
1350
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1275
1351
  complete?: () => void
1276
1352
  /** 接口调用成功的回调函数 */
1277
- success?: (params: null) => void
1353
+ success?: () => void
1278
1354
  /** 接口调用失败的回调函数 */
1279
1355
  fail?: (params: {
1280
1356
  /** 错误信息 */
@@ -1292,54 +1368,54 @@ declare namespace ty.aistream {
1292
1368
  }): void
1293
1369
 
1294
1370
  /**
1295
- * 开始播放收到的音频数据
1371
+ * Start playing received audio data
1296
1372
  * @public
1297
1373
  * @since AIStreamKit 1.0.0
1298
1374
  * @platform iOS Android
1299
1375
  */
1300
1376
  export function startPlayAudio(params: {
1301
1377
  /**
1302
- * 音频缓存路径
1378
+ * Audio cache path
1303
1379
  * @since AIStreamKit 1.0.0
1304
1380
  */
1305
1381
  path: string
1306
1382
  /**
1307
- * 音频编码类型,表示音频数据的编码格式。目前仅支持 `PCM`, `MP3`, `WAV(PCM)` 播放
1383
+ * Audio codec type. Currently only supports `PCM`, `MP3`, `WAV(PCM)` playback
1308
1384
  * - 101: PCM
1309
1385
  * - 109: MP3
1310
- * - 1000: WAV(PCM) App本地定义
1386
+ * - 1000: WAV(PCM) App local definition
1311
1387
  * @since AIStreamKit 1.0.0
1312
1388
  */
1313
1389
  codecType: number
1314
1390
  /**
1315
- * 音频采样率,单位Hz
1316
- * 表示每秒采样次数,常见值:8000, 16000, 22050, 24000, 44100
1391
+ * Audio sample rate in Hz
1392
+ * Number of samples per second, common values: 8000, 16000, 22050, 24000, 44100, etc.
1317
1393
  * @since AIStreamKit 1.0.0
1318
1394
  */
1319
1395
  sampleRate: number
1320
1396
  /**
1321
- * 音频通道数
1322
- * - 0: 单声道
1323
- * - 1: 立体声
1397
+ * Audio channels (AIStreamKit < 2.0: mono=0, stereo=1), since >= 2.0 unified across platforms: 1-mono, 2-stereo
1398
+ * - 1: mono
1399
+ * - 2: stereo
1324
1400
  * @since AIStreamKit 1.0.0
1325
1401
  */
1326
1402
  channels: number
1327
1403
  /**
1328
- * 音频位深,表示每个采样点的位数
1329
- * 常见值:8, 16, 24, 32
1404
+ * Audio bit depth, bits per sample
1405
+ * Common values: 8, 16, 24, 32, etc.
1330
1406
  * @since AIStreamKit 1.0.0
1331
1407
  */
1332
1408
  bitDepth: number
1333
1409
  /**
1334
- * 微秒级时间戳
1335
- * 用于音频回放时的同步
1410
+ * Microsecond timestamp
1411
+ * Used for audio playback synchronization
1336
1412
  * @since AIStreamKit 1.0.0
1337
1413
  */
1338
1414
  pts?: number
1339
1415
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1340
1416
  complete?: () => void
1341
1417
  /** 接口调用成功的回调函数 */
1342
- success?: (params: null) => void
1418
+ success?: () => void
1343
1419
  /** 接口调用失败的回调函数 */
1344
1420
  fail?: (params: {
1345
1421
  /** 错误信息 */
@@ -1357,7 +1433,7 @@ declare namespace ty.aistream {
1357
1433
  }): void
1358
1434
 
1359
1435
  /**
1360
- * 停止播放音频
1436
+ * Stop playing audio
1361
1437
  * @public
1362
1438
  * @since AIStreamKit 1.0.0
1363
1439
  * @platform iOS Android
@@ -1366,7 +1442,7 @@ declare namespace ty.aistream {
1366
1442
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
1367
1443
  complete?: () => void
1368
1444
  /** 接口调用成功的回调函数 */
1369
- success?: (params: null) => void
1445
+ success?: () => void
1370
1446
  /** 接口调用失败的回调函数 */
1371
1447
  fail?: (params: {
1372
1448
  /** 错误信息 */
@@ -1384,7 +1460,7 @@ declare namespace ty.aistream {
1384
1460
  }): void
1385
1461
 
1386
1462
  /**
1387
- * 监听 Event事件 接收上报, 注意 body 中的 eventType 区别.
1463
+ * Listen for Event receiving reports, note the eventType difference in body.
1388
1464
  * @public
1389
1465
  * @since AIStreamKit 1.0.0
1390
1466
  * @platform iOS Android
@@ -1392,15 +1468,23 @@ declare namespace ty.aistream {
1392
1468
  export function onEventReceived(listener: (params: EventBody) => void): void
1393
1469
 
1394
1470
  /**
1395
- * 监听 Event事件 接收上报, 注意 body 中的 eventType 区别.
1471
+ * Listen for Event receiving reports, note the eventType difference in body.
1396
1472
  * @public
1397
1473
  * @since AIStreamKit 1.0.0
1474
+ * @example Demo
1475
+ * ```tsx
1476
+ * const listener = function (res) { console.log(res) }
1477
+ * ty.aistream.onEventReceived(listener)
1478
+ * ty.aistream.offEventReceived(listener)
1479
+ * ```
1398
1480
  * @platform iOS Android
1399
1481
  */
1400
1482
  export function offEventReceived(listener: (params: EventBody) => void): void
1401
1483
 
1402
1484
  /**
1403
- * 监听 音频数据 接收上报,仅回调 仅一包、首包、尾包
1485
+ * Listen for audio data receiving reports.
1486
+ * Only triggered when streamFlag == 0 (single packet), 1 (first packet), or 3 (last packet);
1487
+ * not triggered when streamFlag == 2 (transferring).
1404
1488
  * @public
1405
1489
  * @since AIStreamKit 1.0.0
1406
1490
  * @platform iOS Android
@@ -1408,15 +1492,30 @@ declare namespace ty.aistream {
1408
1492
  export function onAudioReceived(listener: (params: AudioBody) => void): void
1409
1493
 
1410
1494
  /**
1411
- * 监听 音频数据 接收上报,仅回调 仅一包、首包、尾包
1495
+ * Listen for audio data receiving reports.
1496
+ * Only triggered when streamFlag == 0 (single packet), 1 (first packet), or 3 (last packet);
1497
+ * not triggered when streamFlag == 2 (transferring).
1412
1498
  * @public
1413
1499
  * @since AIStreamKit 1.0.0
1500
+ * @example Demo
1501
+ * ```tsx
1502
+ * const listener = function (res) { console.log(res) }
1503
+ * ty.aistream.onAudioReceived(listener)
1504
+ * ty.aistream.offAudioReceived(listener)
1505
+ * ```
1414
1506
  * @platform iOS Android
1415
1507
  */
1416
1508
  export function offAudioReceived(listener: (params: AudioBody) => void): void
1417
1509
 
1418
1510
  /**
1419
- * 监听 图片数据 接收上报
1511
+ * Listen for image data receiving reports.
1512
+ * May deliver multiple images in a row: StreamStart(1) is the first image,
1513
+ * every following data-carrying Streaming(2) packet is a NEW image, and StreamEnd(3) is usually
1514
+ * an empty end marker (but is not guaranteed to be empty — it may also carry a file).
1515
+ * Do NOT key off streamFlag to decide whether there is an image: ANY packet that carries data
1516
+ * (any streamFlag, including StreamEnd(3)) is written to its own file and reported as one
1517
+ * independent image via `body.path`. Render an image whenever `body.path` (or `body.imageUrl`)
1518
+ * is non-empty, regardless of streamFlag.
1420
1519
  * @public
1421
1520
  * @since AIStreamKit 1.0.0
1422
1521
  * @platform iOS Android
@@ -1424,15 +1523,28 @@ declare namespace ty.aistream {
1424
1523
  export function onImageReceived(listener: (params: ImageBody) => void): void
1425
1524
 
1426
1525
  /**
1427
- * 监听 图片数据 接收上报
1526
+ * Listen for image data receiving reports.
1527
+ * May deliver multiple images in a row: StreamStart(1) is the first image,
1528
+ * every following data-carrying Streaming(2) packet is a NEW image, and StreamEnd(3) is usually
1529
+ * an empty end marker (but is not guaranteed to be empty — it may also carry a file).
1530
+ * Do NOT key off streamFlag to decide whether there is an image: ANY packet that carries data
1531
+ * (any streamFlag, including StreamEnd(3)) is written to its own file and reported as one
1532
+ * independent image via `body.path`. Render an image whenever `body.path` (or `body.imageUrl`)
1533
+ * is non-empty, regardless of streamFlag.
1428
1534
  * @public
1429
1535
  * @since AIStreamKit 1.0.0
1536
+ * @example Demo
1537
+ * ```tsx
1538
+ * const listener = function (res) { console.log(res) }
1539
+ * ty.aistream.onImageReceived(listener)
1540
+ * ty.aistream.offImageReceived(listener)
1541
+ * ```
1430
1542
  * @platform iOS Android
1431
1543
  */
1432
1544
  export function offImageReceived(listener: (params: ImageBody) => void): void
1433
1545
 
1434
1546
  /**
1435
- * 监听 文本数据 接收上报
1547
+ * Listen for text data receiving reports
1436
1548
  * @public
1437
1549
  * @since AIStreamKit 1.0.0
1438
1550
  * @platform iOS Android
@@ -1440,15 +1552,21 @@ declare namespace ty.aistream {
1440
1552
  export function onTextReceived(listener: (params: TextBody) => void): void
1441
1553
 
1442
1554
  /**
1443
- * 监听 文本数据 接收上报
1555
+ * Listen for text data receiving reports
1444
1556
  * @public
1445
1557
  * @since AIStreamKit 1.0.0
1558
+ * @example Demo
1559
+ * ```tsx
1560
+ * const listener = function (res) { console.log(res) }
1561
+ * ty.aistream.onTextReceived(listener)
1562
+ * ty.aistream.offTextReceived(listener)
1563
+ * ```
1446
1564
  * @platform iOS Android
1447
1565
  */
1448
1566
  export function offTextReceived(listener: (params: TextBody) => void): void
1449
1567
 
1450
1568
  /**
1451
- * 监听 通道连接 状态变化
1569
+ * Listen for channel connection state changes
1452
1570
  * @public
1453
1571
  * @since AIStreamKit 1.0.0
1454
1572
  * @platform iOS Android
@@ -1458,9 +1576,15 @@ declare namespace ty.aistream {
1458
1576
  ): void
1459
1577
 
1460
1578
  /**
1461
- * 监听 通道连接 状态变化
1579
+ * Listen for channel connection state changes
1462
1580
  * @public
1463
1581
  * @since AIStreamKit 1.0.0
1582
+ * @example Demo
1583
+ * ```tsx
1584
+ * const listener = function (res) { console.log(res) }
1585
+ * ty.aistream.onConnectStateChanged(listener)
1586
+ * ty.aistream.offConnectStateChanged(listener)
1587
+ * ```
1464
1588
  * @platform iOS Android
1465
1589
  */
1466
1590
  export function offConnectStateChanged(
@@ -1468,7 +1592,7 @@ declare namespace ty.aistream {
1468
1592
  ): void
1469
1593
 
1470
1594
  /**
1471
- * 监听 会话 状态变化
1595
+ * Listen for session state changes
1472
1596
  * @public
1473
1597
  * @since AIStreamKit 1.0.0
1474
1598
  * @platform iOS Android
@@ -1478,9 +1602,15 @@ declare namespace ty.aistream {
1478
1602
  ): void
1479
1603
 
1480
1604
  /**
1481
- * 监听 会话 状态变化
1605
+ * Listen for session state changes
1482
1606
  * @public
1483
1607
  * @since AIStreamKit 1.0.0
1608
+ * @example Demo
1609
+ * ```tsx
1610
+ * const listener = function (res) { console.log(res) }
1611
+ * ty.aistream.onSessionStateChanged(listener)
1612
+ * ty.aistream.offSessionStateChanged(listener)
1613
+ * ```
1484
1614
  * @platform iOS Android
1485
1615
  */
1486
1616
  export function offSessionStateChanged(
@@ -1488,7 +1618,7 @@ declare namespace ty.aistream {
1488
1618
  ): void
1489
1619
 
1490
1620
  /**
1491
- * 音频振幅回调(先通过 `registerRecordAmplitudes` 注册监听)
1621
+ * Audio amplitude callback (register listener via `registerRecordAmplitudes` first)
1492
1622
  * @public
1493
1623
  * @since AIStreamKit 1.0.0
1494
1624
  * @platform iOS Android
@@ -1498,9 +1628,15 @@ declare namespace ty.aistream {
1498
1628
  ): void
1499
1629
 
1500
1630
  /**
1501
- * 音频振幅回调(先通过 `registerRecordAmplitudes` 注册监听)
1631
+ * Audio amplitude callback (register listener via `registerRecordAmplitudes` first)
1502
1632
  * @public
1503
1633
  * @since AIStreamKit 1.0.0
1634
+ * @example Demo
1635
+ * ```tsx
1636
+ * const listener = function (res) { console.log(res) }
1637
+ * ty.aistream.onRecordAmplitudes(listener)
1638
+ * ty.aistream.offRecordAmplitudes(listener)
1639
+ * ```
1504
1640
  * @platform iOS Android
1505
1641
  */
1506
1642
  export function offRecordAmplitudes(
@@ -1508,7 +1644,7 @@ declare namespace ty.aistream {
1508
1644
  ): void
1509
1645
 
1510
1646
  /**
1511
- * 音频播放状态变化
1647
+ * Audio playback state change
1512
1648
  * @public
1513
1649
  * @since AIStreamKit 1.0.0
1514
1650
  * @platform iOS Android
@@ -1518,9 +1654,15 @@ declare namespace ty.aistream {
1518
1654
  ): void
1519
1655
 
1520
1656
  /**
1521
- * 音频播放状态变化
1657
+ * Audio playback state change
1522
1658
  * @public
1523
1659
  * @since AIStreamKit 1.0.0
1660
+ * @example Demo
1661
+ * ```tsx
1662
+ * const listener = function (res) { console.log(res) }
1663
+ * ty.aistream.onAudioPlayChanged(listener)
1664
+ * ty.aistream.offAudioPlayChanged(listener)
1665
+ * ```
1524
1666
  * @platform iOS Android
1525
1667
  */
1526
1668
  export function offAudioPlayChanged(
@@ -1528,7 +1670,7 @@ declare namespace ty.aistream {
1528
1670
  ): void
1529
1671
 
1530
1672
  /**
1531
- * 音频录制发送出现异常
1673
+ * Audio recording and sending error
1532
1674
  * @public
1533
1675
  * @since AIStreamKit 1.0.0
1534
1676
  * @platform iOS Android
@@ -1538,9 +1680,15 @@ declare namespace ty.aistream {
1538
1680
  ): void
1539
1681
 
1540
1682
  /**
1541
- * 音频录制发送出现异常
1683
+ * Audio recording and sending error
1542
1684
  * @public
1543
1685
  * @since AIStreamKit 1.0.0
1686
+ * @example Demo
1687
+ * ```tsx
1688
+ * const listener = function (res) { console.log(res) }
1689
+ * ty.aistream.onRecordAndSendAudioFail(listener)
1690
+ * ty.aistream.offRecordAndSendAudioFail(listener)
1691
+ * ```
1544
1692
  * @platform iOS Android
1545
1693
  */
1546
1694
  export function offRecordAndSendAudioFail(
@@ -1550,12 +1698,12 @@ declare namespace ty.aistream {
1550
1698
  /** @since AIStreamKit 1.0.0 */
1551
1699
  export interface ConnectParams {
1552
1700
  /**
1553
- * client 类型: 1-作为设备代理, 2-作为 App,3-作为开发者
1701
+ * Client type: 1-device proxy, 2-App, 3-developer
1554
1702
  * @since AIStreamKit 1.0.0
1555
1703
  */
1556
1704
  clientType: number
1557
1705
  /**
1558
- * 代理的设备ID, clientType == 1 时必传
1706
+ * Proxy device ID, required when clientType == 1
1559
1707
  * @since AIStreamKit 1.0.0
1560
1708
  */
1561
1709
  deviceId?: string
@@ -1564,22 +1712,22 @@ declare namespace ty.aistream {
1564
1712
  /** @since AIStreamKit 1.0.0 */
1565
1713
  export interface CheckConnectResponse {
1566
1714
  /**
1567
- * 是否已连接
1715
+ * Whether connected
1568
1716
  * @since AIStreamKit 1.0.0
1569
1717
  */
1570
1718
  connected: boolean
1571
1719
  /**
1572
- * 通道连接状态: 0-初始化,1-连接中,2-鉴权中,3-已连接,4-被云端断开,5-主动关闭
1720
+ * Channel connection state: 0-initialized, 1-connecting, 2-authenticating, 3-connected, 4-disconnected by cloud, 5-actively closed
1573
1721
  * @since AIStreamKit 1.0.0
1574
1722
  */
1575
1723
  state: number
1576
1724
  /**
1577
- * client 类型: 1-作为设备代理, 2-作为 App,3-作为开发者
1725
+ * Client type: 1-device proxy, 2-App, 3-developer
1578
1726
  * @since AIStreamKit 1.0.0
1579
1727
  */
1580
1728
  clientType?: number
1581
1729
  /**
1582
- * 连接的唯一标识
1730
+ * Unique connection identifier
1583
1731
  * @since AIStreamKit 1.0.0
1584
1732
  */
1585
1733
  connectionId?: string
@@ -1588,7 +1736,7 @@ declare namespace ty.aistream {
1588
1736
  /** @since AIStreamKit 1.0.0 */
1589
1737
  export interface ConnectResponse {
1590
1738
  /**
1591
- * 连接的唯一标识
1739
+ * Unique connection identifier
1592
1740
  * @since AIStreamKit 1.0.0
1593
1741
  */
1594
1742
  connectionId: string
@@ -1597,27 +1745,27 @@ declare namespace ty.aistream {
1597
1745
  /** @since AIStreamKit 1.0.0 */
1598
1746
  export interface CreateAgentTokenParams {
1599
1747
  /**
1600
- * Owner ID: HomeIDclientType = 3 时可以为空
1748
+ * Owner ID: HomeID, can be empty when clientType = 3
1601
1749
  * @since AIStreamKit 1.0.0
1602
1750
  */
1603
1751
  ownerId?: string
1604
1752
  /**
1605
- * 智能解决方案 code
1753
+ * Smart solution code
1606
1754
  * @since AIStreamKit 1.0.0
1607
1755
  */
1608
1756
  solutionCode: string
1609
1757
  /**
1610
- * 业务接口
1758
+ * Business API
1611
1759
  * @since AIStreamKit 1.0.0
1612
1760
  */
1613
1761
  api: string
1614
1762
  /**
1615
- * 业务接口版本,clientType = 3 时可以为空
1763
+ * Business API version, can be empty when clientType = 3
1616
1764
  * @since AIStreamKit 1.0.0
1617
1765
  */
1618
1766
  apiVersion?: string
1619
1767
  /**
1620
- * 业务额外参数
1768
+ * Business extra params
1621
1769
  * @since AIStreamKit 1.0.0
1622
1770
  */
1623
1771
  extParams: Record<string, string>
@@ -1626,19 +1774,19 @@ declare namespace ty.aistream {
1626
1774
  /** @since AIStreamKit 1.0.0 */
1627
1775
  export interface BizConfig {
1628
1776
  /**
1629
- * 业务 code
1777
+ * Business code
1630
1778
  * @since AIStreamKit 1.0.0
1631
1779
  */
1632
1780
  bizCode: number
1633
1781
  /**
1634
- * 发送数据通道类型定义,`createSession` 后对应 `sendDataChannels`
1635
- * 例如 bizCode 65537 ["audio", "video", "text", "image", "file"]
1782
+ * Send data channel type definition, corresponds to `sendDataChannels` after `createSession`
1783
+ * e.g. bizCode 65537: ["audio", "video", "text", "image", "file"]
1636
1784
  * @since AIStreamKit 1.0.0
1637
1785
  */
1638
1786
  sendData: string[]
1639
1787
  /**
1640
- * 接收数据通道类型定义,`createSession` 后对应 `revDataChannels`
1641
- * 例如 bizCode 65537 ["text", "audio", "image", "video", "file"]
1788
+ * Receive data channel type definition, corresponds to `revDataChannels` after `createSession`
1789
+ * e.g. bizCode 65537: ["text", "audio", "image", "video", "file"]
1642
1790
  * @since AIStreamKit 1.0.0
1643
1791
  */
1644
1792
  revData: string[]
@@ -1647,17 +1795,17 @@ declare namespace ty.aistream {
1647
1795
  /** @since AIStreamKit 1.0.0 */
1648
1796
  export interface CreateAgentTokenResponse {
1649
1797
  /**
1650
- * 智能体 token
1798
+ * Agent token
1651
1799
  * @since AIStreamKit 1.0.0
1652
1800
  */
1653
1801
  agentToken: string
1654
1802
  /**
1655
- * 业务配置
1803
+ * Business config
1656
1804
  * @since AIStreamKit 1.0.0
1657
1805
  */
1658
1806
  bizConfig: BizConfig
1659
1807
  /**
1660
- * 业务额外参数, 内容为 JSON String
1808
+ * Business extra params, content is JSON String
1661
1809
  * @since AIStreamKit 1.3.3
1662
1810
  */
1663
1811
  extParams: string
@@ -1666,17 +1814,17 @@ declare namespace ty.aistream {
1666
1814
  /** @since AIStreamKit 1.0.0 */
1667
1815
  export interface Attribute {
1668
1816
  /**
1669
- * Attribute 类型
1817
+ * Attribute type, business-defined; agreed between caller and cloud service
1670
1818
  * @since AIStreamKit 1.0.0
1671
1819
  */
1672
1820
  type: number
1673
1821
  /**
1674
- * 数据类型:0x01-UInt8, 0x02-UInt16, 0x03-UInt32, 0x04-UInt64, 0x05-Bytes, 0x06-String
1822
+ * Data type: 0x01-UInt8, 0x02-UInt16, 0x03-UInt32, 0x04-UInt64, 0x05-Bytes, 0x06-String
1675
1823
  * @since AIStreamKit 1.0.0
1676
1824
  */
1677
1825
  payloadType: number
1678
1826
  /**
1679
- * 数据:UInt8~UInt64 数字用字符串传递,Bytes HexString传递,
1827
+ * Data: UInt8~UInt64 numbers passed as string, Bytes passed as HexString
1680
1828
  * @since AIStreamKit 1.0.0
1681
1829
  */
1682
1830
  value: string
@@ -1685,39 +1833,39 @@ declare namespace ty.aistream {
1685
1833
  /** @since AIStreamKit 1.0.0 */
1686
1834
  export interface CreateSessionParams {
1687
1835
  /**
1688
- * 业务 tag
1836
+ * Business scene tag, default 0 indicates a general scene; specific values are defined by the business
1689
1837
  * @since AIStreamKit 1.0.0
1690
1838
  * @defaultValue 0
1691
1839
  */
1692
1840
  bizTag?: number
1693
1841
  /**
1694
- * 智能体 token
1842
+ * Agent token
1695
1843
  * @since AIStreamKit 1.0.0
1696
1844
  */
1697
1845
  agentToken: string
1698
1846
  /**
1699
- * 会话 id. 不传递则自动生成,传递则使用传递的
1847
+ * Session id. Auto-generated if not provided, otherwise uses provided value
1700
1848
  * @since AIStreamKit 1.0.0
1701
1849
  */
1702
1850
  sessionId?: string
1703
1851
  /**
1704
- * 业务配置定义(通过 queryAgentToken 传递)
1852
+ * Business config definition (passed via queryAgentToken)
1705
1853
  * @since AIStreamKit 1.0.0
1706
1854
  */
1707
1855
  bizConfig: BizConfig
1708
1856
  /**
1709
- * 扩展属性。已废弃,请使用 userDataJson
1857
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
1710
1858
  * @since AIStreamKit 1.0.0
1711
1859
  */
1712
1860
  userData?: Attribute[]
1713
1861
  /**
1714
- * 扩展属性
1862
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
1715
1863
  * @since AIStreamKit 2.0.0
1716
1864
  */
1717
1865
  userDataJson?: string
1718
1866
  /**
1719
- * 是否复用数据通道,默认 不复用
1720
- * 通道复用概念:多个 Session 可复用同一份数据,例如:有两个 Session,一个做转写,一个做翻译,同时共用同一份音频流数据处理
1867
+ * Whether to reuse data channel, default is no reuse.
1868
+ * Data channel reuse: multiple Sessions can reuse the same data, e.g. two Sessions, one for transcription and one for translation, sharing the same audio stream
1721
1869
  * @since AIStreamKit 1.0.0
1722
1870
  */
1723
1871
  reuseDataChannel?: boolean
@@ -1726,34 +1874,39 @@ declare namespace ty.aistream {
1726
1874
  /** @since AIStreamKit 1.0.0 */
1727
1875
  export interface CreateSessionResponse {
1728
1876
  /**
1729
- * 会话 id
1877
+ * Session id
1730
1878
  * @since AIStreamKit 1.0.0
1731
1879
  */
1732
1880
  sessionId: string
1733
1881
  /**
1734
- * 下发数据通道 DataChannel. (下发数据时,需要使用该列表中的 DataChannel)
1735
- * 音频视频图片文件都只有一路时,例如 bizCode 65537 ["audio", "video", "text", "image"]
1736
- * 有多路重复时,例如 双路音视频:["audio", "audio_1", "video", "video_1", "text", "image"]
1882
+ * Send data channel DataChannel. (Use DataChannel from this list when sending data)
1883
+ * When audio/video/image/file has single channel, e.g. bizCode 65537: ["audio", "video", "text", "image"]
1884
+ * When there are multiple duplicate channels, e.g. dual audio/video: ["audio", "audio_1", "video", "video_1", "text", "image"]
1737
1885
  * @since AIStreamKit 1.0.0
1738
1886
  */
1739
1887
  sendDataChannels: string[]
1740
1888
  /**
1741
- * 接收数据通道 DataChannel. (接收数据时,数据中会使用该列表中的 DataChannel 进行上报)
1742
- * 接受通道不会复用,例如:文本、音频 ["text", "audio"]
1889
+ * Receive data channel DataChannel. (Data will be reported using DataChannel from this list)
1890
+ * Receive channels are not reused, e.g. text and audio: ["text", "audio"]
1743
1891
  * @since AIStreamKit 1.0.0
1744
1892
  */
1745
1893
  revDataChannels: string[]
1894
+ /**
1895
+ * Base cache directory
1896
+ * @since AIStreamKit 2.2.5
1897
+ */
1898
+ baseCacheDir: string
1746
1899
  }
1747
1900
 
1748
1901
  /** @since AIStreamKit 1.0.0 */
1749
1902
  export interface CloseSessionParams {
1750
1903
  /**
1751
- * 会话 id
1904
+ * Session id
1752
1905
  * @since AIStreamKit 1.0.0
1753
1906
  */
1754
1907
  sessionId: string
1755
1908
  /**
1756
- * 关闭原因, 非异常则使用 200 来关闭
1909
+ * Close reason, use 200 for normal close
1757
1910
  * @since AIStreamKit 1.0.0
1758
1911
  */
1759
1912
  code: number
@@ -1762,7 +1915,7 @@ declare namespace ty.aistream {
1762
1915
  /** @since AIStreamKit 1.0.0 */
1763
1916
  export interface DisconnectParams {
1764
1917
  /**
1765
- * 需要断连的 connection Id
1918
+ * Connection Id to disconnect
1766
1919
  * @since AIStreamKit 1.0.0
1767
1920
  */
1768
1921
  connectionId: string
@@ -1771,24 +1924,24 @@ declare namespace ty.aistream {
1771
1924
  /** @since AIStreamKit 1.0.0 */
1772
1925
  export interface SendEventStartParams {
1773
1926
  /**
1774
- * 会话 id
1927
+ * Session id
1775
1928
  * @since AIStreamKit 1.0.0
1776
1929
  */
1777
1930
  sessionId: string
1778
1931
  /**
1779
- * 扩展属性。已废弃,请使用 userDataJson
1932
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
1780
1933
  * @since AIStreamKit 1.0.0
1781
1934
  */
1782
1935
  userData?: Attribute[]
1783
1936
  /**
1784
- * 扩展属性
1937
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
1785
1938
  * @since AIStreamKit 2.0.0
1786
1939
  */
1787
1940
  userDataJson?: string
1788
1941
  /**
1789
- * Event ID 前缀。(可选)
1790
- * 传递则格式为: "$prefix_event_$sessionId.sub(8)_$timestamp"
1791
- * 不传递格式为: "ios_event_$sessionId.sub(8)_$timestamp""Android_Event_$sessionId.sub(8)_$timestamp"
1942
+ * Event ID prefix. (Optional)
1943
+ * If provided, format: "$prefix_event_$sessionId.sub(8)_$timestamp"
1944
+ * If not provided, format: "ios_event_$sessionId.sub(8)_$timestamp" or "Android_Event_$sessionId.sub(8)_$timestamp"
1792
1945
  * @since AIStreamKit 1.3.2
1793
1946
  */
1794
1947
  eventIdPrefix?: string
@@ -1797,7 +1950,7 @@ declare namespace ty.aistream {
1797
1950
  /** @since AIStreamKit 1.0.0 */
1798
1951
  export interface SendEventStartResponse {
1799
1952
  /**
1800
- * 事件 id。此后 sendEventPayloadEndsendEventEndsendEventChatBreak 都需要使用该 eventId 直到下发一次 sendEventStart 生成新 eventId 之前。
1953
+ * Event id. After this, sendEventPayloadEnd, sendEventEnd, sendEventChatBreak must use this eventId until a new sendEventStart generates a new eventId.
1801
1954
  * @since AIStreamKit 1.0.0
1802
1955
  */
1803
1956
  eventId: string
@@ -1806,27 +1959,27 @@ declare namespace ty.aistream {
1806
1959
  /** @since AIStreamKit 1.0.0 */
1807
1960
  export interface SendEventPayloadEndParams {
1808
1961
  /**
1809
- * 事件 id
1962
+ * Event id
1810
1963
  * @since AIStreamKit 1.0.0
1811
1964
  */
1812
1965
  eventId: string
1813
1966
  /**
1814
- * 会话 id
1967
+ * Session id
1815
1968
  * @since AIStreamKit 1.0.0
1816
1969
  */
1817
1970
  sessionId: string
1818
1971
  /**
1819
- * 发送结束的数据通道
1972
+ * Data channel to end sending
1820
1973
  * @since AIStreamKit 1.0.0
1821
1974
  */
1822
1975
  dataChannel: string
1823
1976
  /**
1824
- * 扩展属性。已废弃,请使用 userDataJson
1977
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
1825
1978
  * @since AIStreamKit 1.0.0
1826
1979
  */
1827
1980
  userData?: Attribute[]
1828
1981
  /**
1829
- * 扩展属性
1982
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
1830
1983
  * @since AIStreamKit 2.0.0
1831
1984
  */
1832
1985
  userDataJson?: string
@@ -1835,22 +1988,22 @@ declare namespace ty.aistream {
1835
1988
  /** @since AIStreamKit 1.0.0 */
1836
1989
  export interface SendEventEndParams {
1837
1990
  /**
1838
- * 事件 id
1991
+ * Event id
1839
1992
  * @since AIStreamKit 1.0.0
1840
1993
  */
1841
1994
  eventId: string
1842
1995
  /**
1843
- * 会话 id
1996
+ * Session id
1844
1997
  * @since AIStreamKit 1.0.0
1845
1998
  */
1846
1999
  sessionId: string
1847
2000
  /**
1848
- * 扩展属性。已废弃,请使用 userDataJson
2001
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
1849
2002
  * @since AIStreamKit 1.0.0
1850
2003
  */
1851
2004
  userData?: Attribute[]
1852
2005
  /**
1853
- * 扩展属性
2006
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
1854
2007
  * @since AIStreamKit 2.0.0
1855
2008
  */
1856
2009
  userDataJson?: string
@@ -1859,32 +2012,77 @@ declare namespace ty.aistream {
1859
2012
  /** @since AIStreamKit 1.0.0 */
1860
2013
  export interface SendEventChatBreakParams {
1861
2014
  /**
1862
- * 事件 id
2015
+ * Event id
1863
2016
  * @since AIStreamKit 1.0.0
1864
2017
  */
1865
2018
  eventId: string
1866
2019
  /**
1867
- * 会话 id
2020
+ * Session id
1868
2021
  * @since AIStreamKit 1.0.0
1869
2022
  */
1870
2023
  sessionId: string
1871
2024
  /**
1872
- * 扩展属性。已废弃,请使用 userDataJson
2025
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
1873
2026
  * @since AIStreamKit 1.0.0
1874
2027
  */
1875
2028
  userData?: Attribute[]
1876
2029
  /**
1877
- * 扩展属性
2030
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
1878
2031
  * @since AIStreamKit 2.0.0
1879
2032
  */
1880
2033
  userDataJson?: string
1881
2034
  }
1882
2035
 
2036
+ /** @since AIStreamKit 2.2.0 */
2037
+ export interface SendEventParams {
2038
+ /**
2039
+ * Session id
2040
+ * @since AIStreamKit 2.2.0
2041
+ */
2042
+ sessionId: string
2043
+ /**
2044
+ * Event id
2045
+ * @since AIStreamKit 2.2.0
2046
+ */
2047
+ eventId: string
2048
+ /**
2049
+ * Event type
2050
+ * - 0: Event Start
2051
+ * - 1: Event Payload End
2052
+ * - 2: Event End
2053
+ * - 3: OneShot
2054
+ * - 4: Chat Break
2055
+ * - 5: Server VAD
2056
+ * - 1000: MCP CMD
2057
+ * - 1001: Server timeout
2058
+ * - 1002: Update Context
2059
+ * - 1003: Event trigger
2060
+ * - 1004: Event sleep
2061
+ * @since AIStreamKit 2.2.0
2062
+ */
2063
+ eventType: number
2064
+ /**
2065
+ * Payload string (will be converted to byte[] internally). Used for MCP responses etc.
2066
+ * @since AIStreamKit 2.2.0
2067
+ */
2068
+ payload?: string
2069
+ /**
2070
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2071
+ * @since AIStreamKit 2.2.0
2072
+ */
2073
+ userData?: Attribute[]
2074
+ /**
2075
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2076
+ * @since AIStreamKit 2.2.0
2077
+ */
2078
+ userDataJson?: string
2079
+ }
2080
+
1883
2081
  /** @since AIStreamKit 1.1.0 */
1884
2082
  export interface RecordInitParams {
1885
2083
  /**
1886
- * 音频采样率,单位Hz, 默认 16000 Hz
1887
- * 表示每秒采样次数,常见值:8000, 16000, 22050, 24000, 44100
2084
+ * Audio sample rate in Hz, default 16000 Hz
2085
+ * Number of samples per second, common values: 8000, 16000, 22050, 24000, 44100, etc.
1888
2086
  * @since AIStreamKit 1.1.0
1889
2087
  * @defaultValue 16000
1890
2088
  */
@@ -1894,36 +2092,36 @@ declare namespace ty.aistream {
1894
2092
  /** @since AIStreamKit 1.0.0 */
1895
2093
  export interface SendAudioParams {
1896
2094
  /**
1897
- * 会话 id
2095
+ * Session id
1898
2096
  * @since AIStreamKit 1.0.0
1899
2097
  */
1900
2098
  sessionId: string
1901
2099
  /**
1902
- * 下发数据通道 Code,当音频只有单路的时候,可以不传
2100
+ * Send data channel code, optional when audio has only single channel
1903
2101
  * @since AIStreamKit 1.0.0
1904
2102
  */
1905
2103
  dataChannel?: string
1906
2104
  /**
1907
- * 扩展属性。已废弃,请使用 userDataJson
2105
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
1908
2106
  * @since AIStreamKit 1.0.0
1909
2107
  */
1910
2108
  userData?: Attribute[]
1911
2109
  /**
1912
- * 是否需要保存录制的音频文件,仅单次录音周期生效。默认: false 不保存
2110
+ * Whether to save recorded audio file, effective for single recording cycle only. Default: false
1913
2111
  * @since AIStreamKit 1.1.0
1914
2112
  * @defaultValue false
1915
2113
  */
1916
2114
  saveFile?: boolean
1917
2115
  /**
1918
- * 录音初始化参数(若使用 initAudioRecorder 提前初始化过,可以不传)
1919
- * 1. 不传递,则使用最后一次调用 `initAudioRecorder` 的值,从未调用过则会使用默认配置 16000Hz、单声道、16bit位深进行初始化。
1920
- * 2. 当传递的参数与上一次不一致时,则会重新初始化。
1921
- * 3. 初始化会有 300 ~ 600ms 的初始化耗时,此时说话无法采集,通常会丢 2 ~ 4 个汉字的音频,建议合适的时机提前调用 `initAudioRecorder` 完成初始化。
2116
+ * Recording init params (optional if already initialized via initAudioRecorder)
2117
+ * 1. If not provided, uses the value from last `initAudioRecorder` call; if never called, uses default config 16000Hz, mono, 16bit.
2118
+ * 2. If provided params differ from previous, will re-initialize.
2119
+ * 3. Initialization takes 300 ~ 600ms, speech cannot be captured during this time, it is recommended to call `initAudioRecorder` in advance.
1922
2120
  * @since AIStreamKit 1.1.0
1923
2121
  */
1924
2122
  recordInitParams?: RecordInitParams
1925
2123
  /**
1926
- * 扩展属性
2124
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
1927
2125
  * @since AIStreamKit 2.0.0
1928
2126
  */
1929
2127
  userDataJson?: string
@@ -1932,32 +2130,32 @@ declare namespace ty.aistream {
1932
2130
  /** @since AIStreamKit 1.1.0 */
1933
2131
  export interface SendAudioResponse {
1934
2132
  /**
1935
- * 录音保存的文件路径,注意需要在 `startRecordAndSendAudioData` 中传递 `saveFile` true 时才会有值
2133
+ * Saved audio file path, only has value when `saveFile` is set to true in `startRecordAndSendAudioData`
1936
2134
  * @since AIStreamKit 1.1.0
1937
2135
  */
1938
2136
  path?: string
1939
2137
  /**
1940
- * 音频编码类型,表示音频数据的编码格式。目前仅保存为 WAV(PCM) 文件
1941
- * - 1000: WAV(PCM) App本地定义
2138
+ * Audio codec type. Currently only saves as WAV(PCM) file
2139
+ * - 1000: WAV(PCM) App local definition
1942
2140
  * @since AIStreamKit 1.1.0
1943
2141
  */
1944
2142
  codecType: number
1945
2143
  /**
1946
- * 音频采样率,单位Hz
1947
- * 表示每秒采样次数,常见值:8000, 16000, 22050, 24000, 44100
2144
+ * Audio sample rate in Hz
2145
+ * Number of samples per second, common values: 8000, 16000, 22050, 24000, 44100, etc.
1948
2146
  * @since AIStreamKit 1.1.0
1949
2147
  */
1950
2148
  sampleRate: number
1951
2149
  /**
1952
- * 音频通道数
1953
- * - 0: 单声道
1954
- * - 1: 立体声
2150
+ * Audio channels (AIStreamKit < 2.0: mono=0, stereo=1), since >= 2.0 unified across platforms: 1-mono, 2-stereo
2151
+ * - 1: mono
2152
+ * - 2: stereo
1955
2153
  * @since AIStreamKit 1.1.0
1956
2154
  */
1957
2155
  channels: number
1958
2156
  /**
1959
- * 音频位深,表示每个采样点的位数
1960
- * 常见值:8, 16, 24, 32
2157
+ * Audio bit depth, bits per sample
2158
+ * Common values: 8, 16, 24, 32, etc.
1961
2159
  * @since AIStreamKit 1.1.0
1962
2160
  */
1963
2161
  bitDepth: number
@@ -1966,32 +2164,32 @@ declare namespace ty.aistream {
1966
2164
  /** @since AIStreamKit 1.0.0 */
1967
2165
  export interface SendImageDataParams {
1968
2166
  /**
1969
- * 会话 id
2167
+ * Session id
1970
2168
  * @since AIStreamKit 1.0.0
1971
2169
  */
1972
2170
  sessionId: string
1973
2171
  /**
1974
- * 下发数据通道 Code,当音频只有单路的时候,可以不传
2172
+ * Send data channel code, optional when audio has only single channel
1975
2173
  * @since AIStreamKit 1.0.0
1976
2174
  */
1977
2175
  dataChannel?: string
1978
2176
  /**
1979
- * 图片路径
2177
+ * Image path
1980
2178
  * @since AIStreamKit 1.0.0
1981
2179
  */
1982
2180
  path: string
1983
2181
  /**
1984
- * 图片类型: 1-JPEG, 2-PNG
2182
+ * Image format: 1-JPEG, 2-PNG
1985
2183
  * @since AIStreamKit 1.0.0
1986
2184
  */
1987
2185
  format: number
1988
2186
  /**
1989
- * 扩展属性。已废弃,请使用 userDataJson
2187
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
1990
2188
  * @since AIStreamKit 1.0.0
1991
2189
  */
1992
2190
  userData?: Attribute[]
1993
2191
  /**
1994
- * 扩展属性
2192
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
1995
2193
  * @since AIStreamKit 2.0.0
1996
2194
  */
1997
2195
  userDataJson?: string
@@ -2000,27 +2198,27 @@ declare namespace ty.aistream {
2000
2198
  /** @since AIStreamKit 1.0.0 */
2001
2199
  export interface SendTextDataParams {
2002
2200
  /**
2003
- * 会话 id
2201
+ * Session id
2004
2202
  * @since AIStreamKit 1.0.0
2005
2203
  */
2006
2204
  sessionId: string
2007
2205
  /**
2008
- * 下发数据通道 Code,当音频只有单路的时候,可以不传
2206
+ * Send data channel code, optional when audio has only single channel
2009
2207
  * @since AIStreamKit 1.0.0
2010
2208
  */
2011
2209
  dataChannel?: string
2012
2210
  /**
2013
- * 文本内容
2211
+ * Text content
2014
2212
  * @since AIStreamKit 1.0.0
2015
2213
  */
2016
2214
  text: string
2017
2215
  /**
2018
- * 扩展属性。已废弃,请使用 userDataJson
2216
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2019
2217
  * @since AIStreamKit 1.0.0
2020
2218
  */
2021
2219
  userData?: Attribute[]
2022
2220
  /**
2023
- * 扩展属性
2221
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2024
2222
  * @since AIStreamKit 2.0.0
2025
2223
  */
2026
2224
  userDataJson?: string
@@ -2029,27 +2227,43 @@ declare namespace ty.aistream {
2029
2227
  /** @since AIStreamKit 1.0.0 */
2030
2228
  export interface EventBody {
2031
2229
  /**
2032
- * 事件 id
2230
+ * Event id
2033
2231
  * @since AIStreamKit 1.0.0
2034
2232
  */
2035
2233
  eventId: string
2036
2234
  /**
2037
- * 会话 id
2235
+ * Session id
2038
2236
  * @since AIStreamKit 1.0.0
2039
2237
  */
2040
2238
  sessionId: string
2041
2239
  /**
2042
- * 事件类型: 0-Event Start, 1-Event Payload End, 2-Event End, 3 - OneShot, 4-Chat Break, 5-Server VAD
2240
+ * Event type
2241
+ * - 0: Event Start
2242
+ * - 1: Event Payload End
2243
+ * - 2: Event End
2244
+ * - 3: OneShot
2245
+ * - 4: Chat Break
2246
+ * - 5: Server VAD
2247
+ * - 1000: MCP CMD
2248
+ * - 1001: Server timeout
2249
+ * - 1002: Update Context
2250
+ * - 1003: Event trigger
2251
+ * - 1004: Event sleep
2043
2252
  * @since AIStreamKit 1.0.0
2044
2253
  */
2045
2254
  eventType: number
2046
2255
  /**
2047
- * 扩展属性。已废弃,请使用 userDataJson
2256
+ * Payload string, converted from byte[] payload in StreamEvent. Used for MCP responses etc.
2257
+ * @since AIStreamKit 2.2.0
2258
+ */
2259
+ payload?: string
2260
+ /**
2261
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2048
2262
  * @since AIStreamKit 1.0.0
2049
2263
  */
2050
2264
  userData?: Attribute[]
2051
2265
  /**
2052
- * 扩展属性
2266
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2053
2267
  * @since AIStreamKit 2.0.0
2054
2268
  */
2055
2269
  userDataJson?: string
@@ -2058,43 +2272,43 @@ declare namespace ty.aistream {
2058
2272
  /** @since AIStreamKit 1.0.0 */
2059
2273
  export interface AudioBody {
2060
2274
  /**
2061
- * 接收数据通道 Code
2275
+ * Receive data channel code
2062
2276
  * @since AIStreamKit 1.0.0
2063
2277
  */
2064
2278
  dataChannel: string
2065
2279
  /**
2066
- * 数据流类型: 0-仅一包, 1-传输开始, 2-传输中, 3-传输结束
2280
+ * Stream flag: 0-single packet, 1-transfer start, 2-transferring, 3-transfer end
2067
2281
  * @since AIStreamKit 1.0.0
2068
2282
  */
2069
2283
  streamFlag: number
2070
2284
  /**
2071
- * 音频缓存路径
2285
+ * Audio cache path
2072
2286
  * @since AIStreamKit 1.0.0
2073
2287
  */
2074
2288
  path: string
2075
2289
  /**
2076
- * 扩展属性。已废弃,请使用 userDataJson
2290
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2077
2291
  * @since AIStreamKit 1.0.0
2078
2292
  */
2079
2293
  userData?: Attribute[]
2080
2294
  /**
2081
- * 扩展属性
2295
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2082
2296
  * @since AIStreamKit 2.0.0
2083
2297
  */
2084
2298
  userDataJson?: string
2085
2299
  /**
2086
- * SessionId 列表, 云端返回,可能为空
2300
+ * SessionId list, returned by cloud, may be empty
2087
2301
  * @since AIStreamKit 1.0.0
2088
2302
  */
2089
2303
  sessionIdList?: string[]
2090
2304
  /**
2091
- * 微秒级时间戳
2092
- * 用于音频回放时的同步
2305
+ * Microsecond timestamp
2306
+ * Used for audio playback synchronization
2093
2307
  * @since AIStreamKit 1.0.0
2094
2308
  */
2095
2309
  pts?: number
2096
2310
  /**
2097
- * 音频编码类型,表示音频数据的编码格式
2311
+ * Audio codec type
2098
2312
  * - 100: ADPCM
2099
2313
  * - 101: PCM
2100
2314
  * - 102: AACRaw
@@ -2107,78 +2321,93 @@ declare namespace ty.aistream {
2107
2321
  * - 109: MP3
2108
2322
  * - 110: G722
2109
2323
  * - 111: Opus
2110
- * streamFlag == 0 || == 1 时有值
2324
+ * Only has value when streamFlag == 0 || == 1
2111
2325
  * @since AIStreamKit 1.0.0
2112
2326
  */
2113
2327
  codecType?: number
2114
2328
  /**
2115
- * 音频采样率,单位Hz
2116
- * 表示每秒采样次数,常见值:8000, 16000, 22050, 24000, 44100
2117
- * streamFlag == 0 || == 1 时有值
2329
+ * Audio sample rate in Hz
2330
+ * Number of samples per second, common values: 8000, 16000, 22050, 24000, 44100, etc.
2331
+ * Only has value when streamFlag == 0 || == 1
2118
2332
  * @since AIStreamKit 1.0.0
2119
2333
  */
2120
2334
  sampleRate?: number
2121
2335
  /**
2122
- * 音频通道数
2123
- * - 0: 单声道
2124
- * - 1: 立体声
2125
- * streamFlag == 0 || == 1 时有值
2336
+ * Audio channels (AIStreamKit < 2.0: mono=0, stereo=1), since >= 2.0 unified across platforms: 1-mono, 2-stereo
2337
+ * - 1: mono
2338
+ * - 2: stereo
2339
+ * Only has value when streamFlag == 0 || == 1
2126
2340
  * @since AIStreamKit 1.0.0
2127
2341
  */
2128
2342
  channels?: number
2129
2343
  /**
2130
- * 音频位深,表示每个采样点的位数
2131
- * 常见值:8, 16, 24, 32
2132
- * streamFlag == 0 || == 1 时有值
2344
+ * Audio bit depth, bits per sample
2345
+ * Common values: 8, 16, 24, 32, etc.
2346
+ * Only has value when streamFlag == 0 || == 1
2133
2347
  * @since AIStreamKit 1.0.0
2134
2348
  */
2135
2349
  bitDepth?: number
2350
+ /**
2351
+ * Error code, only has value when streamFlag == 3 (transfer end)
2352
+ * - 39017: time <1s && pcm data all 0
2353
+ * @since AIStreamKit 2.2.8
2354
+ */
2355
+ errorCode?: number
2136
2356
  }
2137
2357
 
2138
2358
  /** @since AIStreamKit 1.0.0 */
2139
2359
  export interface ImageBody {
2140
2360
  /**
2141
- * 接收数据通道 Code
2361
+ * Receive data channel code
2142
2362
  * @since AIStreamKit 1.0.0
2143
2363
  */
2144
2364
  dataChannel: string
2145
2365
  /**
2146
- * 数据流类型: 0-仅一包, 1-传输开始, 2-传输中, 3-传输结束
2366
+ * Stream flag: 0-single packet, 1-transfer start, 2-transferring, 3-transfer end
2147
2367
  * @since AIStreamKit 1.0.0
2148
2368
  */
2149
2369
  streamFlag: number
2150
2370
  /**
2151
- * 图片缓存路径,传输结束后可访问(streamFlag == 1 || StreamFlag == 3)
2371
+ * Image cache path. Each data-carrying packet writes its own image file, so under the same
2372
+ * dataId every packet that carries data (ANY streamFlag, including StreamEnd(3) when it carries
2373
+ * data) is one independent image and has its own path. Only a packet with no data (typically an
2374
+ * empty StreamEnd(3) end marker) has an empty path. Decide by whether path is non-empty, not by
2375
+ * streamFlag.
2152
2376
  * @since AIStreamKit 1.0.0
2153
2377
  */
2154
2378
  path: string
2155
2379
  /**
2156
- * 图片类型: 1-JPEG, 2-PNG
2380
+ * Image URL, oss image url
2381
+ * @since AIStreamKit 2.2.1
2382
+ */
2383
+ imageUrl?: string
2384
+ /**
2385
+ * Image format: 1-JPEG, 2-PNG
2157
2386
  * @since AIStreamKit 1.0.0
2158
2387
  */
2159
2388
  format: number
2160
2389
  /**
2161
- * 图片宽度
2390
+ * Image width
2162
2391
  * @since AIStreamKit 1.0.0
2163
2392
  */
2164
2393
  width: number
2165
2394
  /**
2166
- * 图片高度
2395
+ * Image height
2167
2396
  * @since AIStreamKit 1.0.0
2168
2397
  */
2169
2398
  height: number
2170
2399
  /**
2171
- * 扩展属性。已废弃,请使用 userDataJson
2400
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2172
2401
  * @since AIStreamKit 1.0.0
2173
2402
  */
2174
2403
  userData?: Attribute[]
2175
2404
  /**
2176
- * 扩展属性
2405
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2177
2406
  * @since AIStreamKit 2.0.0
2178
2407
  */
2179
2408
  userDataJson?: string
2180
2409
  /**
2181
- * SessionId 列表, 云端返回,可能为空
2410
+ * SessionId list, returned by cloud, may be empty
2182
2411
  * @since AIStreamKit 1.0.0
2183
2412
  */
2184
2413
  sessionIdList?: string[]
@@ -2187,32 +2416,32 @@ declare namespace ty.aistream {
2187
2416
  /** @since AIStreamKit 1.0.0 */
2188
2417
  export interface TextBody {
2189
2418
  /**
2190
- * 接收数据通道 Code
2419
+ * Receive data channel code
2191
2420
  * @since AIStreamKit 1.0.0
2192
2421
  */
2193
2422
  dataChannel: string
2194
2423
  /**
2195
- * 数据流类型: 0-仅一包, 1-传输开始, 2-传输中, 3-传输结束
2424
+ * Stream flag: 0-single packet, 1-transfer start, 2-transferring, 3-transfer end
2196
2425
  * @since AIStreamKit 1.0.0
2197
2426
  */
2198
2427
  streamFlag: number
2199
2428
  /**
2200
- * 文本内容(JSON String,见云端文档定义)
2429
+ * Text content (JSON String, see cloud documentation for definition)
2201
2430
  * @since AIStreamKit 1.0.0
2202
2431
  */
2203
2432
  text: string
2204
2433
  /**
2205
- * 扩展属性。已废弃,请使用 userDataJson
2434
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2206
2435
  * @since AIStreamKit 1.0.0
2207
2436
  */
2208
2437
  userData?: Attribute[]
2209
2438
  /**
2210
- * 扩展属性
2439
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2211
2440
  * @since AIStreamKit 2.0.0
2212
2441
  */
2213
2442
  userDataJson?: string
2214
2443
  /**
2215
- * SessionId 列表, 云端返回,可能为空
2444
+ * SessionId list, returned by cloud, may be empty
2216
2445
  * @since AIStreamKit 1.0.0
2217
2446
  */
2218
2447
  sessionIdList?: string[]
@@ -2221,17 +2450,18 @@ declare namespace ty.aistream {
2221
2450
  /** @since AIStreamKit 1.0.0 */
2222
2451
  export interface ConnectStateBody {
2223
2452
  /**
2224
- * connection id
2453
+ * Connection id
2225
2454
  * @since AIStreamKit 1.0.0
2226
2455
  */
2227
2456
  connectionId: string
2228
2457
  /**
2229
- * 连接状态: 0-初始化,1-连接中,2-鉴权中,3-已连接,4-被云端断开,5-主动关闭
2458
+ * Connection state: 0-initialized, 1-connecting, 2-authenticating, 3-connected, 4-disconnected by cloud, 5-actively closed
2230
2459
  * @since AIStreamKit 1.0.0
2231
2460
  */
2232
2461
  connectState: number
2233
2462
  /**
2234
- * 被云端断开错误码
2463
+ * Disconnect error code; valid when connectState == 4 (disconnected by cloud), indicates the cloud error code;
2464
+ * empty when connectState == 5 (actively closed) or other states
2235
2465
  * @since AIStreamKit 1.0.0
2236
2466
  */
2237
2467
  code?: number
@@ -2240,17 +2470,18 @@ declare namespace ty.aistream {
2240
2470
  /** @since AIStreamKit 1.0.0 */
2241
2471
  export interface SessionStateBody {
2242
2472
  /**
2243
- * 会话 id
2473
+ * Session id
2244
2474
  * @since AIStreamKit 1.0.0
2245
2475
  */
2246
2476
  sessionId: string
2247
2477
  /**
2248
- * 会话状态: 0-会话创建成功, 1-会话创建失败, 2-会话被云端关闭
2478
+ * Session state: 0-session created successfully, 1-session creation failed, 2-session closed by cloud
2249
2479
  * @since AIStreamKit 1.0.0
2250
2480
  */
2251
2481
  sessionState: number
2252
2482
  /**
2253
- * 会话被关闭原因
2483
+ * Session status code; valid when sessionState == 1 (creation failed) or 2 (closed by cloud);
2484
+ * 200 indicates normal closure, other values are error codes
2254
2485
  * @since AIStreamKit 1.0.0
2255
2486
  */
2256
2487
  code?: number
@@ -2259,64 +2490,64 @@ declare namespace ty.aistream {
2259
2490
  /** @since AIStreamKit 1.0.0 */
2260
2491
  export interface RecordListParams {
2261
2492
  /**
2262
- * 自增ID
2493
+ * Auto-increment ID
2263
2494
  * @since AIStreamKit 1.0.0
2264
2495
  */
2265
2496
  id?: number[]
2266
2497
  /**
2267
- * biz Code 大类目,可搜索
2498
+ * Biz code category, searchable
2268
2499
  * @since AIStreamKit 1.0.0
2269
2500
  */
2270
2501
  bizCode?: number[]
2271
2502
  /**
2272
- * 智能解决方案 code, 可搜索
2503
+ * Smart solution code, searchable
2273
2504
  * @since AIStreamKit 1.0.0
2274
2505
  */
2275
2506
  solutionCode?: string[]
2276
2507
  /**
2277
- * 设备 id,可搜索
2508
+ * Device id, searchable
2278
2509
  * @since AIStreamKit 1.0.0
2279
2510
  */
2280
2511
  devId?: string[]
2281
2512
  /**
2282
- * 家庭 id, 可搜索
2513
+ * Home id, searchable
2283
2514
  * @since AIStreamKit 1.0.0
2284
2515
  */
2285
2516
  homeId?: number[]
2286
2517
  /**
2287
- * type, 业务自行决定,可搜索
2518
+ * Type, defined by business, searchable
2288
2519
  * @since AIStreamKit 1.0.0
2289
2520
  */
2290
2521
  type?: string[]
2291
2522
  /**
2292
- * 索引, 业务自行决定,可搜索
2523
+ * Index, defined by business, searchable
2293
2524
  * @since AIStreamKit 1.0.0
2294
2525
  */
2295
2526
  index?: string[]
2296
2527
  /**
2297
- * 扩展索引1, 业务自行决定,可搜索
2528
+ * Extended index 1, defined by business, searchable
2298
2529
  * @since AIStreamKit 1.0.0
2299
2530
  */
2300
2531
  index1?: string[]
2301
2532
  /**
2302
- * 扩展索引2, 业务自行决定,可搜索
2533
+ * Extended index 2, defined by business, searchable
2303
2534
  * @since AIStreamKit 1.0.0
2304
2535
  */
2305
2536
  index2?: string[]
2306
2537
  /**
2307
- * offset 分页偏移量(删除时无需传递)
2538
+ * Pagination offset (not needed for deletion)
2308
2539
  * @since AIStreamKit 1.0.0
2309
2540
  */
2310
2541
  offset?: number
2311
2542
  /**
2312
- * limit 分页大小, 不传或传0则不分页(删除时无需传递)
2543
+ * Pagination size, no pagination if not provided or 0 (not needed for deletion)
2313
2544
  * @since AIStreamKit 1.0.0
2314
2545
  */
2315
2546
  limit?: number
2316
2547
  /**
2317
- * 排序方式,仅用于 `queryRecordList`
2318
- * - 0: id 降序(默认)
2319
- * - 1: id 升序
2548
+ * Sort type, only for `queryRecordList`
2549
+ * - 0: descending by id (default)
2550
+ * - 1: ascending by id
2320
2551
  * @since AIStreamKit 1.0.0
2321
2552
  */
2322
2553
  sortType?: number
@@ -2325,67 +2556,67 @@ declare namespace ty.aistream {
2325
2556
  /** @since AIStreamKit 1.0.0 */
2326
2557
  export interface RecordBody {
2327
2558
  /**
2328
- * 记录ID, 自增. (insertRecord 不传, updateRecord 必传, 作为 Response 返回时必有值)
2559
+ * Record ID, auto-increment. (Not required for insertRecord, required for updateRecord, always present in Response)
2329
2560
  * @since AIStreamKit 1.0.0
2330
2561
  */
2331
2562
  id?: number
2332
2563
  /**
2333
- * biz Code 大类目,可搜索
2564
+ * Biz code category, searchable
2334
2565
  * @since AIStreamKit 1.0.0
2335
2566
  */
2336
2567
  bizCode?: number
2337
2568
  /**
2338
- * 智能解决方案 code, 可搜索
2569
+ * Smart solution code, searchable
2339
2570
  * @since AIStreamKit 1.0.0
2340
2571
  */
2341
2572
  solutionCode?: string
2342
2573
  /**
2343
- * 设备 id,可搜索
2574
+ * Device id, searchable
2344
2575
  * @since AIStreamKit 1.0.0
2345
2576
  */
2346
2577
  devId?: string
2347
2578
  /**
2348
- * 家庭 id, 可搜索
2579
+ * Home id, searchable
2349
2580
  * @since AIStreamKit 1.0.0
2350
2581
  */
2351
2582
  homeId?: number
2352
2583
  /**
2353
- * type, 业务自行决定,可搜索
2584
+ * Type, defined by business, searchable
2354
2585
  * @since AIStreamKit 1.0.0
2355
2586
  */
2356
2587
  type?: string
2357
2588
  /**
2358
- * 索引, 业务自行决定,可搜索
2589
+ * Index, defined by business, searchable
2359
2590
  * @since AIStreamKit 1.0.0
2360
2591
  */
2361
2592
  index?: string
2362
2593
  /**
2363
- * 扩展索引1, 业务自行决定,可搜索
2594
+ * Extended index 1, defined by business, searchable
2364
2595
  * @since AIStreamKit 1.0.0
2365
2596
  */
2366
2597
  index1?: string
2367
2598
  /**
2368
- * 扩展索引2, 业务自行决定,可搜索
2599
+ * Extended index 2, defined by business, searchable
2369
2600
  * @since AIStreamKit 1.0.0
2370
2601
  */
2371
2602
  index2?: string
2372
2603
  /**
2373
- * 缓存数据,JSON格式,不可搜索
2604
+ * Cache data, JSON format, not searchable
2374
2605
  * @since AIStreamKit 1.0.0
2375
2606
  */
2376
2607
  data?: string
2377
2608
  /**
2378
- * 值,不可搜索
2609
+ * Value, not searchable
2379
2610
  * @since AIStreamKit 1.0.0
2380
2611
  */
2381
2612
  value?: string
2382
2613
  /**
2383
- * 扩展值1,不可搜索
2614
+ * Extended value 1, not searchable
2384
2615
  * @since AIStreamKit 1.0.0
2385
2616
  */
2386
2617
  value1?: string
2387
2618
  /**
2388
- * 扩展值2,不可搜索
2619
+ * Extended value 2, not searchable
2389
2620
  * @since AIStreamKit 1.0.0
2390
2621
  */
2391
2622
  value2?: string
@@ -2394,12 +2625,12 @@ declare namespace ty.aistream {
2394
2625
  /** @since AIStreamKit 1.0.0 */
2395
2626
  export interface RecordListResponse {
2396
2627
  /**
2397
- * 记录列表
2628
+ * Record list
2398
2629
  * @since AIStreamKit 1.0.0
2399
2630
  */
2400
2631
  records: RecordBody[]
2401
2632
  /**
2402
- * 记录总数
2633
+ * Total record count
2403
2634
  * @since AIStreamKit 1.0.0
2404
2635
  */
2405
2636
  total: number
@@ -2408,7 +2639,7 @@ declare namespace ty.aistream {
2408
2639
  /** @since AIStreamKit 1.0.0 */
2409
2640
  export interface InsertRecordResponse {
2410
2641
  /**
2411
- * 记录ID
2642
+ * Record ID
2412
2643
  * @since AIStreamKit 1.0.0
2413
2644
  */
2414
2645
  id: number
@@ -2417,7 +2648,7 @@ declare namespace ty.aistream {
2417
2648
  /** @since AIStreamKit 1.0.0 */
2418
2649
  export interface RecordAmplitudesParams {
2419
2650
  /**
2420
- * 振幅柱状数据数量
2651
+ * Amplitude bar data count
2421
2652
  * @since AIStreamKit 1.0.0
2422
2653
  */
2423
2654
  count: number
@@ -2426,7 +2657,7 @@ declare namespace ty.aistream {
2426
2657
  /** @since AIStreamKit 1.0.0 */
2427
2658
  export interface RecordAmplitudesBody {
2428
2659
  /**
2429
- * 振幅数据
2660
+ * Amplitude data
2430
2661
  * @since AIStreamKit 1.0.0
2431
2662
  */
2432
2663
  amplitudes: number[]
@@ -2435,40 +2666,40 @@ declare namespace ty.aistream {
2435
2666
  /** @since AIStreamKit 1.0.0 */
2436
2667
  export interface PlayAudioParams {
2437
2668
  /**
2438
- * 音频缓存路径
2669
+ * Audio cache path
2439
2670
  * @since AIStreamKit 1.0.0
2440
2671
  */
2441
2672
  path: string
2442
2673
  /**
2443
- * 音频编码类型,表示音频数据的编码格式。目前仅支持 `PCM`, `MP3`, `WAV(PCM)` 播放
2674
+ * Audio codec type. Currently only supports `PCM`, `MP3`, `WAV(PCM)` playback
2444
2675
  * - 101: PCM
2445
2676
  * - 109: MP3
2446
- * - 1000: WAV(PCM) App本地定义
2677
+ * - 1000: WAV(PCM) App local definition
2447
2678
  * @since AIStreamKit 1.0.0
2448
2679
  */
2449
2680
  codecType: number
2450
2681
  /**
2451
- * 音频采样率,单位Hz
2452
- * 表示每秒采样次数,常见值:8000, 16000, 22050, 24000, 44100
2682
+ * Audio sample rate in Hz
2683
+ * Number of samples per second, common values: 8000, 16000, 22050, 24000, 44100, etc.
2453
2684
  * @since AIStreamKit 1.0.0
2454
2685
  */
2455
2686
  sampleRate: number
2456
2687
  /**
2457
- * 音频通道数
2458
- * - 0: 单声道
2459
- * - 1: 立体声
2688
+ * Audio channels (AIStreamKit < 2.0: mono=0, stereo=1), since >= 2.0 unified across platforms: 1-mono, 2-stereo
2689
+ * - 1: mono
2690
+ * - 2: stereo
2460
2691
  * @since AIStreamKit 1.0.0
2461
2692
  */
2462
2693
  channels: number
2463
2694
  /**
2464
- * 音频位深,表示每个采样点的位数
2465
- * 常见值:8, 16, 24, 32
2695
+ * Audio bit depth, bits per sample
2696
+ * Common values: 8, 16, 24, 32, etc.
2466
2697
  * @since AIStreamKit 1.0.0
2467
2698
  */
2468
2699
  bitDepth: number
2469
2700
  /**
2470
- * 微秒级时间戳
2471
- * 用于音频回放时的同步
2701
+ * Microsecond timestamp
2702
+ * Used for audio playback synchronization
2472
2703
  * @since AIStreamKit 1.0.0
2473
2704
  */
2474
2705
  pts?: number
@@ -2477,17 +2708,17 @@ declare namespace ty.aistream {
2477
2708
  /** @since AIStreamKit 1.0.0 */
2478
2709
  export interface AudioPlayChangedBody {
2479
2710
  /**
2480
- * 播放文件路径
2711
+ * Playback file path
2481
2712
  * @since AIStreamKit 1.0.0
2482
2713
  */
2483
2714
  path: string
2484
2715
  /**
2485
- * 播放状态: 1-播放开始, 2-缓冲中, 3-缓存完成即将继续播放, 4-播放完成, 5-播放中止(详细原因在 code)
2716
+ * Playback state: 1-playback started, 2-buffering, 3-buffer complete and resuming playback, 4-playback complete, 5-playback stopped (detailed reason in code)
2486
2717
  * @since AIStreamKit 1.0.0
2487
2718
  */
2488
2719
  state: number
2489
2720
  /**
2490
- * 播放中止原因: 1-主动停止播放, 2-播放被异常中断
2721
+ * Playback stop reason: 1-actively stopped, 2-abnormally interrupted
2491
2722
  * @since AIStreamKit 1.0.0
2492
2723
  */
2493
2724
  code?: number
@@ -2496,144 +2727,156 @@ declare namespace ty.aistream {
2496
2727
  /** @since AIStreamKit 1.0.0 */
2497
2728
  export interface RecordAndSendAudioFailBody {
2498
2729
  /**
2499
- * 录制发送异常: 1-发送数据异常, 2-录制音频异常
2730
+ * Recording and sending error: 1-send data error, 2-record audio error
2500
2731
  * @since AIStreamKit 1.0.0
2501
2732
  */
2502
2733
  code: number
2503
2734
  }
2504
2735
 
2505
- /** @since AIStreamKit 1.0.0 */
2736
+ /**
2737
+ * Reserved for future use — no corresponding sendVideoData method is available in the current version
2738
+ * @since AIStreamKit 1.0.0
2739
+ */
2506
2740
  export interface SendVideoParams {
2507
2741
  /**
2508
- * 会话 id
2742
+ * Session id
2509
2743
  * @since AIStreamKit 1.0.0
2510
2744
  */
2511
2745
  sessionId: string
2512
2746
  /**
2513
- * 下发数据通道 Code,当音频只有单路的时候,可以不传
2747
+ * Send data channel code, optional when audio has only single channel
2514
2748
  * @since AIStreamKit 1.0.0
2515
2749
  */
2516
2750
  dataChannel?: string
2517
2751
  /**
2518
- * 摄像头类型
2519
- * 1-前置摄像头, 2-后置摄像头
2752
+ * Camera type
2753
+ * 1-front camera, 2-rear camera
2520
2754
  * @since AIStreamKit 1.0.0
2521
2755
  */
2522
2756
  cameraType: number
2523
2757
  /**
2524
- * 扩展属性。已废弃,请使用 userDataJson
2758
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2525
2759
  * @since AIStreamKit 1.0.0
2526
2760
  */
2527
2761
  userData?: Attribute[]
2528
2762
  /**
2529
- * 扩展属性
2763
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2530
2764
  * @since AIStreamKit 2.0.0
2531
2765
  */
2532
2766
  userDataJson?: string
2533
2767
  }
2534
2768
 
2535
- /** @since AIStreamKit 1.0.0 */
2769
+ /**
2770
+ * Reserved for future use — no corresponding sendFileData method is available in the current version
2771
+ * @since AIStreamKit 1.0.0
2772
+ */
2536
2773
  export interface SendFileDataParams {
2537
2774
  /**
2538
- * 会话 id
2775
+ * Session id
2539
2776
  * @since AIStreamKit 1.0.0
2540
2777
  */
2541
2778
  sessionId: string
2542
2779
  /**
2543
- * 下发数据通道 Code,当音频只有单路的时候,可以不传
2780
+ * Send data channel code, optional when audio has only single channel
2544
2781
  * @since AIStreamKit 1.0.0
2545
2782
  */
2546
2783
  dataChannel?: string
2547
2784
  /**
2548
- * 文件路径
2785
+ * File path
2549
2786
  * @since AIStreamKit 1.0.0
2550
2787
  */
2551
2788
  path: string
2552
2789
  /**
2553
- * 文件类型: 1 - MP4, 2 - OGG_OPUS, 3 - PDF, 4 - JSON, 5 - IPC_LOG, 6 - SweeperMap
2790
+ * File format: 1 - MP4, 2 - OGG_OPUS, 3 - PDF, 4 - JSON, 5 - IPC_LOG, 6 - SweeperMap
2554
2791
  * @since AIStreamKit 1.0.0
2555
2792
  */
2556
2793
  format: number
2557
2794
  /**
2558
- * 扩展属性。已废弃,请使用 userDataJson
2795
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2559
2796
  * @since AIStreamKit 1.0.0
2560
2797
  */
2561
2798
  userData?: Attribute[]
2562
2799
  /**
2563
- * 扩展属性
2800
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2564
2801
  * @since AIStreamKit 2.0.0
2565
2802
  */
2566
2803
  userDataJson?: string
2567
2804
  }
2568
2805
 
2569
- /** @since AIStreamKit 1.0.0 */
2806
+ /**
2807
+ * Reserved for future use — no corresponding onVideoReceived event is available in the current version
2808
+ * @since AIStreamKit 1.0.0
2809
+ */
2570
2810
  export interface VideoBody {
2571
2811
  /**
2572
- * 接收数据通道 Code
2812
+ * Receive data channel code
2573
2813
  * @since AIStreamKit 1.0.0
2574
2814
  */
2575
2815
  dataChannel: string
2576
2816
  /**
2577
- * 数据流类型: 0-仅一包, 1-传输开始, 2-传输中, 3-传输结束
2817
+ * Stream flag: 0-single packet, 1-transfer start, 2-transferring, 3-transfer end
2578
2818
  * @since AIStreamKit 1.0.0
2579
2819
  */
2580
2820
  streamFlag: number
2581
2821
  /**
2582
- * 视频缓存路径,传输结束后可访问(streamFlag == 1 || StreamFlag == 3)
2822
+ * Video cache path, accessible after transfer ends (streamFlag == 1 || streamFlag == 3)
2583
2823
  * @since AIStreamKit 1.0.0
2584
2824
  */
2585
2825
  path: string
2586
2826
  /**
2587
- * 扩展属性。已废弃,请使用 userDataJson
2827
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2588
2828
  * @since AIStreamKit 1.0.0
2589
2829
  */
2590
2830
  userData?: Attribute[]
2591
2831
  /**
2592
- * 扩展属性
2832
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2593
2833
  * @since AIStreamKit 2.0.0
2594
2834
  */
2595
2835
  userDataJson?: string
2596
2836
  /**
2597
- * SessionId 列表, 云端返回,可能为空
2837
+ * SessionId list, returned by cloud, may be empty
2598
2838
  * @since AIStreamKit 1.0.0
2599
2839
  */
2600
2840
  sessionIdList?: string[]
2601
2841
  }
2602
2842
 
2603
- /** @since AIStreamKit 1.0.0 */
2843
+ /**
2844
+ * Reserved for future use — no corresponding onFileReceived event is available in the current version
2845
+ * @since AIStreamKit 1.0.0
2846
+ */
2604
2847
  export interface FileBody {
2605
2848
  /**
2606
- * 接收数据通道 Code
2849
+ * Receive data channel code
2607
2850
  * @since AIStreamKit 1.0.0
2608
2851
  */
2609
2852
  dataChannel: string
2610
2853
  /**
2611
- * 数据流类型: 0-仅一包, 1-传输开始, 2-传输中, 3-传输结束
2854
+ * Stream flag: 0-single packet, 1-transfer start, 2-transferring, 3-transfer end
2612
2855
  * @since AIStreamKit 1.0.0
2613
2856
  */
2614
2857
  streamFlag: number
2615
2858
  /**
2616
- * 文件缓存路径,传输结束后可访问(streamFlag == 1 || StreamFlag == 3)
2859
+ * File cache path, accessible after transfer ends (streamFlag == 1 || streamFlag == 3)
2617
2860
  * @since AIStreamKit 1.0.0
2618
2861
  */
2619
2862
  path: string
2620
2863
  /**
2621
- * 文件类型: 1 - MP4, 2 - OGG_OPUS, 3 - PDF, 4 - JSON, 5 - IPC_LOG, 6 - SweeperMap
2864
+ * File format: 1 - MP4, 2 - OGG_OPUS, 3 - PDF, 4 - JSON, 5 - IPC_LOG, 6 - SweeperMap
2622
2865
  * @since AIStreamKit 1.0.0
2623
2866
  */
2624
2867
  format: number
2625
2868
  /**
2626
- * 扩展属性。已废弃,请使用 userDataJson
2869
+ * Extended attributes. Deprecated since AIStreamKit >= 2.0, use userDataJson instead
2627
2870
  * @since AIStreamKit 1.0.0
2628
2871
  */
2629
2872
  userData?: Attribute[]
2630
2873
  /**
2631
- * 扩展属性
2874
+ * Extended attributes JSON, enabled since AIStreamKit >= 2.0
2632
2875
  * @since AIStreamKit 2.0.0
2633
2876
  */
2634
2877
  userDataJson?: string
2635
2878
  /**
2636
- * SessionId 列表, 云端返回,可能为空
2879
+ * SessionId list, returned by cloud, may be empty
2637
2880
  * @since AIStreamKit 1.0.0
2638
2881
  */
2639
2882
  sessionIdList?: string[]