node-nim 10.8.10 → 10.8.30-beta.215

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,4 +1,4 @@
1
- import { V2NIMAIModelType, V2NIMAsymmetricEncryptionAlgorithm, V2NIMChatroomKickedReason, V2NIMChatroomMemberRole, V2NIMChatroomMessageNotificationType, V2NIMChatroomQueueChangeType, V2NIMChatroomQueueLevelMode, V2NIMClientAntispamOperateType, V2NIMClientAntispamThesaurusMatchType, V2NIMConversationType, V2NIMDataSyncType, V2NIMDownloadAttachmentType, V2NIMFCSAuthType, V2NIMFriendAddApplicationStatus, V2NIMFriendAddMode, V2NIMIPProtocolVersion, V2NIMLoginAuthType, V2NIMLoginClientType, V2NIMMessageAttachmentUploadState, V2NIMMessageClientAntispamOperatorType, V2NIMMessageNotificationType, V2NIMMessagePinState, V2NIMMessageRevokeType, V2NIMMessageSendingState, V2NIMMessageType, V2NIMProxyRequestMethod, V2NIMQueryDirection, V2NIMSDKLogLevel, V2NIMSignallingChannelType, V2NIMSignallingEventType, V2NIMSortOrder, V2NIMSQLCipherVersion, V2NIMSymmetricEncryptionAlgorithm, V2NIMTeamAgreeMode, V2NIMTeamChatBannedMode, V2NIMTeamInviteMode, V2NIMTeamJoinActionStatus, V2NIMTeamJoinActionType, V2NIMTeamJoinMode, V2NIMTeamMemberRole, V2NIMTeamMemberRoleQueryType, V2NIMTeamType, V2NIMTeamUpdateExtensionMode, V2NIMTeamUpdateInfoMode, V2NIMSearchKeywordMathType, V2NIMClearHistoryMode, V2NIMAIModelRoleType } from './v2_nim_enum_def';
1
+ import { V2NIMAIModelType, V2NIMMessageAIStatus, V2NIMAsymmetricEncryptionAlgorithm, V2NIMChatroomKickedReason, V2NIMChatroomMemberRole, V2NIMChatroomMessageNotificationType, V2NIMChatroomQueueChangeType, V2NIMChatroomQueueLevelMode, V2NIMClientAntispamOperateType, V2NIMClientAntispamThesaurusMatchType, V2NIMConversationType, V2NIMDataSyncType, V2NIMDownloadAttachmentType, V2NIMFCSAuthType, V2NIMFriendAddApplicationStatus, V2NIMFriendAddMode, V2NIMIPProtocolVersion, V2NIMLoginAuthType, V2NIMLoginClientType, V2NIMMessageAttachmentUploadState, V2NIMMessageClientAntispamOperatorType, V2NIMMessageNotificationType, V2NIMMessagePinState, V2NIMMessageRevokeType, V2NIMMessageSendingState, V2NIMMessageType, V2NIMProxyRequestMethod, V2NIMQueryDirection, V2NIMSDKLogLevel, V2NIMSignallingChannelType, V2NIMSignallingEventType, V2NIMSortOrder, V2NIMSQLCipherVersion, V2NIMSymmetricEncryptionAlgorithm, V2NIMTeamAgreeMode, V2NIMTeamChatBannedMode, V2NIMTeamInviteMode, V2NIMTeamJoinActionStatus, V2NIMTeamJoinActionType, V2NIMTeamJoinMode, V2NIMTeamMemberRole, V2NIMTeamMemberRoleQueryType, V2NIMTeamType, V2NIMTeamUpdateExtensionMode, V2NIMTeamUpdateInfoMode, V2NIMSearchKeywordMathType, V2NIMClearHistoryMode, V2NIMAIModelRoleType, V2NIMMessageAIStreamStatus, V2NIMAIModelStreamCallStatus, V2NIMMessageAIStreamStopOpType, V2NIMMessageAIRegenOpType } from './v2_nim_enum_def';
2
2
  export interface V2NIMError {
3
3
  /** 错误码, 详见 V2NIMErrorCode */
4
4
  code?: number;
@@ -444,6 +444,21 @@ export interface V2NIMAIModelConfigParams {
444
444
  /** 取值范围(0,2),用于控制随机性和多样性的程度。 */
445
445
  temperature?: number;
446
446
  }
447
+ /** @brief 消息 AI RAG 信息 @since v10.8.30 */
448
+ export interface V2NIMAIRAGInfo {
449
+ /** 引用资源的名称 */
450
+ name: string;
451
+ /** 引用资源的描述 */
452
+ description: string;
453
+ /** 引用资源的图标 */
454
+ icon: string;
455
+ /** 引用资源的链接 */
456
+ url: string;
457
+ /** 引用资源的标题 */
458
+ title: string;
459
+ /** 引用资源的时间 */
460
+ time: number;
461
+ }
447
462
  export interface V2NIMAIModelCallResult {
448
463
  /** AI 响应的状态码 */
449
464
  code?: number;
@@ -453,6 +468,14 @@ export interface V2NIMAIModelCallResult {
453
468
  requestId?: string;
454
469
  /** 请求 AI 的回复 */
455
470
  content?: V2NIMAIModelCallContent;
471
+ /** 数字人回复内容的引用资源列表 @since v10.8.30 */
472
+ aiRAGs?: Array<V2NIMAIRAGInfo>;
473
+ /** 回复的时间戳 @since v10.8.30 */
474
+ timestamp: number;
475
+ /** 是否是流式响应,默认 false @since v10.8.30 */
476
+ aiStream: boolean;
477
+ /** 数字人流式响应状态 @since v10.8.30 */
478
+ aiStreamStatus: V2NIMAIModelStreamCallStatus;
456
479
  }
457
480
  export interface V2NIMProxyAIModelCallParams {
458
481
  /** 机器人账号 ID */
@@ -468,6 +491,20 @@ export interface V2NIMProxyAIModelCallParams {
468
491
  /** 请求接口模型相关参数配置, 如果参数不为空,则默认覆盖控制相关配置 */
469
492
  modelConfigParams?: V2NIMAIModelConfigParams;
470
493
  }
494
+ export interface V2NIMMessageAIConfig {
495
+ /** 数字人账号信息 */
496
+ accountId?: string;
497
+ /** 缺省表示普通消息 */
498
+ aiStatus?: V2NIMMessageAIStatus;
499
+ /** 是否是流式消息 @since v10.8.30 */
500
+ aiStream: boolean;
501
+ /** 流式消息状态 @since v10.8.30 */
502
+ aiStreamStatus: V2NIMMessageAIStreamStatus;
503
+ /** AI RAG(Retrieval-Augmented Generation) 信息 @since v10.8.30 */
504
+ aiRAGs?: Array<V2NIMAIRAGInfo>;
505
+ /** 流式消息的分片信息 @since v10.8.30 */
506
+ aiStreamLastChunk?: V2NIMMessageAIStreamChunk;
507
+ }
471
508
  export interface V2NIMMessage {
472
509
  /** 客户端消息 id */
473
510
  messageClientId?: string;
@@ -522,7 +559,7 @@ export interface V2NIMMessage {
522
559
  /** 消息发送者是否是自己 */
523
560
  isSelf?: boolean;
524
561
  /** AI 数字人相关信息 */
525
- aiConfig?: V2NIMAIModelConfig;
562
+ aiConfig?: V2NIMMessageAIConfig;
526
563
  /** 消息更新时间 */
527
564
  modifyTime?: number;
528
565
  /** 消息更新者账号 */
@@ -595,13 +632,18 @@ export interface V2NIMMessageTargetConfig {
595
632
  newMemberVisible?: boolean;
596
633
  }
597
634
  export interface V2NIMAIModelCallMessage {
635
+ /** 上下文内容的角色 */
598
636
  role: V2NIMAIModelRoleType;
637
+ /** 上下文的内容 */
599
638
  msg: string;
639
+ /** 类型, 暂时只有 0, 代表文本, 预留扩展能力 */
600
640
  type: number;
601
641
  }
602
642
  export interface V2NIMMessageAIConfigParams {
603
643
  /** 数字人账号信息 */
604
644
  accountId: string;
645
+ /** 是否是流式响应,默认 false @since v10.8.30 */
646
+ aiStream: boolean;
605
647
  /** 请求大模型的内容 */
606
648
  content?: V2NIMAIModelCallContent;
607
649
  /** 上下文内容 */
@@ -2083,6 +2125,7 @@ export interface V2NIMCustomUserStatusPublishResult {
2083
2125
  /** 用户状态发布时的时间 */
2084
2126
  publishTime: number;
2085
2127
  }
2128
+ /** @brief 用户状态订阅结果 */
2086
2129
  export interface V2NIMUserStatusSubscribeResult {
2087
2130
  /** 查询的用户账号 */
2088
2131
  accountId: string;
@@ -2150,6 +2193,8 @@ export interface V2NIMMessageSearchExParams {
2150
2193
  senderAccountIds?: Array<string>;
2151
2194
  /** 匹配消息类型,为空则匹配所有类型 */
2152
2195
  messageTypes?: Array<V2NIMMessageType>;
2196
+ /** 匹配消息子类型,为空则匹配所有子类型 @since v10.8.10 */
2197
+ messageSubtypes?: Array<number>;
2153
2198
  /** 搜索的起始时间点,默认为 0(从现在开始搜索)。UTC 时间戳,单位:毫秒 */
2154
2199
  searchStartTime: number;
2155
2200
  /** 从起始时间点开始的过去时间范围,默认为 0(不限制时间范围)。24 x 60 x 60 x 1000 代表过去一天,单位:毫秒 */
@@ -2161,8 +2206,11 @@ export interface V2NIMMessageSearchExParams {
2161
2206
  }
2162
2207
  /** @brief 查询消息返回的结果项 @since v10.7.0 */
2163
2208
  export interface V2NIMMessageSearchItem {
2209
+ /** 会话 ID */
2164
2210
  conversationId: string;
2211
+ /** 返回的消息列表 */
2165
2212
  messages: Array<V2NIMMessage>;
2213
+ /** 单个会话命中的数量 */
2166
2214
  count: number;
2167
2215
  }
2168
2216
  /** @brief 查询消息返回的结果 @since v10.7.0 */
@@ -2259,3 +2307,70 @@ export interface V2NIMLocalConversationOperationResult {
2259
2307
  /** 错误 */
2260
2308
  error?: V2NIMError;
2261
2309
  }
2310
+ /** @brief 消息 AI 流式消息分片信息 @since v10.8.30 */
2311
+ export interface V2NIMMessageAIStreamChunk {
2312
+ /** 流式消息回复分片文本 */
2313
+ content: string;
2314
+ /** 流式消息时间,即占位消息时间 */
2315
+ messageTime: number;
2316
+ /** 流式消息当前分片时间,chunkTime >= messageTime */
2317
+ chunkTime: number;
2318
+ /** 类型,当前仅支持 0 表示文本 */
2319
+ type: number;
2320
+ /** 分片序号,从 0 开始 */
2321
+ index: number;
2322
+ }
2323
+ /** @brief 停止数字人流式输出配置参数 @since v10.8.30 */
2324
+ export interface V2NIMMessageAIStreamStopParams {
2325
+ /** 停止流式消息的操作类型 */
2326
+ operationType: V2NIMMessageAIStreamStopOpType;
2327
+ /** 更新的消息内容,仅当 operationType == V2NIM_MESSAGE_AI_STREAM_STOP_OP_UPDATE 有效 */
2328
+ updateContent?: string;
2329
+ }
2330
+ /** @brief 重新生成 AI 回复消息参数 @since v10.8.30 */
2331
+ export interface V2NIMMessageAIRegenParams {
2332
+ /** 重新输出数字人消息操作类型 */
2333
+ operationType: V2NIMMessageAIRegenOpType;
2334
+ }
2335
+ /** @brief 透传协议流式分片信息 @since v10.8.30 */
2336
+ export interface V2NIMAIModelStreamCallChunk {
2337
+ /** 数字人流式回复分片文本 */
2338
+ content: string;
2339
+ /** 数字人流式回复当前分片时间 */
2340
+ chunkTime: number;
2341
+ /** 类型,当前仅支持 0 表示文本 */
2342
+ type: number;
2343
+ /** 分片序号,从 0 开始 */
2344
+ index: number;
2345
+ }
2346
+ /** @brief 流式回复内容 @since v10.8.30 */
2347
+ export interface V2NIMAIModelStreamCallContent {
2348
+ /** 数字人流式回复分片组装好后的文本 */
2349
+ msg: string;
2350
+ /** 类型,当前仅支持 0 表示文本 */
2351
+ type: number;
2352
+ /** 数字人流式回复最近一个分片 */
2353
+ lastChunk: V2NIMAIModelStreamCallChunk;
2354
+ }
2355
+ /** @brief 发送透传的 AI 流式消息响应内容 @since v10.8.30 */
2356
+ export interface V2NIMAIModelStreamCallResult {
2357
+ /** AI 响应的状态码 */
2358
+ code: number;
2359
+ /** 数字人的账号 ID */
2360
+ accountId: string;
2361
+ /** 本次响应的标识 */
2362
+ requestId: string;
2363
+ /** 请求 AI 的回复内容 */
2364
+ content?: V2NIMAIModelStreamCallContent;
2365
+ /** 数字人回复内容的引用资源列表 */
2366
+ aiRAGs?: Array<V2NIMAIRAGInfo>;
2367
+ /** 分片的时间戳 */
2368
+ timestamp: number;
2369
+ }
2370
+ /** @brief 停止透传接口的 AI 流式回复 @since v10.8.30 */
2371
+ export interface V2NIMAIModelStreamCallStopParams {
2372
+ /** 数字人账号 ID */
2373
+ accountId: string;
2374
+ /** 请求 ID */
2375
+ requestId: string;
2376
+ }