GCS Media Storage
GCSMediaStorage stores agent media in a Google Cloud Storage bucket.
GCSMediaStorage stores agent media in a Google Cloud Storage bucket and keeps only a MediaReference in the database.
| Parameter | Type | Default | Description |
|---|---|---|---|
bucket | str | - | Name of the destination GCS bucket. |
prefix | str | "agno/media/" | Key prefix for stored objects. |
credentials_path | Optional[str] | None | Path to a service-account JSON file. Supplies the private key used to sign URLs, as does GOOGLE_APPLICATION_CREDENTIALS. |
project | Optional[str] | None | GCP project ID. |
presigned_url_expiry | int | 3600 | Signed URL lifetime in seconds. Above the V4 maximum of seven days, signing fails and URLs fall back to streaming. |
public | bool | False | Return the public object URL instead of a signed one. Grants no access by itself. |
persist_remote_urls | bool | False | Download and store media passed as a URL. Skipped when False. |
AsyncGCSMediaStorage takes the same parameters and runs each call in a worker thread.
Signing needs a credential that carries a private key, from credentials_path or a service-account JSON on GOOGLE_APPLICATION_CREDENTIALS. Application Default Credentials can also resolve to a signing service-account key. If the resolved credentials are token-only and cannot sign, get_url returns None and readers stream the bytes through download instead. public=True skips signing and always returns a URL.