feat: 修正 Dify 端点为 /chat-messages,补全 inputs 字段;新增直连测试页和 relay 测试页
This commit is contained in:
@@ -162,8 +162,12 @@ async def chat_completions(request: Request):
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
|
||||
# 转发到 Dify
|
||||
dify_endpoint = f"{DIFY_URL.rstrip('/')}/chat/completions"
|
||||
# 转发到 Dify(Dify 原生端点 /chat-messages)
|
||||
# 确保 body 包含 inputs 字段(Dify 应用可能要求此字段)
|
||||
if "inputs" not in body:
|
||||
body["inputs"] = {}
|
||||
|
||||
dify_endpoint = f"{DIFY_URL.rstrip('/')}/chat-messages"
|
||||
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=60.0) as client:
|
||||
|
||||
Reference in New Issue
Block a user