zhivex_ai.experimental
Python 0.26.0 · published wheel reference and guides.
Public import paths and stability come from the installed artifact.
Use the root for Stable APIs and focused namespaces for extensions. Legacy root extension imports remain classified below.
AgentLiveEvent
Stable · agent
from zhivex_ai.experimental import AgentLiveEvent
AgentLiveEvent (public type alias or constant; no callable signature)
LiveAgentStreamResult
Stable · agent
from zhivex_ai.experimental import LiveAgentStreamResult
LiveAgentStreamResult(runner: 'asyncio.Task[AgentRunResult[AgentOutputT]]', broadcast: 'Broadcast[AgentLiveEvent]', live_session: 'asyncio.Future[Any]') -> 'None'
Abstract base class for generic types.
On Python 3.12 and newer, generic classes implicitly inherit from
Generic when they declare a parameter list after the class's name::
class Mapping[KT, VT]:
def __getitem__(self, key: KT) -> VT:
...
# Etc.
On older versions of Python, however, generic classes have to
explicitly inherit from Generic.
After a class has been declared to be generic, it can then be used as
follows::
def lookup_name[KT, VT](mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
try:
return mapping[key]
except KeyError:
return default
RealtimeAudioOutputEvent
Stable · types
from zhivex_ai.experimental import RealtimeAudioOutputEvent
RealtimeAudioOutputEvent(type: "Literal['realtime-audio-output']" = 'realtime-audio-output', audio: 'bytes' = b'', media_type: 'str' = 'audio/pcm', sample_rate_hz: 'int | None' = None, channels: 'int | None' = None, item_id: 'str | None' = None, response_id: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>) -> None
RealtimeAudioOutputEvent(type: "Literal['realtime-audio-output']" = 'realtime-audio-output', audio: 'bytes' = b'', media_type: 'str' = 'audio/pcm', sample_rate_hz: 'int | None' = None, channels: 'int | None' = None, item_id: 'str | None' = None, response_id: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>)
RealtimeConnectOptions
Stable · types
from zhivex_ai.experimental import RealtimeConnectOptions
RealtimeConnectOptions(timeout_ms: 'int | None' = None, max_retries: 'int | None' = None, retry_backoff_ms: 'int | None' = None, metadata: 'dict[str, Any]' = <factory>, browser_client: 'bool' = False, subprotocols: 'list[str]' = <factory>) -> None
RealtimeConnectOptions(timeout_ms: 'int | None' = None, max_retries: 'int | None' = None, retry_backoff_ms: 'int | None' = None, metadata: 'dict[str, Any]' = <factory>, browser_client: 'bool' = False, subprotocols: 'list[str]' = <factory>)
RealtimeErrorEvent
Stable · types
from zhivex_ai.experimental import RealtimeErrorEvent
RealtimeErrorEvent(type: "Literal['realtime-error']" = 'realtime-error', error: 'Exception | None' = None, message: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>) -> None
RealtimeErrorEvent(type: "Literal['realtime-error']" = 'realtime-error', error: 'Exception | None' = None, message: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>)
RealtimeEvent
Stable · types
from zhivex_ai.experimental import RealtimeEvent
RealtimeEvent (public type alias or constant; no callable signature)
RealtimeGoAwayEvent
Stable · types
from zhivex_ai.experimental import RealtimeGoAwayEvent
RealtimeGoAwayEvent(type: "Literal['realtime-go-away']" = 'realtime-go-away', time_left_ms: 'int | None' = None, provider_metadata: 'dict[str, Any]' = <factory>) -> None
RealtimeGoAwayEvent(type: "Literal['realtime-go-away']" = 'realtime-go-away', time_left_ms: 'int | None' = None, provider_metadata: 'dict[str, Any]' = <factory>)
RealtimeModel
Stable · types
from zhivex_ai.experimental import RealtimeModel
RealtimeModel(*args, **kwargs)
Base class for protocol classes.
Protocol classes are defined as::
class Proto(Protocol):
def meth(self) -> int:
...
Such classes are primarily used with static type checkers that recognize
structural subtyping (static duck-typing).
For example::
class C:
def meth(self) -> int:
return 0
def func(x: Proto) -> int:
return x.meth()
func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with
@typing.runtime_checkable act as simple-minded runtime protocols that check
only the presence of given attributes, ignoring their type signatures.
Protocol classes can be generic, they are defined as::
class GenProto[T](Protocol):
def meth(self) -> T:
...
RealtimeResponseCompletedEvent
Stable · types
from zhivex_ai.experimental import RealtimeResponseCompletedEvent
RealtimeResponseCompletedEvent(type: "Literal['realtime-response-complete']" = 'realtime-response-complete', reason: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>) -> None
RealtimeResponseCompletedEvent(type: "Literal['realtime-response-complete']" = 'realtime-response-complete', reason: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>)
RealtimeSession
Stable · types
from zhivex_ai.experimental import RealtimeSession
RealtimeSession(*args, **kwargs)
Base class for protocol classes.
Protocol classes are defined as::
class Proto(Protocol):
def meth(self) -> int:
...
Such classes are primarily used with static type checkers that recognize
structural subtyping (static duck-typing).
For example::
class C:
def meth(self) -> int:
return 0
def func(x: Proto) -> int:
return x.meth()
func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with
@typing.runtime_checkable act as simple-minded runtime protocols that check
only the presence of given attributes, ignoring their type signatures.
Protocol classes can be generic, they are defined as::
class GenProto[T](Protocol):
def meth(self) -> T:
...
RealtimeSessionConfig
Stable · types
from zhivex_ai.experimental import RealtimeSessionConfig
RealtimeSessionConfig(instructions: 'str | None' = None, voice: 'str | None' = None, tools: "dict[str, 'AnyToolDefinition'] | None" = None, tool_choice: 'ToolChoice | None' = None, input_audio_media_type: 'str | None' = None, output_audio_media_type: 'str | None' = None, input_sample_rate_hz: 'int | None' = None, output_sample_rate_hz: 'int | None' = None, channels: 'int | None' = None, translation_target_language_code: 'str | None' = None, translation_echo_target_language: 'bool | None' = None, turn_detection: 'dict[str, Any] | None' = None, provider_options: 'ProviderOptions | None' = None, metadata: 'dict[str, Any]' = <factory>, auto_response: 'bool' = True) -> None
RealtimeSessionConfig(instructions: 'str | None' = None, voice: 'str | None' = None, tools: "dict[str, 'AnyToolDefinition'] | None" = None, tool_choice: 'ToolChoice | None' = None, input_audio_media_type: 'str | None' = None, output_audio_media_type: 'str | None' = None, input_sample_rate_hz: 'int | None' = None, output_sample_rate_hz: 'int | None' = None, channels: 'int | None' = None, translation_target_language_code: 'str | None' = None, translation_echo_target_language: 'bool | None' = None, turn_detection: 'dict[str, Any] | None' = None, provider_options: 'ProviderOptions | None' = None, metadata: 'dict[str, Any]' = <factory>, auto_response: 'bool' = True)
RealtimeSessionEndedEvent
Stable · types
from zhivex_ai.experimental import RealtimeSessionEndedEvent
RealtimeSessionEndedEvent(type: "Literal['realtime-end']" = 'realtime-end', reason: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>) -> None
RealtimeSessionEndedEvent(type: "Literal['realtime-end']" = 'realtime-end', reason: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>)
RealtimeSessionResumptionEvent
Stable · types
from zhivex_ai.experimental import RealtimeSessionResumptionEvent
RealtimeSessionResumptionEvent(type: "Literal['realtime-session-resumption']" = 'realtime-session-resumption', new_handle: 'str | None' = None, resumable: 'bool | None' = None, provider_metadata: 'dict[str, Any]' = <factory>) -> None
RealtimeSessionResumptionEvent(type: "Literal['realtime-session-resumption']" = 'realtime-session-resumption', new_handle: 'str | None' = None, resumable: 'bool | None' = None, provider_metadata: 'dict[str, Any]' = <factory>)
RealtimeSessionStartedEvent
Stable · types
from zhivex_ai.experimental import RealtimeSessionStartedEvent
RealtimeSessionStartedEvent(type: "Literal['realtime-start']" = 'realtime-start', session_id: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>) -> None
RealtimeSessionStartedEvent(type: "Literal['realtime-start']" = 'realtime-start', session_id: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>)
RealtimeTextDeltaEvent
Stable · types
from zhivex_ai.experimental import RealtimeTextDeltaEvent
RealtimeTextDeltaEvent(type: "Literal['realtime-text-delta']" = 'realtime-text-delta', text_delta: 'str' = '', item_id: 'str | None' = None, response_id: 'str | None' = None, role: "Literal['assistant']" = 'assistant', provider_metadata: 'dict[str, Any]' = <factory>) -> None
RealtimeTextDeltaEvent(type: "Literal['realtime-text-delta']" = 'realtime-text-delta', text_delta: 'str' = '', item_id: 'str | None' = None, response_id: 'str | None' = None, role: "Literal['assistant']" = 'assistant', provider_metadata: 'dict[str, Any]' = <factory>)
RealtimeTokenResult
Stable · types
from zhivex_ai.experimental import RealtimeTokenResult
RealtimeTokenResult(value: 'str', expires_at_ms: 'int | None' = None, raw_response: 'Any' = None) -> None
RealtimeTokenResult(value: 'str', expires_at_ms: 'int | None' = None, raw_response: 'Any' = None)
RealtimeToolCallEvent
Stable · types
from zhivex_ai.experimental import RealtimeToolCallEvent
RealtimeToolCallEvent(type: "Literal['realtime-tool-call']" = 'realtime-tool-call', tool_call: 'ToolCall' = <factory>) -> None
RealtimeToolCallEvent(type: "Literal['realtime-tool-call']" = 'realtime-tool-call', tool_call: 'ToolCall' = <factory>)
RealtimeToolResultEvent
Stable · types
from zhivex_ai.experimental import RealtimeToolResultEvent
RealtimeToolResultEvent(type: "Literal['realtime-tool-result']" = 'realtime-tool-result', tool_result: 'ToolExecutionResult' = <factory>) -> None
RealtimeToolResultEvent(type: "Literal['realtime-tool-result']" = 'realtime-tool-result', tool_result: 'ToolExecutionResult' = <factory>)
RealtimeTranscriptEvent
Stable · types
from zhivex_ai.experimental import RealtimeTranscriptEvent
RealtimeTranscriptEvent(type: "Literal['realtime-transcript']" = 'realtime-transcript', text: 'str' = '', role: "Literal['user', 'assistant']" = 'assistant', is_final: 'bool' = False, item_id: 'str | None' = None, response_id: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>) -> None
RealtimeTranscriptEvent(type: "Literal['realtime-transcript']" = 'realtime-transcript', text: 'str' = '', role: "Literal['user', 'assistant']" = 'assistant', is_final: 'bool' = False, item_id: 'str | None' = None, response_id: 'str | None' = None, provider_metadata: 'dict[str, Any]' = <factory>)
create_bedrock
Experimental · provider
from zhivex_ai.experimental import create_bedrock
create_bedrock(*, client: 'BedrockClient | None' = None, region: 'str | None' = None, realtime_connection_factory: 'RealtimeConnectionFactory | None' = None)
native-only provider
create_ollama
Experimental · provider
from zhivex_ai.experimental import create_ollama
create_ollama(*, api_key: 'str | None' = 'ollama', base_url: 'str' = 'http://localhost:11434/v1', fetch: 'Fetcher | None' = None)
compatibility provider
create_openrouter
Experimental · provider
from zhivex_ai.experimental import create_openrouter
create_openrouter(*, api_key: 'str | None' = None, base_url: 'str' = 'https://openrouter.ai/api/v1', fetch: 'Fetcher | None' = None)
native-only provider
open_websocket_connection
Stable · realtime
from zhivex_ai.experimental import open_websocket_connection
open_websocket_connection(url: 'str', *, headers: 'dict[str, str] | None' = None, options: 'RealtimeConnectOptions | None' = None) -> 'RealtimeConnection'
openai_local_shell_tool
Experimental · provider
from zhivex_ai.experimental import openai_local_shell_tool
openai_local_shell_tool(**extra: 'Any') -> 'HostedToolDefinition'
local shell execution is experimental and must be isolated by applications
openai_shell_environment
Experimental · provider
from zhivex_ai.experimental import openai_shell_environment
openai_shell_environment(*, file_ids: 'list[str] | None' = None, memory_limit: 'str | None' = None, network_policy: 'dict[str, Any] | None' = None, container_id: 'str | None' = None, local_skills: 'list[dict[str, Any]] | None' = None, use_local: 'bool' = False, **extra: 'Any') -> 'HostedToolDefinition'
openai_shell_tool
Experimental · provider
from zhivex_ai.experimental import openai_shell_tool
openai_shell_tool(*, environment: 'HostedToolDefinition | dict[str, Any] | None' = None, **extra: 'Any') -> 'HostedToolDefinition'
shell execution is experimental and must be isolated by applications
stream_live_agent
Stable · agent
from zhivex_ai.experimental import stream_live_agent
stream_live_agent(*, agent: 'Agent[AgentDepsT, AgentOutputT]', session: 'AgentSession | None' = None, deps: 'AgentDepsT | None' = None, tools: 'ToolSet | ToolRegistry | None' = None, skills: 'SkillSet | SkillRegistry | None' = None, tool_choice: 'str | ToolChoiceName | None' = None, tool_execution: 'ToolExecutionOptions | None' = None, connect_options: 'RealtimeConnectOptions | None' = None, realtime_config: 'RealtimeSessionConfig | None' = None, provider_options: 'dict[str, Any] | None' = None, runtime: 'AgentRuntime | None' = None, registry: 'AgentRegistry | None' = None, observer: 'AgentObserver | None' = None, prompt: 'str | None' = None, messages: 'list[ModelMessage] | None' = None, parent_run_id: 'str | None' = None, idempotency_key: 'str | None' = None, cancellation_token: 'AgentCancellationToken | None' = None, hooks: 'Iterable[AgentHooks] | None' = None, middleware: 'Iterable[AgentMiddleware] | None' = None, stream_buffer_size: 'int | None' = None) -> 'LiveAgentStreamResult[AgentOutputT]'
Stable bounded live-agent runtime; provider-native live transports retain their own maturity