Can I register async functions on session events? ...
# agents
k
Can I register async functions on session events? Like:
Copy code
@session.on("close")
async def on_close(ev: CloseEvent):
  await my_method()
c
Yes
r
k
yea, with sync methods. I think the only way to call async handlers is to use
asyncio.create_task(my_method())
thanks for the answers!