Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 File Loader:Endpoint is missing in configuration #5337

Open
2 tasks done
lawetis opened this issue May 11, 2024 · 3 comments
Open
2 tasks done

S3 File Loader:Endpoint is missing in configuration #5337

lawetis opened this issue May 11, 2024 · 3 comments
Labels
auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder auto:question A specific question about the codebase, product, project, or how to use a feature

Comments

@lawetis
Copy link

lawetis commented May 11, 2024

Checklist

  • I added a very descriptive title to this issue.
  • I included a link to the documentation page I am referring to (if applicable).

Issue with current documentation:

According to the current configuration https://api.js.langchain.com/interfaces/langchain_document_loaders_web_s3.S3LoaderParams.html

The current configuration is:

const loader = new S3Loader({
  bucket: "my-document-bucket-123",
  key: "AccountingOverview.pdf",
  s3Config: {
    region: "us-east-1",
    credentials: {
      accessKeyId: "AKIAIOSFODNN7EXAMPLE",
      secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
    },
  },
  unstructuredAPIURL: "http://localhost:8000/general/v0/general",
  unstructuredAPIKey: "", // this will be soon required
});

So is it possible to configure the endpoint, which is optional?

Idea or request for content:

After querying @aws-sdk/client-s3, I am convinced that endpoint is an optional configuration.

export interface ClientInputEndpointParameters {
    region?: string | Provider<string>;
    useFipsEndpoint?: boolean | Provider<boolean>;
    useDualstackEndpoint?: boolean | Provider<boolean>;
    endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;
    forcePathStyle?: boolean | Provider<boolean>;
    useAccelerateEndpoint?: boolean | Provider<boolean>;
    useGlobalEndpoint?: boolean | Provider<boolean>;
    disableMultiregionAccessPoints?: boolean | Provider<boolean>;
    useArnRegion?: boolean | Provider<boolean>;
    disableS3ExpressSessionAuth?: boolean | Provider<boolean>;
}

0d4b14601aa28a2f43e7c2fdaa112b6b

@dosubot dosubot bot added auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder auto:question A specific question about the codebase, product, project, or how to use a feature labels May 11, 2024
@bracesproul
Copy link
Collaborator

The API reference documentation is automatically generated based on the source code. However, we are aware it has some limitations, especially around showing types for externally imported types/interfaces, like the one we see in this file: S3ClientConfig.

Is this issue regarding the API ref documentation not showing the types that S3ClientConfig interface contains, or something else? I just checked and it is possible to pass endpoint to the s3Config object of this class.

@jeasonnow
Copy link
Contributor

You can configure it through s3Config.endpoint, the ClientInputEndpointParameters you mentioned is a subset of S3LoaderParams['S3Config'].

Example:

new S3Loader({
  bucket: "my-document-bucket-123",
  key: "AccountingOverview.pdf",
  s3Config: {
    region: "us-east-1",
    endpoint: "your endpoint",
    credentials: {
      accessKeyId: "AKIAIOSFODNN7EXAMPLE",
      secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
    },
  },
  unstructuredAPIURL: "http://localhost:8000/general/v0/general",
  unstructuredAPIKey: "", // this will be soon required
});

@lawetis

@lawetis
Copy link
Author

lawetis commented May 13, 2024

@bracesproul @jeasonnow Thanks a lot, this was my problem and didn't notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder auto:question A specific question about the codebase, product, project, or how to use a feature
Projects
None yet
Development

No branches or pull requests

3 participants