Skip to main content

UpdateApi

A class for interfacing with the Vecto Update API.

Methods:

clearVectorSpace

async clearVectorSpace(requestParameters: ClearVectorSpaceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ActionStatusResponse>

Delete all entries and stored analogies within a vector space.

Args:

  • requestParameters (ClearVectorSpaceRequest): Parameters for the clear vector space request.

    • vectorSpaceId: The ID of the vector space to clear (required).
  • initOverrides (RequestInit or runtime.InitOverrideFunction): Overrides for the request initialization.

Returns:

  • ActionStatusResponse: Response of the clear vector space operation.

Example:

import { Configuration, UpdateApi, ClearVectorSpaceRequest } from 'vecto-sdk'

const config = new Configuration({
accessToken: 'your-token'
});

const api = new UpdateApi(config);

const clearParams: ClearVectorSpaceRequest = {
vectorSpaceId: 'your-vector-space-id',
};

const response = await api.clearVectorSpace(clearParams);

updateAttributes

async updateAttributes(requestParameters: UpdateAttributesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ActionStatusResponse>

Update attributes of one or more elements in the vector space.

Args:

  • requestParameters (UpdateAttributesRequest): Parameters for updating the attributes.

    • vectorSpaceId: The ID of the vector space where the attributes are updated (required).
    • id: List of IDs of the vectors to update.
    • attributes: List of attributes to update.
  • initOverrides (RequestInit or runtime.InitOverrideFunction): Overrides for the request initialization.

Returns:

  • ActionStatusResponse: Response of the update attributes operation.

Example:

import { Configuration, UpdateApi, UpdateAttributesRequest } from 'vecto-sdk'

const config = new Configuration({
accessToken: 'your-token'
});

const api = new UpdateApi(config);

const updateAttrsParams: UpdateAttributesRequest = {
vectorSpaceId: 'your-vector-space-id',
id: [1, 2], // list of vector IDs to update
attributes: [JSON.stringify('attr1'), JSON.stringify('attr2')], // attributes to update
};

const response = await api.updateAttributes(updateAttrsParams);

updateEmbeddings

async updateEmbeddings(requestParameters: UpdateEmbeddingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ActionStatusResponse>

Update the embeddings of one or more vectors in the vector space.

Args:

  • requestParameters (UpdateEmbeddingsRequest): Parameters for updating the embeddings.

    • vectorSpaceId: The ID of the vector space where the embeddings are updated (required).
    • modality: The modality of the vector embeddings.
    • id: List of IDs of the vectors to update.
    • input: Array of Blob data for the new embeddings.
  • initOverrides (RequestInit or runtime.InitOverrideFunction): Overrides for the request initialization.

Returns:

  • ActionStatusResponse: Response of the update embeddings operation.

Example:

import { Configuration, UpdateApi, UpdateEmbeddingsRequest } from 'vecto-sdk'

const config = new Configuration({
accessToken: 'your-token'
});

const api = new UpdateApi(config);

const updateEmbeddingsParams: UpdateEmbeddingsRequest = {
vectorSpaceId: 'your-vector-space-id',
modality: 'your-modality',
id: [1, 2, 3], // list of vector IDs to update
input: [blob1, blob2], // blob data for new embeddings
};

const response = await api.updateEmbeddings(updateEmbeddingsParams);