Whenever i try to make a Chatbot I choose to use endpoint
But i get this error File "/app/chatbot/plugins/response.py", line 10 print((await get_response('world'))) ^ SyntaxError: 'await' outside function
Please help me i would be highly obliged if you help me
Where my code is
import aiohttp
async def get_response(query):
async with aiohttp.ClientSession() as ses:
async with ses.get(
f'https://some-random-api.ml/chatbot?message={query}'
) as resp:
return (await resp.json())['response']
print((await get_response('world')))