main
py 12 lines 395 Bytes
Raw
1 import aiohttp
2 from helpers import runtime
3
4 URL = "http://localhost:55510/search"
5
6 async def search(query:str):
7 return await runtime.call_development_function(_search, query=query)
8
9 async def _search(query:str):
10 async with aiohttp.ClientSession() as session:
11 async with session.post(URL, data={"q": query, "format": "json"}) as response:
12 return await response.json()