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.
27 lines
573 B
27 lines
573 B
import requests
|
|
import json
|
|
from Config import *
|
|
|
|
# 会话ID
|
|
conversation_id = '2a2cb0ad-fc02-449a-ada7-89087c6204e8'
|
|
|
|
|
|
# Dify API 配置
|
|
url = DIFY_URL + "/conversations/"+conversation_id+"/name"
|
|
headers = {
|
|
'Authorization': 'Bearer ' + DIFY_API_KEY,
|
|
'Content-Type': 'application/json'
|
|
}
|
|
|
|
|
|
# 请求数据
|
|
payload = json.dumps({
|
|
'name':'黄海的测试',
|
|
'auto_generate':False,
|
|
"user": "abc-123"
|
|
})
|
|
|
|
response = requests.request("POST", url, headers=headers, data=payload)
|
|
json_data = json.loads(response.text)
|
|
print(json_data)
|