腾讯 COS 目录
Tencent Cloud Object Storage (COS) is a distributed storage service that enables you to store any amount of data from anywhere via HTTP/HTTPS protocols.
COShas no restrictions on data structure or format. It also has no bucket size limit and partition management, making it suitable for virtually any use case, such as data delivery, data processing, and data lakes.COSprovides a web-based console, multi-language SDKs and APIs, command line tool, and graphical tools. It works well with Amazon S3 APIs, allowing you to quickly access community tools and plugins.
这涵盖了如何从 Tencent COS Directory 加载文档对象。
%pip install --upgrade --quiet cos-python-sdk-v5
from langchain_community.document_loaders import TencentCOSDirectoryLoader
from qcloud_cos import CosConfig
API 参考:TencentCOSDirectoryLoader
conf = CosConfig(
Region="your cos region",
SecretId="your cos secret_id",
SecretKey="your cos secret_key",
)
loader = TencentCOSDirectoryLoader(conf=conf, bucket="you_cos_bucket")
loader.load()
指定前缀
您还可以指定前缀,以更精细地控制要加载的文件。
loader = TencentCOSDirectoryLoader(conf=conf, bucket="you_cos_bucket", prefix="fake")
loader.load()