class documentation

A BaseApiClient that routes all API calls through Temporal activities.

This client is used on the workflow side. It does NOT initialize HTTP clients, load credentials, or make any network calls. It only holds the minimal configuration needed for the SDK's request formatting logic (e.g., choosing between Vertex AI and ML Dev parameter transformations).

All actual HTTP calls are dispatched via workflow.execute_activity.

Method __del__ No-op — no HTTP resources to clean up.
Method __init__ Initialize without calling super (no HTTP clients needed).
Async Method aclose No-op — no HTTP resources to close.
Async Method async_download_file Raise — use client.files.download() instead.
Async Method async_request Dispatch an async API request through a Temporal activity.
Async Method async_request_streamed Dispatch a streamed request, batching chunks in the activity.
Async Method async_upload_file Raise — use client.files.upload() instead.
Method close No-op — no HTTP resources to close.
Method download_file Raise — use client.files.download() instead.
Method request Raise — sync requests not supported in workflows.
Method request_streamed Raise — sync streaming not supported in workflows.
Method upload_file Raise — use client.files.upload() instead.
Instance Variable api_key Undocumented
Instance Variable custom_base_url Undocumented
Instance Variable location Undocumented
Instance Variable project Undocumented
Instance Variable vertexai Undocumented
Static Method _process_http_options Validate and extract serializable per-request HTTP options.
Method _require_workflow_stream Fail fast if streaming is configured but no WorkflowStream is hosted.
Method _verify_response No-op — matches the base implementation.
Instance Variable _activity_config Undocumented
Instance Variable _streaming_batch_interval Undocumented
Instance Variable _streaming_topic Undocumented
def __del__(self): (source)

No-op — no HTTP resources to clean up.

def __init__(self, *, vertexai: bool = False, project: str | None = None, location: str | None = None, activity_config: ActivityConfig | None = None, streaming_topic: str | None = None, streaming_batch_interval: timedelta = timedelta(milliseconds=100)): (source)

Initialize without calling super (no HTTP clients needed).

async def aclose(self): (source)

No-op — no HTTP resources to close.

async def async_download_file(self, *args: Any, **kwargs: Any) -> Any: (source)

Raise — use client.files.download() instead.

async def async_request(self, http_method: str, path: str, request_dict: dict[str, object], http_options: HttpOptionsOrDict | None = None) -> SdkHttpResponse: (source)

Dispatch an async API request through a Temporal activity.

async def async_request_streamed(self, http_method: str, path: str, request_dict: dict[str, object], http_options: HttpOptionsOrDict | None = None) -> Any: (source)

Dispatch a streamed request, batching chunks in the activity.

When a streaming_topic is configured, the activity also publishes each chunk to that workflow-stream topic as it arrives; the workflow must host a WorkflowStream to receive them.

async def async_upload_file(self, *args: Any, **kwargs: Any) -> Any: (source)

Raise — use client.files.upload() instead.

def close(self): (source)

No-op — no HTTP resources to close.

def download_file(self, *args: Any, **kwargs: Any) -> Any: (source)

Raise — use client.files.download() instead.

def request(self, http_method: str, path: str, request_dict: dict[str, object], http_options: HttpOptionsOrDict | None = None) -> SdkHttpResponse: (source)

Raise — sync requests not supported in workflows.

def request_streamed(self, http_method: str, path: str, request_dict: dict[str, object], http_options: HttpOptionsOrDict | None = None) -> Any: (source)

Raise — sync streaming not supported in workflows.

def upload_file(self, *args: Any, **kwargs: Any) -> Any: (source)

Raise — use client.files.upload() instead.

api_key: str | None = (source)

Undocumented

custom_base_url: str | None = (source)

Undocumented

location = (source)

Undocumented

Undocumented

vertexai = (source)

Undocumented

def _process_http_options(http_options: HttpOptionsOrDict | None, config: ActivityConfig) -> _SerializableHttpOptions | None: (source)

Validate and extract serializable per-request HTTP options.

Rejects non-serializable fields (custom HTTP clients), maps timeout to the Temporal activity config, and returns the remaining options for forwarding to the activity.

Parameters
http_options:HttpOptionsOrDict | NonePer-request options from the SDK call.
config:ActivityConfigMutable activity config dict — timeout is applied here.
Returns
_SerializableHttpOptions | NoneSerializable options to forward, or None if nothing to forward.
def _require_workflow_stream(self): (source)

Fail fast if streaming is configured but no WorkflowStream is hosted.

Published chunks are delivered to the workflow's WorkflowStream via a signal; without a registered handler the signals would be silently dropped, so surface a clear error instead.

def _verify_response(self, response_model: Any): (source)

No-op — matches the base implementation.

_activity_config = (source)

Undocumented

_streaming_batch_interval = (source)

Undocumented

_streaming_topic = (source)

Undocumented