import asyncio import httpx import json async def main(): async with httpx.AsyncClient(timeout=30.0) as client: # test search API res = await client.get("http://localhost:8000/api/knowledge/search", params={"q": "test", "capability_id": "cap_0", "min_score": 1, "top_k": 5}) print("Search Response:") print(json.dumps(res.json(), indent=2, ensure_ascii=False)) # test directly getting relations from DB or testing relation API res2 = await client.get("http://localhost:8000/api/relation/capability_knowledge", params={"capability_id": "cap_0"}) print("Relation Response:") print(json.dumps(res2.json(), indent=2, ensure_ascii=False)) if __name__ == "__main__": asyncio.run(main())