Files
railseek6/test_retrieval_fixed.py
2026-01-12 22:31:11 +08:00

28 lines
812 B
Python

import asyncio
import aiohttp
import json
async def test():
url = "http://localhost:3015/search"
headers = {
"Content-Type": "application/json",
"X-Workspace": "",
"X-API-Key": "jleu1212"
}
data = {
"query": "what is the minimum safe working distance",
"mode": "mix",
"return_raw_data": True
}
async with aiohttp.ClientSession() as session:
async with session.post(url, headers=headers, json=data) as resp:
print(f"Status: {resp.status}")
if resp.status == 200:
result = await resp.json()
print(json.dumps(result, indent=2))
else:
text = await resp.text()
print(f"Error: {text}")
if __name__ == "__main__":
asyncio.run(test())