Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

流式对话异常 NoSuchElementException #471

Open
jackdeng1202 opened this issue Apr 22, 2024 · 1 comment
Open

流式对话异常 NoSuchElementException #471

jackdeng1202 opened this issue Apr 22, 2024 · 1 comment

Comments

@jackdeng1202
Copy link

jackdeng1202 commented Apr 22, 2024

System Info

  1. qianfan version -0.0.2
  2. System Version -java8 -android 9.0
  3. language - kotlin

Reproduction

  1. implementation "com.baidubce:qianfan:0.0.2"

  2. call api:

          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)
           }
    
  3. 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)

@Azure99
Copy link
Collaborator

Azure99 commented Apr 22, 2024

请先更新到0.0.4版本,然后使用非流式发起请求,检查下报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants