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.
25 lines
534 B
25 lines
534 B
import requests
|
|
import json
|
|
from Config import *
|
|
|
|
# 要停止的task_id 参数
|
|
task_id = 'b67f5aae-140d-4198-94bb-5555bc1ac186'
|
|
|
|
# Dify API 配置
|
|
url = DIFY_URL + "/chat-messages"
|
|
headers = {
|
|
'Authorization': 'Bearer ' + DIFY_API_KEY,
|
|
'Content-Type': 'application/json'
|
|
}
|
|
|
|
url = url + '/' + task_id + "/stop"
|
|
|
|
# 请求数据
|
|
payload = json.dumps({
|
|
"user": "abc-123"
|
|
})
|
|
|
|
response = requests.request("POST", url, headers=headers, data=payload)
|
|
json_data = json.loads(response.text)
|
|
print(json_data)
|