chat().createAndPoll()执行完成之后程序不会结束
- Langage dominant
- Java
- Étoiles
- 214
- Forks
- 98
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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();
}
`

Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Start by running the supplied Java main example with chat().createAndPoll(req, 3000L), then inspect the lifecycle around createAndPoll and coze.shutdownExecutor(). Confirm whether the process remains alive after the response is printed and define done as the program exiting cleanly after polling completes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- api
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 32/100