pydo.aio package

Subpackages

Module contents

class pydo.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: InferenceClientSurface, AgentClientSurface, GeneratedClient

The official DigitalOcean Python client (async)

Parameters:
  • token (str) – A valid API token / model access key (positional or token=).

  • api_key (str) – Same as token — OpenAI-style alias for a model access key.

  • endpoint (str) – Service URL. Default value is “https://api.digitalocean.com”.

  • inference_endpoint (str) – Serverless inference URL. Default value is “https://inference.do-ai.run”.

  • agent_endpoint (str) – Agent inference URL. Pass the per-agent subdomain (e.g. "https://<id>.agents.do-ai.run"). Required only when using agent inference endpoints.

class pydo.aio.GeneratedClient(credential: AsyncTokenCredential, *, endpoint: str = 'https://api.digitalocean.com', **kwargs: Any)

Bases: object

GeneratedClient.

Variables:
Parameters:
  • credential (AsyncTokenCredential) – Credential needed for the client to connect to Azure. Required.

  • endpoint (str) – Service URL. Default value is “https://api.digitalocean.com”.

async close() None
send_request(request: HttpRequest, *, stream: bool = False, **kwargs: Any) Awaitable[AsyncHttpResponse]

Runs the network request through the client’s chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = await client.send_request(request)
<AsyncHttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

Parameters:
  • request (HttpRequest) – The network request you want to make. Required.

  • stream (bool) – Whether the response payload will be streamed. Defaults to False.

Returns:

The response of your network call. Does not do error handling on your response.

Return type:

AsyncHttpResponse