Skip to content

Latest commit

 

History

History
1028 lines (726 loc) · 75.5 KB

README.md

File metadata and controls

1028 lines (726 loc) · 75.5 KB

VectorStores

(vectorStores)

Overview

Available Operations

listVectorStores

Returns a list of vector stores.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.listVectorStores({});

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresListVectorStores } from "argot-open-ai/funcs/vectorStoresListVectorStores.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresListVectorStores(argotOpenAi, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.ListVectorStoresRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ListVectorStoresResponse>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

createVectorStore

Create a vector store.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.createVectorStore({});

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresCreateVectorStore } from "argot-open-ai/funcs/vectorStoresCreateVectorStore.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresCreateVectorStore(argotOpenAi, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request components.CreateVectorStoreRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.VectorStoreObject>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

getVectorStore

Retrieves a vector store.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.getVectorStore({
    vectorStoreId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresGetVectorStore } from "argot-open-ai/funcs/vectorStoresGetVectorStore.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresGetVectorStore(argotOpenAi, {
    vectorStoreId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetVectorStoreRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.VectorStoreObject>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

modifyVectorStore

Modifies a vector store.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.modifyVectorStore({
    vectorStoreId: "<id>",
    updateVectorStoreRequest: {},
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresModifyVectorStore } from "argot-open-ai/funcs/vectorStoresModifyVectorStore.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresModifyVectorStore(argotOpenAi, {
    vectorStoreId: "<id>",
    updateVectorStoreRequest: {},
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.ModifyVectorStoreRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.VectorStoreObject>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

deleteVectorStore

Delete a vector store.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.deleteVectorStore({
    vectorStoreId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresDeleteVectorStore } from "argot-open-ai/funcs/vectorStoresDeleteVectorStore.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresDeleteVectorStore(argotOpenAi, {
    vectorStoreId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.DeleteVectorStoreRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.DeleteVectorStoreResponse>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

listVectorStoreFiles

Returns a list of vector store files.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.listVectorStoreFiles({
    vectorStoreId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresListVectorStoreFiles } from "argot-open-ai/funcs/vectorStoresListVectorStoreFiles.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresListVectorStoreFiles(argotOpenAi, {
    vectorStoreId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.ListVectorStoreFilesRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ListVectorStoreFilesResponse>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

createVectorStoreFile

Create a vector store file by attaching a File to a vector store.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.createVectorStoreFile({
    vectorStoreId: "vs_abc123",
    createVectorStoreFileRequest: {
      fileId: "<id>",
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresCreateVectorStoreFile } from "argot-open-ai/funcs/vectorStoresCreateVectorStoreFile.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresCreateVectorStoreFile(argotOpenAi, {
    vectorStoreId: "vs_abc123",
    createVectorStoreFileRequest: {
      fileId: "<id>",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.CreateVectorStoreFileRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.VectorStoreFileObject>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

getVectorStoreFile

Retrieves a vector store file.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.getVectorStoreFile({
    vectorStoreId: "vs_abc123",
    fileId: "file-abc123",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresGetVectorStoreFile } from "argot-open-ai/funcs/vectorStoresGetVectorStoreFile.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresGetVectorStoreFile(argotOpenAi, {
    vectorStoreId: "vs_abc123",
    fileId: "file-abc123",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetVectorStoreFileRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.VectorStoreFileObject>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

deleteVectorStoreFile

Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.deleteVectorStoreFile({
    vectorStoreId: "<id>",
    fileId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresDeleteVectorStoreFile } from "argot-open-ai/funcs/vectorStoresDeleteVectorStoreFile.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresDeleteVectorStoreFile(argotOpenAi, {
    vectorStoreId: "<id>",
    fileId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.DeleteVectorStoreFileRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.DeleteVectorStoreFileResponse>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

createVectorStoreFileBatch

Create a vector store file batch.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.createVectorStoreFileBatch({
    vectorStoreId: "vs_abc123",
    createVectorStoreFileBatchRequest: {
      fileIds: [
        "<value>",
      ],
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresCreateVectorStoreFileBatch } from "argot-open-ai/funcs/vectorStoresCreateVectorStoreFileBatch.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresCreateVectorStoreFileBatch(argotOpenAi, {
    vectorStoreId: "vs_abc123",
    createVectorStoreFileBatchRequest: {
      fileIds: [
        "<value>",
      ],
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.CreateVectorStoreFileBatchRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.VectorStoreFileBatchObject>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

getVectorStoreFileBatch

Retrieves a vector store file batch.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.getVectorStoreFileBatch({
    vectorStoreId: "vs_abc123",
    batchId: "vsfb_abc123",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresGetVectorStoreFileBatch } from "argot-open-ai/funcs/vectorStoresGetVectorStoreFileBatch.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresGetVectorStoreFileBatch(argotOpenAi, {
    vectorStoreId: "vs_abc123",
    batchId: "vsfb_abc123",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetVectorStoreFileBatchRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.VectorStoreFileBatchObject>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

cancelVectorStoreFileBatch

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.cancelVectorStoreFileBatch({
    vectorStoreId: "<id>",
    batchId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresCancelVectorStoreFileBatch } from "argot-open-ai/funcs/vectorStoresCancelVectorStoreFileBatch.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresCancelVectorStoreFileBatch(argotOpenAi, {
    vectorStoreId: "<id>",
    batchId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.CancelVectorStoreFileBatchRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.VectorStoreFileBatchObject>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

listFilesInVectorStoreBatch

Returns a list of vector store files in a batch.

Example Usage

import { ArgotOpenAi } from "argot-open-ai";

const argotOpenAi = new ArgotOpenAi({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const result = await argotOpenAi.vectorStores.listFilesInVectorStoreBatch({
    vectorStoreId: "<id>",
    batchId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { vectorStoresListFilesInVectorStoreBatch } from "argot-open-ai/funcs/vectorStoresListFilesInVectorStoreBatch.js";

// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
  apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});

async function run() {
  const res = await vectorStoresListFilesInVectorStoreBatch(argotOpenAi, {
    vectorStoreId: "<id>",
    batchId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.ListFilesInVectorStoreBatchRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ListVectorStoreFilesResponse>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*