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