module documentation

High-level gRPC channel manager for the Nebius Python SDK.

Class Channel A high-level gRPC channel manager used by the SDK.
Class NebiusUnaryUnaryMultiCallable A small callable wrapper that binds RPC calls to a Channel-managed address channel.
Class NoCredentials Marker type used to explicitly disable authorization.
Exception ChannelClosedError Raised when an operation is attempted on a closed Channel.
Exception LoopError Exception raised when a synchronous helper is used incorrectly with an asyncio event loop.
Function set_user_agent_option Set or override the grpc.primary_user_agent channel option. This helper appends the provided user-agent string to the options sequence, which is passed to gRPC when creating channels. If the grpc.primary_user_agent...
Type Variable Req Undocumented
Type Variable Res Undocumented
Type Variable T Undocumented
Variable Credentials Undocumented
Variable logger Undocumented
Async Function _run_awaitable_with_timeout Run an awaitable with an optional wall-clock timeout.
Function _wrap_awaitable Ensure the provided awaitable is a coroutine object.
def set_user_agent_option(user_agent: str, options: ChannelArgumentType | None) -> ChannelArgumentType: (source)

Set or override the grpc.primary_user_agent channel option. This helper appends the provided user-agent string to the options sequence, which is passed to gRPC when creating channels. If the grpc.primary_user_agent option is already present in options, it will be replaced with the new value.

Parameters
user_agent:strThe user-agent string to set.
options:optional list of (str, Any) tuplesExisting channel options, if any.
Returns
list of (str, Any) tuplesThe updated channel options including the user-agent.

Undocumented

Value
TypeVar('Req',
        bound=Message)

Undocumented

Value
TypeVar('Res',
        bound=Message)

Undocumented

Value
TypeVar('T')
Credentials = (source)

Undocumented

Undocumented

async def _run_awaitable_with_timeout(f: Awaitable[T], timeout: float | None = None) -> T: (source)

Run an awaitable with an optional wall-clock timeout.

The function creates an asyncio.Task from the provided awaitable and, if a timeout is supplied, a short timer task. It waits for the first task to finish. If the timer completes first the awaited task is cancelled and a TimeoutError is raised. Exceptions raised by the awaited task are propagated.

Parameters
f:Awaitable[T]The awaitable to run.
timeout:float | NoneOptional timeout in seconds. If None the awaitable is allowed to run indefinitely.
Returns
TThe awaited result.
Raises
TimeoutErrorIf the awaitable did not finish before the timeout.
def _wrap_awaitable(awaitable: Awaitable[T]) -> Coroutine[Any, Any, T]: (source)

Ensure the provided awaitable is a coroutine object.

gRPC helper functions in this module accept both coroutine objects and other awaitable types (for example asyncio.Future). This function normalizes them into a coroutine so that they can be wrapped in an asyncio.Task safely.

Parameters
awaitable:Awaitable[T]Any awaitable or coroutine-like object.
Returns
Coroutine[Any, Any, T]A coroutine object ready to be scheduled.
Raises
TypeErrorIf the argument is not awaitable.