prefactor_livekit package
prefactor_livekit package
Section titled “prefactor_livekit package”Prefactor LiveKit integration package.
class prefactor_livekit.LiveKitToolSchemaConfig(span_type: str, input_schema: dict[str, ~typing.Any], result_schema: dict[str, ~typing.Any] = )
Section titled “class prefactor_livekit.LiveKitToolSchemaConfig(span_type: str, input_schema: dict[str, ~typing.Any], result_schema: dict[str, ~typing.Any] = )”Bases: object
Configuration for a tool-specific LiveKit span schema.
input_schema : dict[str, Any]
Section titled “input_schema : dict[str, Any]”result_schema : dict[str, Any]
Section titled “result_schema : dict[str, Any]”span_type : str
Section titled “span_type : str”class prefactor_livekit.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.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().
prefactor_livekit.compile_livekit_agent_schema(tool_schemas: Mapping[str, LiveKitToolSchemaConfig | Mapping[str, Any]] | None = None) → tuple[dict[str, Any], dict[str, str]]
Section titled “prefactor_livekit.compile_livekit_agent_schema(tool_schemas: Mapping[str, LiveKitToolSchemaConfig | Mapping[str, Any]] | None = None) → tuple[dict[str, Any], dict[str, str]]”Compile built-in and tool-specific LiveKit schemas.
prefactor_livekit.register_livekit_schemas(registry: SchemaRegistry, tool_schemas: Mapping[str, LiveKitToolSchemaConfig | Mapping[str, Any]] | None = None) → dict[str, str]
Section titled “prefactor_livekit.register_livekit_schemas(registry: SchemaRegistry, tool_schemas: Mapping[str, LiveKitToolSchemaConfig | Mapping[str, Any]] | None = None) → dict[str, str]”Register LiveKit schemas in a schema registry.