Skip to content

Commit b278899

Browse files
fix(community): Optional google cloud storage options for GCS doc loader (#7791)
Co-authored-by: Jacob Lee <[email protected]>
1 parent 600c3f0 commit b278899

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/core_docs/docs/integrations/document_loaders/web_loaders/google_cloud_storage.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ npm install @langchain/community @langchain/core @google-cloud/storage
2727

2828
Once Unstructured is configured, you can use the Google Cloud Storage loader to load files and then convert them into a Document.
2929

30+
In addition, you can optionally provide a `storageOptions` parameter to specify not only your storage options but also other authentication ways if you don't want Application Default Credentials(ADC) as default manner.
31+
3032
import CodeBlock from "@theme/CodeBlock";
3133
import Example from "@examples/document_loaders/google_cloud_storage.ts";
3234

libs/langchain-community/src/document_loaders/web/google_cloud_storage.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type GcsLoaderConfig = {
1919
bucket: string;
2020
file: string;
2121
unstructuredLoaderOptions: UnstructuredLoaderOptions;
22-
storageOptions: StorageOptions;
22+
storageOptions?: StorageOptions;
2323
};
2424

2525
/**
@@ -46,7 +46,7 @@ export class GoogleCloudStorageLoader extends BaseDocumentLoader {
4646

4747
private file: string;
4848

49-
private storageOptions: StorageOptions;
49+
private storageOptions: StorageOptions | undefined;
5050

5151
private _fs: typeof fsDefault;
5252

0 commit comments

Comments
 (0)