Skip to content

chat().createAndPoll()执行完成之后程序不会结束 #121

@wweyl

Description

@wweyl

chat().createAndPoll()执行完成之后程序不会结束。程序一直挂在那,貌似有什么线程卡住了。
`
public static void main(String[] args) throws Exception {
String cozeAPIToken = "cozeAPIToken";
String cozeAPIBase = Consts.COZE_CN_BASE_URL;
CozeAPI coze = new CozeAPI.Builder().auth(new TokenAuth(cozeAPIToken)).baseURL(cozeAPIBase).build();

  CreateChatReq req =
          CreateChatReq.builder()
                  .botID("botID")
                  .userID("123")
                  .messages(Collections.singletonList(Message.buildUserQuestionText("翻译\"你好,世界!\"")))
                  .build();
  ChatPoll chat2 = coze.chat().createAndPoll(req, 3000L);
  System.out.println(chat2.getMessages().get(0).getContent());
  coze.shutdownExecutor();

}
`

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions