[split-upload 4/6] f2fd4fa backup via proxy

This commit is contained in:
Simon
2026-08-11 14:17:15 +08:00
parent 8ef4be0fa0
commit 90ff78563a
74 changed files with 247663 additions and 65 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
"""测试 Dify dify2openai 代理"""
import httpx
import asyncio
import sys
async def test_dify_proxy():
# Test the dify2openai proxy path
async with httpx.AsyncClient(timeout=15) as client:
print("=== Test dify2openai proxy ===")
url = "http://yw-dify.dc.servyou-it.com/dify2openai/v1/chat/completions"
headers = {
"Authorization": "Bearer http://yw-dify.dc.servyou-it.com/v1|app-7jkRkAzvX4QM9v9SM3P8mMEO|Chat",
"Content-Type": "application/json"
}
payload = {
"model": "Chat",
"messages": [{"role": "user", "content": "hello"}],
"stream": False
}
r = await client.post(url, json=payload, headers=headers)
print(f"Status: {r.status_code}")
print(f"Response: {r.text[:500]}")
if __name__ == "__main__":
asyncio.run(test_dify_proxy())