mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-28 02:31:59 +00:00
feat: add s3 provider to files API
Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
e3ad17ec5e
commit
749cbcca31
17 changed files with 614 additions and 132 deletions
37
llama_stack/providers/remote/files/object/s3/config.py
Normal file
37
llama_stack/providers/remote/files/object/s3/config.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from llama_stack.providers.utils.kvstore import KVStoreConfig
|
||||
from llama_stack.providers.utils.kvstore.config import SqliteKVStoreConfig
|
||||
|
||||
|
||||
class S3FilesImplConfig(BaseModel):
|
||||
"""Configuration for S3 file storage provider."""
|
||||
|
||||
aws_access_key_id: str = Field(description="AWS access key ID")
|
||||
aws_secret_access_key: str = Field(description="AWS secret access key")
|
||||
region_name: str | None = Field(default=None, description="AWS region name")
|
||||
endpoint_url: str | None = Field(default=None, description="Optional endpoint URL for S3 compatible services")
|
||||
bucket_name: str | None = Field(default=None, description="Default S3 bucket name")
|
||||
verify_tls: bool = Field(default=True, description="Verify TLS certificates")
|
||||
persistent_store: KVStoreConfig
|
||||
|
||||
@classmethod
|
||||
def sample_run_config(cls, __distro_dir__: str) -> dict:
|
||||
return {
|
||||
"aws_access_key_id": "your-access-key-id",
|
||||
"aws_secret_access_key": "your-secret-access-key",
|
||||
"region_name": "us-west-2",
|
||||
"endpoint_url": None,
|
||||
"bucket_name": "your-bucket-name",
|
||||
"verify_tls": True,
|
||||
"persistence_store": SqliteKVStoreConfig.sample_run_config(
|
||||
__distro_dir__=__distro_dir__,
|
||||
db_name="files_s3_store.db",
|
||||
),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue