Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 2 #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Midterm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

32 changes: 32 additions & 0 deletions Midterm/Task3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: