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

Hierarchy

Implements

Constructors

Properties

FilterType: Restriction[]
apiEndpoint: string

The host to connect to for queries and upserts.

apiVersion: string = "v1"

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

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

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

Hostname for the API call

index: string

The id for the index

indexEndpoint: string

The id for the index endpoint

indexEndpointClient: IndexEndpointConnection
lc_kwargs: SerializedFields
lc_namespace: string[] = ...

A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.

lc_serializable: boolean = false
location: string = "us-central1"

Region where the LLM is stored

removeDatapointClient: RemoveDatapointConnection
upsertDatapointClient: UpsertDatapointConnection

Accessors

  • get lc_aliases(): undefined | {
        [key: string]: string;
    }
  • A map of aliases for constructor args. Keys are the attribute names, e.g. "foo". Values are the alias that will replace the key in serialization. This is used to eg. make argument names match Python.

    Returns undefined | {
        [key: string]: string;
    }

  • get lc_attributes(): undefined | SerializedFields
  • A map of additional attributes to merge with constructor args. Keys are the attribute names, e.g. "foo". Values are the attribute values, which will be serialized. These attributes need to be accepted by the constructor as arguments.

    Returns undefined | SerializedFields

  • get lc_secrets(): undefined | {
        [key: string]: string;
    }
  • A map of secrets, which will be omitted from serialization. Keys are paths to the secret in constructor args, e.g. "foo.bar.baz". Values are the secret ids, which will be used when deserializing.

    Returns undefined | {
        [key: string]: string;
    }

Methods

  • 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]: string | number | boolean | string[] | null;
    }

    • [key: string]: string | number | boolean | string[] | null
  • 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)

  • The name of the serializable. Override to provide an alias or to preserve the serialized module name in minified environments.

    Implemented as a static method to support loading logic.

    Returns string

Generated using TypeDoc