prefactor_livekit.session module
prefactor_livekit.session module
Section titled “prefactor_livekit.session module”LiveKit session wrapper for Prefactor observability.
class prefactor_livekit.session.PrefactorLiveKitSession(client: PrefactorCoreClient | None = None, agent_id: str = ‘livekit-agent’, agent_name: str | None = None, instance: AgentInstanceHandle | None = None, tool_schemas: Mapping[str, LiveKitToolSchemaConfig | Mapping[str, Any]] | None = None)
Section titled “class prefactor_livekit.session.PrefactorLiveKitSession(client: PrefactorCoreClient | None = None, agent_id: str = ‘livekit-agent’, agent_name: str | None = None, instance: AgentInstanceHandle | None = None, tool_schemas: Mapping[str, LiveKitToolSchemaConfig | Mapping[str, Any]] | None = None)”Bases: object
High-level LiveKit session wrapper for Prefactor tracing.
async attach(session: AgentSession[Any]) → AgentInstanceHandle
Section titled “async attach(session: AgentSession[Any]) → AgentInstanceHandle”Attach to an existing LiveKit session.
async close() → None
Section titled “async close() → None”Flush pending tasks and release wrapper-owned resources.
async ensure_initialized() → AgentInstanceHandle
Section titled “async ensure_initialized() → AgentInstanceHandle”Initialize and return the active Prefactor instance.
classmethod from_config(api_url: str, api_token: str, agent_id: str = ‘livekit-agent’, agent_name: str | None = None, schema_registry: SchemaRegistry | None = None, include_livekit_schemas: bool = True, tool_schemas: Mapping[str, LiveKitToolSchemaConfig | Mapping[str, Any]] | None = None) → PrefactorLiveKitSession
Section titled “classmethod from_config(api_url: str, api_token: str, agent_id: str = ‘livekit-agent’, agent_name: str | None = None, schema_registry: SchemaRegistry | None = None, include_livekit_schemas: bool = True, tool_schemas: Mapping[str, LiveKitToolSchemaConfig | Mapping[str, Any]] | None = None) → PrefactorLiveKitSession”Create a wrapper from raw configuration.
async start(session: AgentSession[Any], agent: Agent, **kwargs: Any) → Any
Section titled “async start(session: AgentSession[Any], agent: Agent, **kwargs: Any) → Any”Attach and delegate to AgentSession.start().