Skip to content

prefactor_livekit.session module

LiveKit session wrapper for Prefactor observability.

Bases: object

High-level LiveKit session wrapper for Prefactor tracing.

Attach to an existing LiveKit session.

Flush pending tasks and release wrapper-owned resources.

Create a PrefactorCoreClient configured for use with this adaptor.

Use this when you need to manage the client and instance lifecycle yourself (e.g. to share a client between the session wrapper and other code) instead of letting from_config() manage them for you.

  • Parameters: config – Core configuration for the client.
  • Returns: A PrefactorCoreClient ready for await client.initialize().

config = PrefactorCoreConfig(http_config=…) client = PrefactorLiveKitSession.create_client(config) await client.initialize()

instance = await client.create_agent_instance( : agent_id=”my-agent”, agent_version={“name”: “My Agent”}, agent_schema_version=…,

) session = PrefactorLiveKitSession(instance=instance)

Initialize and return the active Prefactor instance.

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().