mirror of
http://47.106.207.27:3000/Jeremy_liu/AI0814_jiaoan_public.git
synced 2026-09-27 06:14:14 +08:00
38 lines
762 B
Python
38 lines
762 B
Python
import requests
|
|
import json
|
|
|
|
url = "https://api.deepseek.com/responses"
|
|
|
|
payload = json.dumps({
|
|
"model": "deepseek-flash",
|
|
"input": "你好",
|
|
"instructions": "string",
|
|
"reasoning": {
|
|
"effort": "none"
|
|
},
|
|
"max_output_tokens": 4096,
|
|
"stream": False,
|
|
"temperature": 1,
|
|
"top_p": 1,
|
|
"text": {
|
|
"format": {
|
|
"type": "text",
|
|
"name": "string",
|
|
"schema": {}
|
|
}
|
|
},
|
|
"tools": None,
|
|
"tool_choice": "none",
|
|
"top_logprobs": None,
|
|
"user": "string"
|
|
})
|
|
print(payload,type(payload))
|
|
headers = {
|
|
'Content-Type': 'application/json',
|
|
'Accept': 'application/json',
|
|
'Authorization': 'Bearer sk-83c3ebe6b1b04bdf93c3c4be9b17736d'
|
|
}
|
|
|
|
response = requests.request("POST", url, headers=headers, data=payload)
|
|
|
|
print(response.text) |