pydo.inference.aio package

Module contents

Async inference-focused entry point: from pydo.inference.aio import Client.

Asynchronous twin of pydo.inference.Client. Same surface, await-friendly. See pydo.inference for usage details.

class pydo.inference.aio.Client(token: Optional[str] = None, *, api_key: Optional[str] = None, timeout: int = 120, inference_endpoint: str = 'https://inference.do-ai.run', agent_endpoint: str = '', **kwargs)

Bases: Client

Inference-focused DigitalOcean async client.

Asynchronous counterpart to pydo.inference.Client. Every inference / agent-inference surface is exposed as an awaitable method, while the underlying pydo.aio.Client machinery (authentication, transport pipeline, multi-base-URL routing, SSE streaming) is reused unchanged.

class pydo.inference.aio.TokenCredentials(token: str)

Bases: AsyncTokenCredential

DO Customized Code: Added to simplify authentication.

async get_token(*args, **kwargs) AccessToken

Request an access token for scopes.

Parameters:
  • scopes (str) – The type of access needed.

  • claims (str) – Additional claims required in the token, such as those returned in a resource provider’s claims challenge following an authorization failure.

  • tenant_id (str) – Optional tenant to include in the token request.

  • enable_cae (bool) – Indicates whether to enable Continuous Access Evaluation (CAE) for the requested token. Defaults to False.

Return type:

AccessToken

Returns:

An AccessToken instance containing the token string and its expiration time in Unix time.