Provide best practices for LMOps, as well as elegant and convenient access to the features of the Qianfan MaaS Platform. (提供大模型工具链最佳实践,以及优雅且便捷地访问千帆大模型平台)
val iterator = qianfan.chatCompletion()
.model("ERNIE-Bot-4")
.temperature(0.7)
.addMessage("user", "hello")
.executeStream()
while (iterator.hasNext()) {
var chunk = iterator.next()
Log.i(TAG, "result: " + chunk)
}
See error:
java.util.NoSuchElementException
at com.baidubce.qianfan.util.http.SSEWrapper$1.next(SSEWrapper.java:59)
at com.baidubce.qianfan.util.http.SSEWrapper$1.next(SSEWrapper.java:30)
at com.baidubce.qianfan.QianfanClient$StreamIterator.next(QianfanClient.java:118)
System Info
Reproduction
implementation "com.baidubce:qianfan:0.0.2"
call api:
See error:
java.util.NoSuchElementException at com.baidubce.qianfan.util.http.SSEWrapper$1.next(SSEWrapper.java:59) at com.baidubce.qianfan.util.http.SSEWrapper$1.next(SSEWrapper.java:30) at com.baidubce.qianfan.QianfanClient$StreamIterator.next(QianfanClient.java:118)