Purpose¶
democrai.sdk.client is the runtime-entry domain that exposes the request-scoped SDK object and its proxy helpers.
Normal module code should usually work through:
- injected
module_sdk/sdkfunction arguments in actions, tools, and agents - domain imports such as
from democrai.sdk.decorators import action
Use democrai.sdk.client directly when you specifically need the active request-scoped SDK proxy outside those injected call sites, for example in render modules or helper code.
Public Objects¶
SDK¶
The concrete root SDK object bound to:
module_namemodule_pathcurrent_pathsession
It assembles the runtime domains:
accessaiauthdatabasedecoratorsdependencieseffectsenginesenvironmenteventsextractorshooksi18nknowledgemediamodelspagessystemtasksui
current_sdk¶
Context variable storing the SDK instance active for the current request.
active_sdk¶
Proxy that resolves attributes from:
- the current request-scoped SDK when available
- the default core SDK otherwise
This is the supported way to access the active SDK object outside an injected handler argument.
Example¶
from democrai.sdk.client import active_sdk as sdk
async def render(params: dict, session: dict):
builder = sdk.ui.load("ui/yaml/tickets_list")
return builderPractical Notes¶
- Treat
sdk.clientas runtime plumbing, not as the main place to discover business capabilities. - Prefer domain imports such as
democrai.sdk.decorators,democrai.sdk.auth,democrai.sdk.database, anddemocrai.sdk.effectsfor normal module authoring. - Use the
active_sdkproxy only when there is no injectedmodule_sdkargument available.