You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# coding=utf-8
import requests
import json
import urllib3
from Config import *
if __name__ == '__main__':
# 禁止警告
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# Send request.
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + HW_API_KEY # 把yourApiKey替换成真实的API Key
}
# 系统提示词
system_prompt = '''回答以下内容:
1. 这道题目有哪些知识点,哪些能力点
2. 生成Neo4j 5.26.2的插入语句'''
shiti_content = '''
下面是一道小学三年级的数学题目,巧求周长:
把7个完全相同的小长方形拼成如图的样子已知每个小长方形的长是10厘米则拼成的大长方形的周长是多少厘米
'''
data = {
"model": HW_MODEL_NAME,
"max_tokens": 10000,
"messages": [
{"role": "system", "content": system_prompt},
{"role": "user", "content": shiti_content}
],
"stream": False,
"temperature": 1.0
}
resp = requests.post(HW_API_URL, headers=headers, data=json.dumps(data), verify=False)
# Print result.
print(resp.status_code)
print(resp.text)