From af1a636c2d35ed43b1c2ef343a089d8e3923a3e4 Mon Sep 17 00:00:00 2001 From: WANGXING130 <3551764468@qq.com> Date: Sat, 16 Nov 2024 10:37:19 +0800 Subject: [PATCH 1/2] Update README.md --- Midterm/Task3/README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Midterm/Task3/README.md b/Midterm/Task3/README.md index 616de61..9db5c5f 100644 --- a/Midterm/Task3/README.md +++ b/Midterm/Task3/README.md @@ -2,5 +2,37 @@ 请补充个人信息后,在此完成报告! +接入LLM的web-api +~~~python +import time +from zhipuai import ZhipuAI + +questions = input('请输入你的问题:') + +client = ZhipuAI(api_key="c5b203c6b5273632daba494387afdb75.MhywiWSvmqnf4DY4") # 请填写您自己的APIKey + +response = client.chat.asyncCompletions.create( + model="glm-4-plus", # 请填写您要调用的模型名称 + messages=[ + { + "role": "user", + "content": + "questions" +} +], +) +task_id = response.id +task_status = '' +get_cnt = 0 + +while task_status != 'SUCCESS' and task_status != 'FAILED' and get_cnt <= 40: + result_response = client.chat.asyncCompletions.retrieve_completion_result(id=task_id) + print(result_response) + task_status = result_response.task_status + + time.sleep(2) + get_cnt += 1 +~~~ + @Author: @Email: From 51b2c97cd4332fab2b4d26a15916fb5b3c2ff343 Mon Sep 17 00:00:00 2001 From: WANGXING130 <3551764468@qq.com> Date: Sat, 16 Nov 2024 17:31:51 +0800 Subject: [PATCH 2/2] commit --- Midterm/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Midterm/README.md b/Midterm/README.md index 671fe32..b27f038 100644 --- a/Midterm/README.md +++ b/Midterm/README.md @@ -202,4 +202,10 @@ python 因为其易用性,在数学建模中,发挥着重要的作用。因 | :---------: | :--------------------------------------------: | | 17999824wyj | https://github.com/NEUP-Net-Depart/P-2024-plan | | github 昵称 | 上面是示例,这行留着,在下面另起一行去写 | -| | | +| gmyy00 | https://github.com/gmyy00/P-2024-plan | +| neltha | https://github.com/ne1tha/P-2024-plan.git | +| chiyuki0325 | https://github.com/chiyuki0325/P-2024-plan | +| Red-Sa1t | https://github.com/Red-Sa1t/P-2024-plan | +| mumu948 | https://github.com/mumu948/P-2024-plan | +| WANXING130 | https://github.com/WANGXING130/P-2024.git | +