From d8321c29db79da16d40baf55f9315997df181425 Mon Sep 17 00:00:00 2001 From: 55007 <55007@maojian> Date: Tue, 7 Jan 2025 16:42:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .classpath | 47 ++---------------------- src/test/java/com/bfd/AppTest.java | 73 -------------------------------------- 2 files changed, 2 insertions(+), 118 deletions(-) delete mode 100644 src/test/java/com/bfd/AppTest.java diff --git a/.classpath b/.classpath index 5e6428b..f7e4a1d 100644 --- a/.classpath +++ b/.classpath @@ -1,4 +1,3 @@ -<<<<<<< HEAD @@ -7,47 +6,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -======= - - - - - - - - @@ -55,9 +19,10 @@ - + + @@ -71,13 +36,5 @@ - - - - - - - ->>>>>>> branch 'master' of http://82.156.111.58:3000/maojian/appliction_manager.git diff --git a/src/test/java/com/bfd/AppTest.java b/src/test/java/com/bfd/AppTest.java deleted file mode 100644 index 3f7e535..0000000 --- a/src/test/java/com/bfd/AppTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.bfd; - -<<<<<<< HEAD -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.bfd.qanda.token.TokenManagerV3; -import com.bfd.qanda.utils.DownLoadUtil; - - -/** - * @author jian.mao - * @date 2023年11月13日 - * @description - */ -public class AppTest { - public static void main(String[] args) { -// String token = TokenManagerV3.getToken("46d834d33699ab5cc2cba4d1f9ffa96d", "XqIB1P3mxTMYGa5D"); - String token = TokenManagerV3.getToken("9b1539749531dfc4d7615f51df700875", "HP0azw6gD0yIsbvt"); -// String url = "https://open.bigmodel.cn/api/paas/v3/model-api/chatglm_turbo/invoke"; -// String url = "https://open.bigmodel.cn/api/paas/v4/chat/completions"; - String url = "https://open.bigmodel.cn/api/paas/v4/chat/completions"; - Map headers = new HashMap(16); - Map params = new HashMap(16); - List> prompt = new ArrayList>(); - Map chat1 = new HashMap(16); - String chatContent = "从下文中提取带有数字、产能等内容的关键句,没有相关内同请返回null。文本如下:共同富裕是社会主义的本质要求,是中国式现代化的重要特征。习近平总书记强调,“随着我国全面建成小康社会、开启全面建设社会主义现代化国家新征程,我们必须把促进全体人民共同富裕摆在更加重要的位置,脚踏实地,久久为功,向着这个目标更加积极有为地进行努力”。习近平总书记关于共同富裕的一系列重要论述,丰富和发展了马克思主义理论,丰富和发展了新时代中国共产党执政理念和治国方略,是对中国共产党人带领全体人民实现共同富裕奋斗目标的当代探索与实践,为我国实现第二个百年奋斗目标指明了方向、提供了遵循。"; - chat1.put("role", "user"); - chat1.put("content", chatContent); - - prompt.add(chat1); - params.put("model", "glm-3-turbo"); - params.put("messages", prompt); - params.put("temperature", 0.95); - params.put("top_p", 0.7); - headers.put("Authorization", "Bearer "+token); - headers.put("Content-Type", "application/json"); - String html = DownLoadUtil.doPost(url, JSONObject.toJSONString(params),headers); - System.out.println(html); - Map map = JSONObject.parseObject(html); - List> choices = (List>) map.get("choices"); - Map message = (Map) choices.get(0).get("message"); - String content = (String) message.get("content"); - System.out.println(content); -// List parseArray = JSONObject.parseArray(content, String.class); -// System.out.println(parseArray); -// Map result = JSONObject.parseObject(content.replace("\\n", "")); -// System.out.println(result); - } -======= -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -/** - * Unit test for simple App. - */ -public class AppTest -{ - /** - * Rigorous Test :-) - */ - @Test - public void shouldAnswerWithTrue() - { - assertTrue( true ); - } ->>>>>>> branch 'master' of http://82.156.111.58:3000/maojian/appliction_manager.git -}