agentsociety.s3.client

Module Contents

Classes

S3Config

S3 configuration

S3Client

S3 client

Data

API

agentsociety.s3.client.__all__

[‘S3Config’]

class agentsociety.s3.client.S3Config

Bases: pydantic.BaseModel

S3 configuration

enabled: bool

‘Field(…)’

Whether S3 is enabled

endpoint: str = <Multiline-String>

S3 endpoint

access_key: str = <Multiline-String>

S3 access key

secret_key: str = <Multiline-String>

S3 secret key

bucket: str = <Multiline-String>

S3 bucket

region: str = <Multiline-String>

S3 region

prefix: str

‘Field(…)’

S3 prefix

class agentsociety.s3.client.S3Client(config: agentsociety.s3.client.S3Config)

S3 client

Initialization

Initialize S3 client

_get_s3_path(remote_path: str) str

Get S3 path

upload(data: bytes, remote_path: str)

Upload bytes data to S3

Args: data: Bytes data to upload remote_path: Target path in S3

Returns: bool: Whether the upload is successful

download(remote_path: str) bytes

Download bytes data from S3

Args: remote_path: Path of the file in S3

Returns: bytes | None: Downloaded bytes data, None if failed

exists(remote_path: str) bool

Check if the file exists in S3

delete(remote_path: str)

Delete a file from S3