UNPKG

@langchain/community

Version:
1 lines • 2.75 kB
{"version":3,"file":"gcs.d.ts","names":["Storage","Document","Docstore","GoogleCloudStorageDocstoreConfiguration","GoogleCloudStorageDocstore","Promise","Record"],"sources":["../../../src/stores/doc/gcs.d.ts"],"sourcesContent":["import { Storage } from \"@google-cloud/storage\";\nimport { Document } from \"@langchain/core/documents\";\nimport { Docstore } from \"@langchain/classic/stores/doc/base\";\n/**\n * Interface that defines the configuration for the\n * GoogleCloudStorageDocstore. It includes the bucket name and an optional\n * prefix.\n */\nexport interface GoogleCloudStorageDocstoreConfiguration {\n /** The identifier for the GCS bucket */\n bucket: string;\n /**\n * An optional prefix to prepend to each object name.\n * Often used to create a pseudo-hierarchy.\n */\n prefix?: string;\n}\n/**\n * Class that provides an interface for interacting with Google Cloud\n * Storage (GCS) as a document store. It extends the Docstore class and\n * implements methods to search, add, and add a document to the GCS\n * bucket.\n */\nexport declare class GoogleCloudStorageDocstore extends Docstore {\n bucket: string;\n prefix: string;\n storage: Storage;\n constructor(config: GoogleCloudStorageDocstoreConfiguration);\n /**\n * Searches for a document in the GCS bucket and returns it as a Document\n * instance.\n * @param search The name of the document to search for in the GCS bucket\n * @returns A Promise that resolves to a Document instance representing the found document\n */\n search(search: string): Promise<Document>;\n /**\n * Adds multiple documents to the GCS bucket.\n * @param texts An object where each key is the name of a document and the value is the Document instance to be added\n * @returns A Promise that resolves when all documents have been added\n */\n add(texts: Record<string, Document>): Promise<void>;\n /**\n * Adds a single document to the GCS bucket.\n * @param name The name of the document to be added\n * @param document The Document instance to be added\n * @returns A Promise that resolves when the document has been added\n */\n addDocument(name: string, document: Document): Promise<void>;\n /**\n * Gets a file from the GCS bucket.\n * @param name The name of the file to get from the GCS bucket\n * @returns A File instance representing the fetched file\n */\n private getFile;\n}\n//# sourceMappingURL=gcs.d.ts.map"],"mappings":";;;;;;;;AAQA;AAeA;;AAIwBG,UAnBPA,uCAAAA,CAmBOA;EAOYF;EAARI,MAAAA,EAAAA,MAAAA;EAMEJ;;;;EAOqBI,MAAAA,CAAAA,EAAAA,MAAAA;;AAxBa;;;;;;cAA3CD,0BAAAA,SAAmCF,QAAAA;;;WAG3CF;sBACWG;;;;;;;0BAOIE,QAAQJ;;;;;;aAMrBK,eAAeL,YAAYI;;;;;;;sCAOFJ,WAAWI"}