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.

30 lines
669 B

import json
import requests
from Config import *
# 消息ID
message_id = '18b68391-e4ae-4bfb-b141-bf84f108da30'
# Dify API 配置
url = DIFY_URL + "/messages/" + message_id + "/suggested"
headers = {
'Authorization': 'Bearer ' + DIFY_API_KEY,
'Content-Type': 'application/json'
}
# 发送 get 请求
response = requests.get(url + '?user=abc-123', headers=headers)
# 解析并打印响应
json_data = response.json()
print(json.dumps(json_data, indent=2, ensure_ascii=False))
'''
{
"code": "bad_request",
"message": "Suggested Questions Is Disabled.",
"status": 400
}
似乎是Dify的配置不允许调用这个接口
'''