3.31 上传 dm rewrite

This commit is contained in:
Zdao032
2025-03-31 15:17:47 +08:00
commit b444310280
430 changed files with 39039 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
"""
===================================
@AutherWenZ
@Company: BooWay
@projectdify_lab
===================================
"""
import requests
import json
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def info_input(input_str):
# API 端点
url = "https://172.20.0.145/v1/chat-messages"
# 确保 API Key 正确(去掉大括号)
api_key = "app-ziMDuhVoATbd5vF3Lb7iyjVD"
# 认证信息
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
# 请求数据
payload = {
"inputs": {},
"query": "",
"response_mode": "blocking",
"conversation_id": "",
"user": "abc-123",
"files": [
{
"type": "image",
"transfer_method": "remote_url",
"url": "https://cloud.dify.ai/logo/logo-site.png"
}
]
}
payload["query"] = input_str
# 发送 POST 请求
response = requests.post(url, headers=headers, data=json.dumps(payload), verify=False) # verify=False 忽略 SSL 证书验证
response_dict = json.loads(response.text)
return response_dict['conversation_id']
# print(info_input("多个工程需要统一修改定额中材料的单价是否可以呢"))
# print(info_input("多个工程需要统一修改定额中材料的单价是否可以呢"))