Skip to main content
Version: v0.7.0

OSSStorageConfig Configuration

OSSStorageConfig(endpoint: str, region: str, access_key_id: Optional[str] = None, access_key_secret: Optional[str] = None, use_environment_credentials: Optional[bool] = False, fixed_bucket: Optional[str] = None, bucket_prefix: Optional[str] = 'dbgpt-fs-', auto_create_bucket: Optional[bool] = True, save_chunk_size: Optional[int] = 1048576)

Parameters

NameTypeRequiredDescription
endpointstring
The endpoint of the OSS server. e.g. https://oss-cn-hangzhou.aliyuncs.com
regionstring
The region of the OSS server. e.g. cn-hangzhou
access_key_idstring
The access key ID of the OSS server. You can also set it in the environment variable OSS_ACCESS_KEY_ID
access_key_secretstring
The access key secret of the OSS server. You can also set it in the environment variable OSS_ACCESS_KEY_SECRET
use_environment_credentialsboolean
Whether to use the environment variables OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET as the credentials. Default is False.
Defaults:False
fixed_bucketstring
The fixed bucket name to use. If set, all logical buckets in DB-GPT will be mapped to this bucket. We suggest you set this value to avoid bucket name conflicts.
bucket_prefixstring
The prefix of the bucket name. If set, all logical buckets in DB-GPT will be prefixed with this value. Just work when fixed_bucket is None.
Defaults:dbgpt-fs-
auto_create_bucketboolean
Whether to create the bucket automatically if it does not exist. If set to False, the bucket must exist before using it.
Defaults:True
save_chunk_sizeinteger
The chunk size when saving the file. When the file is larger 10x than this value, it will be uploaded in multiple parts. Default is 1M.
Defaults:1048576