class documentation

class TemporalAsyncFiles(AsyncFiles): (source)

Constructor: TemporalAsyncFiles(api_client, activity_config)

View In Hierarchy

AsyncFiles subclass that routes upload and download through activities.

The entire file operation — including filesystem access, resumable upload negotiation, and chunked transfer — runs inside a Temporal activity on the worker. get, delete, and list are inherited from AsyncFiles and already work through the _TemporalApiClient's async_request activity.

Method __init__ Initialize with activity config for file operation timeouts.
Async Method download Download a file via a Temporal activity.
Async Method register_files Register GCS files via a Temporal activity.
Async Method upload Upload a file via a Temporal activity.
Instance Variable _activity_config Undocumented
def __init__(self, api_client: _TemporalApiClient, activity_config: ActivityConfig | None = None): (source)

Initialize with activity config for file operation timeouts.

async def download(self, *, file: str | types.File, config: types.DownloadFileConfigOrDict | None = None) -> bytes: (source)

Download a file via a Temporal activity.

async def register_files(self, *, auth: google.auth.credentials.Credentials, uris: list[str], config: types.RegisterFilesConfigOrDict | None = None) -> types.RegisterFilesResponse: (source)

Register GCS files via a Temporal activity.

Note

The auth parameter is ignored. The activity uses credentials if provided to GoogleGenAIPlugin, otherwise falls back to the genai.Client's own credentials. Either way, those credentials must have access to the GCS URIs being registered.

async def upload(self, *, file: str | os.PathLike[str] | io.IOBase, config: types.UploadFileConfigOrDict | None = None) -> types.File: (source)

Upload a file via a Temporal activity.

Accepts a file path (resolved on the worker), os.PathLike, or an io.IOBase (bytes sent across the activity boundary).

_activity_config = (source)

Undocumented