NIMSDK-AOS  10.9.50
V2NIMAIModelStreamCallChunk.java
浏览该文件的文档.
1 package com.netease.nimlib.sdk.v2.ai.model;
2 
3 import com.netease.nimlib.log.NimLog;
4 import com.netease.nimlib.util.EncryptUtil;
5 import java.io.Serializable;
6 
7 /**
8  * V2NIMAIModelStreamCallChunk类
9  * <p>
10  * 代理请求响应的流式分片信息。
11  * </p>
12  *
13  * @author jintao
14  * @version 1.0
15  */
16 public class V2NIMAIModelStreamCallChunk implements Serializable {
17 
18  /**
19  * 数字人流式回复分片文本
20  */
21  private String content;
22 
23  /**
24  * 数字人流式回复当前分片时间
25  */
26  private long chunkTime;
27 
28  /**
29  * 类型,当前仅支持0表示文本
30  */
31  private int type;
32 
33  /**
34  * 分片序号,从0开始
35  */
36  private int index;
37 
38 
39  private V2NIMAIModelStreamCallChunk(){}
40 
41  public V2NIMAIModelStreamCallChunk(String content, long chunkTime, int type, int index) {
42  this.content = content;
43  this.chunkTime = chunkTime;
44  this.type = type;
45  this.index = index;
46  }
47 
48  /**
49  * 获取数字人流式回复分片文本。
50  *
51  * @return 分片文本内容
52  */
53  public String getContent() {
54  return content;
55  }
56 
57  /**
58  * 获取数字人流式回复当前分片时间。
59  *
60  * @return 当前分片时间(毫秒)
61  */
62  public long getChunkTime() {
63  return chunkTime;
64  }
65 
66  /**
67  * 获取类型,当前仅支持0表示文本。
68  *
69  * @return 类型值
70  */
71  public int getType() {
72  return type;
73  }
74 
75  /**
76  * 获取分片序号,从0开始。
77  *
78  * @return 分片序号
79  */
80  public int getIndex() {
81  return index;
82  }
83 
84  @Override
85  public String toString() {
86  if (NimLog.isDebugLog()) {
87  final StringBuilder sb = new StringBuilder("V2NIMAIModelStreamCallChunk{");
88  sb.append("content='").append(content).append('\'');
89  sb.append(", chunkTime=").append(chunkTime);
90  sb.append(", type=").append(type);
91  sb.append(", index=").append(index);
92  sb.append('}');
93  return sb.toString();
94  }else {
95  final StringBuilder sb = new StringBuilder("V2NIMAIModelStreamCallChunk{");
96  sb.append("content='").append(EncryptUtil.encryptBase64(content)).append('\'');
97  sb.append(", chunkTime=").append(chunkTime);
98  sb.append(", type=").append(type);
99  sb.append(", index=").append(index);
100  sb.append('}');
101  return sb.toString();
102  }
103 
104  }
105 }
int getType()
获取类型,当前仅支持0表示文本。
long getChunkTime()
获取数字人流式回复当前分片时间。
V2NIMAIModelStreamCallChunk(String content, long chunkTime, int type, int index)
String getContent()
获取数字人流式回复分片文本。