connect
relationalai.client
connect( *, config: "Config | None" = None, connection_name: str | None = None, token: str | None = None) -> ClientAsync-first entrypoint returning a Client.
Use this from async code (you can await it). The returned Client:
- exposes async lifecycle (
await client.aclose()/async with ...) - exposes async service clients (e.g.
client.reasoners->ReasonersClient)
Transport creation is lazy: no network calls are made by connect(...) itself.
Transports are created on first use (SQL/HTTP/services).
If you are in synchronous code, prefer connect_sync() which returns ClientSync.
Parameters
Section titled “Parameters”
(config‘Config|None’, default:None) - Optional config to use. When omitted, a default config is loaded.
(connection_namestr|None, default:None) - Optional named connection to use from the config.
(tokenstr|None, default:None) - Optional RAI token override.
Returns
Section titled “Returns”Client- An async-first root client. Useasync with await connect(...) as client:orclient = await connect(...); await client.aclose().