langchain.js
    Preparing search index...

    A class that represents a connection to a Google Vertex AI Matching Engine instance.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Parameters

      Returns MatchingEngine

    Properties

    apiEndpoint: string

    The host to connect to for queries and upserts.

    apiVersion: string = "v1"

    The version of the API functions. Part of the path.

    authOptions: GoogleAuthOptions

    Explicitly set Google Auth credentials if you cannot get them from google auth application-default login This is useful for serverless or autoscaling environments like Fargate

    caller: AsyncCaller
    callerOptions: AsyncCallerCallOptions
    callerParams: AsyncCallerParams
    deployedIndexId: string

    The id for the "deployed index", which is an identifier in the index endpoint that references the index (but is not the index id)

    docstore: Docstore

    Docstore that retains the document, stored by ID

    endpoint: string = "us-central1-aiplatform.googleapis.com"

    Hostname for the API call

    FilterType: Restriction[]
    index: string

    The id for the index

    indexEndpoint: string

    The id for the index endpoint

    indexEndpointClient: IndexEndpointConnection
    location: string = "us-central1"

    Region where the LLM is stored

    removeDatapointClient: RemoveDatapointConnection
    upsertDatapointClient: UpsertDatapointConnection

    Methods

    • Returns string

    • Parameters

      • documents: Document[]

      Returns Promise<void>

    • Parameters

      • vectors: number[][]
      • documents: Document[]

      Returns Promise<void>

    • Create an index datapoint for the vector and document id. If an id does not exist, create it and set the document to its value.

      Parameters

      Returns IndexDatapoint

    • Parameters

      • documentMetadata: Record<string, any>

      Returns { [key: string]: null | string | number | boolean | string[] }

    • For this index endpoint, figure out what API Endpoint URL and deployed index ID should be used to do upserts and queries. Also sets the apiEndpoint and deployedIndexId property for future use.

      Returns Promise<PublicAPIEndpointInfo>

      The URL

    • Returns Promise<string>

    • Returns Promise<string>

    • Given the metadata from a document, convert it to an array of Restriction objects that may be passed to the Matching Engine and stored. The default implementation flattens any metadata and includes it as an "allowList". Subclasses can choose to convert some of these to "denyList" items or to add additional restrictions (for example, to format dates into a different structure or to add additional restrictions based on the date).

      Parameters

      • documentMetadata: Record<string, any>

        The metadata from a document

      Returns Restriction[]

      a Restriction[] (or an array of a subclass, from the FilterType)

    • Parameters

      Returns Promise<[Document, number][]>

    • Parameters

      Returns Promise<VectorStore>

    • Parameters

      • texts: string[]
      • metadatas: object | object[]
      • embeddings: EmbeddingsInterface
      • dbConfig: MatchingEngineArgs

      Returns Promise<VectorStore>