Hierarchy

  • BaseModule
    • FileSearchStores

Constructors

Properties

documents: Documents = ...

Methods

  • Uploads a file asynchronously to a given File Search Store. This method is not available in Vertex AI. Supported upload sources:

    • Node.js: File path (string) or Blob object.
    • Browser: Blob object (e.g., File).

    Parameters

    Returns Promise<UploadToFileSearchStoreOperation>

    A promise that resolves to a long running operation.

    The mimeType can be specified in the config parameter. If omitted:

    • For file path (string) inputs, the mimeType will be inferred from the file extension.
    • For Blob object inputs, the mimeType will be set to the Blob's type property.

    This section can contain multiple paragraphs and code examples.

    types.UploadToFileSearchStoreParameters#config for the optional config in the parameters.

    An error if called on a Vertex AI client.

    An error if the mimeType is not provided and can not be inferred, the mimeType can be provided in the params.config parameter.

    An error occurs if a suitable upload location cannot be established.

    The following code uploads a file to a given file search store.

    const operation = await ai.fileSearchStores.upload({fileSearchStoreName: 'fileSearchStores/foo-bar', file: 'file.txt', config: {
    mimeType: 'text/plain',
    }});
    console.log(operation.name);