OliveSensorAPI/IOTLLM/generate_data/EC_process/api_test.py

24 lines
547 B
Python
Raw Normal View History

2024-11-11 17:32:36 +08:00
import requests
import json
url = "https://chatapi.midjourney-vip.cn/v1/chat/completions"
payload = json.dumps({
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "测试"
}
]
})
headers = {
'Accept': 'application/json',
'Authorization': 'sk-ATDf2Ax1YTGeeTaBD9Be2a7bE0064618Ae3378EaF0Df6f24',
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)