From 65acb6cba07be540410586315edf8749531bbabb 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, 2 Nov 2023 22:13:09 +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 --- src/main/java/cn/bugstack/chatglm/model/Role.java | 4 ++++ src/test/java/cn/bugstack/chatglm/test/ApiTest.java | 1 + 2 files changed, 5 insertions(+) diff --git a/src/main/java/cn/bugstack/chatglm/model/Role.java b/src/main/java/cn/bugstack/chatglm/model/Role.java index df0bf7e..2b7aa9a 100644 --- a/src/main/java/cn/bugstack/chatglm/model/Role.java +++ b/src/main/java/cn/bugstack/chatglm/model/Role.java @@ -20,6 +20,10 @@ public enum Role { * 模型生成的内容,role位assistant */ assistant("assistant"), + + /** + * 系统 + */ system("system"), ; diff --git a/src/test/java/cn/bugstack/chatglm/test/ApiTest.java b/src/test/java/cn/bugstack/chatglm/test/ApiTest.java index bdd1d88..5e40c45 100644 --- a/src/test/java/cn/bugstack/chatglm/test/ApiTest.java +++ b/src/test/java/cn/bugstack/chatglm/test/ApiTest.java @@ -62,6 +62,7 @@ public class ApiTest { "要求语言通俗易懂、幽默有趣,并且要以第一人称的口吻。") .build()); + /* system 和 user 为一组出现 */ add(ChatCompletionRequest.Prompt.builder() .role(Role.system.getCode()) .content("请问有什么需要帮助的吗") -- GitLab