From 8699cadf986e722a1c7ad8daf720344f9d01f6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=82=85=E5=93=A5?= <184172133@qq.com> Date: Thu, 9 Nov 2023 20:54:37 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E8=A1=A5=E5=85=85=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/bugstack/chatglm/test/ApiTest.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/test/java/cn/bugstack/chatglm/test/ApiTest.java b/src/test/java/cn/bugstack/chatglm/test/ApiTest.java index 750d78e..e141178 100644 --- a/src/test/java/cn/bugstack/chatglm/test/ApiTest.java +++ b/src/test/java/cn/bugstack/chatglm/test/ApiTest.java @@ -50,14 +50,25 @@ public class ApiTest { // 入参;模型、请求信息 ChatCompletionRequest request = new ChatCompletionRequest(); request.setModel(Model.CHATGLM_LITE); // chatGLM_6b_SSE、chatglm_lite、chatglm_lite_32k、chatglm_std、chatglm_pro + request.setIncremental(false); request.setPrompt(new ArrayList() { private static final long serialVersionUID = -7988151926241837899L; { + add(ChatCompletionRequest.Prompt.builder() + .role(Role.user.getCode()) + .content("1+2") + .build()); + + add(ChatCompletionRequest.Prompt.builder() + .role(Role.user.getCode()) + .content("Okay") + .build()); + /* system 和 user 为一组出现。如果有参数类型为 system 则 system + user 一组一起传递。*/ add(ChatCompletionRequest.Prompt.builder() .role(Role.system.getCode()) - .content("请问有什么需要帮助的吗") + .content("1+1=2") .build()); add(ChatCompletionRequest.Prompt.builder() @@ -67,13 +78,9 @@ public class ApiTest { add(ChatCompletionRequest.Prompt.builder() .role(Role.user.getCode()) - .content("你是一个专业的互联网文章作者,擅长互联网技术介绍、互联网商业、技术应用等方面的写作。\n" + - "接下来你要根据用户给你的主题,拓展生成用户想要的文字内容,内容可能是一篇文章、一个开头、一段介绍文字、文章总结、文章结尾等等。\n" + - "要求语言通俗易懂、幽默有趣,并且要以第一人称的口吻。") + .content("1+2") .build()); - - } }); -- GitLab