Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
OurBuilding Ambient Agents with LangGraph course is now available on LangChain Academy!
Open In ColabOpen on GitHub

AWS S3 File

Amazon Simple Storage Service (Amazon S3) is an object storage service.

AWS S3 Buckets

This covers how to load document objects from anAWS S3 File object.

from langchain_community.document_loadersimport S3FileLoader
API Reference:S3FileLoader
%pip install--upgrade--quiet  boto3
loader= S3FileLoader("testing-hwc","fake.docx")
loader.load()
[Document(page_content='Lorem ipsum dolor sit amet.', lookup_str='', metadata={'source': 's3://testing-hwc/fake.docx'}, lookup_index=0)]

Configuring the AWS Boto3 client

You can configure the AWSBoto3 client by passingnamed arguments when creating the S3DirectoryLoader.This is useful for instance when AWS credentials can't be set as environment variables.See thelist of parameters that can be configured.

loader= S3FileLoader(
"testing-hwc","fake.docx", aws_access_key_id="xxxx", aws_secret_access_key="yyyy"
)
loader.load()

Related


[8]ページ先頭

©2009-2025 Movatter.jp