class TemporalAsyncFiles(AsyncFiles): (source)
Constructor: TemporalAsyncFiles(api_client, activity_config)
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 |
Register GCS files via a Temporal activity. |
| Async Method | upload |
Upload a file via a Temporal activity. |
| Instance Variable | _activity |
Undocumented |
_TemporalApiClient, activity_config: ActivityConfig | None = None):
(source)
¶
Initialize with activity config for file operation timeouts.
str | types.File, config: types.DownloadFileConfigOrDict | None = None) -> bytes:
(source)
¶
Download a file via a Temporal activity.
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.
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).