Overview

Async version of bind_session. Binds an existing session for the duration of the async context, without ending it on exit.

Syntax

async with lai.bind_session_async(session_id: str):
  ...

Example

import lucidicai as lai

sid = lai.init(session_name="external", providers=["openai"], auto_end=False)

async def handle():
    async with lai.bind_session_async(sid):
        await do_more_async_work()

See Also