Class that provides an interface for interacting with Google Cloud Storage (GCS) as a document store. It extends the Docstore class and implements methods to search, add, and add a document to the GCS bucket.

Hierarchy

  • Docstore
    • GoogleCloudStorageDocstore

Constructors

Properties

Methods

Constructors

Properties

bucket: string
prefix: string = ""
storage: Storage

Methods

  • Adds multiple documents to the GCS bucket.

    Parameters

    • texts: Record<string, Document>

      An object where each key is the name of a document and the value is the Document instance to be added

    Returns Promise<void>

    A Promise that resolves when all documents have been added

  • Adds a single document to the GCS bucket.

    Parameters

    • name: string

      The name of the document to be added

    • document: Document

      The Document instance to be added

    Returns Promise<void>

    A Promise that resolves when the document has been added

  • Searches for a document in the GCS bucket and returns it as a Document instance.

    Parameters

    • search: string

      The name of the document to search for in the GCS bucket

    Returns Promise<Document>

    A Promise that resolves to a Document instance representing the found document