Llm.VectorStores
Overview
Available Operations
- create - Create a vector store
- list - List vector stores
- get - Retrieve a vector store
- update - Modify a vector store
- delete - Delete a vector store
- search - Search a vector store
- createFile - Add a file to a vector store
- listFiles - List files in a vector store
- getFile - Retrieve a vector store file
- updateFile - Update file attributes
- deleteFile - Remove file from vector store
- getFileContent - Retrieve parsed file content
- createFileBatch - Batch add multiple files to vector store
- getFileBatch - Retrieve file batch status
- cancelFileBatch - Cancel batch file processing
- listFilesInBatch - List files in a batch
create
Creates a new vector store for storing and searching through document embeddings.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.create({
name: "Product Documentation",
description: "Vector store for product manuals and documentation",
fileIds: [
"file-abc123",
],
expiresAfter: {
anchor: "last_active_at",
days: 30,
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresCreate } from "@meetkai/mka1/funcs/llmVectorStoresCreate.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresCreate(sdk, {
name: "Product Documentation",
description: "Vector store for product manuals and documentation",
fileIds: [
"file-abc123",
],
expiresAfter: {
anchor: "last_active_at",
days: 30,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresCreate failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresCreateMutation
} from "@meetkai/mka1/react-query/llmVectorStoresCreate.js";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.VectorStore>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
list
Retrieves a paginated list of all vector stores for the authenticated user.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.list({
after: "vs_abc123",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresList } from "@meetkai/mka1/funcs/llmVectorStoresList.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresList(sdk, {
after: "vs_abc123",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresList failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresList,
useLlmVectorStoresListSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresList,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresList,
invalidateAllLlmVectorStoresList,
} from "@meetkai/mka1/react-query/llmVectorStoresList.js";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.VectorStoreList>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
get
Retrieves a vector store by its ID.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.get({
vectorStoreId: "vs_abc123",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresGet } from "@meetkai/mka1/funcs/llmVectorStoresGet.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresGet(sdk, {
vectorStoreId: "vs_abc123",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresGet failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresGet,
useLlmVectorStoresGetSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresGet,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresGet,
invalidateAllLlmVectorStoresGet,
} from "@meetkai/mka1/react-query/llmVectorStoresGet.js";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.VectorStore>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
update
Updates the properties of an existing vector store.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.update({
vectorStoreId: "vs_abc123",
modifyVectorStoreRequest: {
name: "Updated Product Documentation",
expiresAfter: {
anchor: "last_active_at",
days: 60,
},
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresUpdate } from "@meetkai/mka1/funcs/llmVectorStoresUpdate.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresUpdate(sdk, {
vectorStoreId: "vs_abc123",
modifyVectorStoreRequest: {
name: "Updated Product Documentation",
expiresAfter: {
anchor: "last_active_at",
days: 60,
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresUpdate failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresUpdateMutation
} from "@meetkai/mka1/react-query/llmVectorStoresUpdate.js";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.VectorStore>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
delete
Permanently deletes a vector store and its associated embeddings.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.delete({
vectorStoreId: "vs_abc123",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresDelete } from "@meetkai/mka1/funcs/llmVectorStoresDelete.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresDelete(sdk, {
vectorStoreId: "vs_abc123",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresDelete failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresDeleteMutation
} from "@meetkai/mka1/react-query/llmVectorStoresDelete.js";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.VectorStoreDeletionStatus>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
search
Performs semantic search within a vector store to find the most relevant document chunks for a query.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.search({
vectorStoreId: "vs_abc123",
searchVectorStoreRequest: {
query: "How do I reset my password?",
maxNumResults: 5,
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresSearch } from "@meetkai/mka1/funcs/llmVectorStoresSearch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresSearch(sdk, {
vectorStoreId: "vs_abc123",
searchVectorStoreRequest: {
query: "How do I reset my password?",
maxNumResults: 5,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresSearch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresSearchMutation
} from "@meetkai/mka1/react-query/llmVectorStoresSearch.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SearchVectorStoreRequest | ✔️ | 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.VectorStoreSearchResults>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
createFile
Adds a file to a vector store for semantic search indexing.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.createFile({
vectorStoreId: "vs_abc123",
createVectorStoreFileRequest: {
fileId: "file-abc123",
attributes: {
"category": "manual",
"version": "2.0",
},
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresCreateFile } from "@meetkai/mka1/funcs/llmVectorStoresCreateFile.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresCreateFile(sdk, {
vectorStoreId: "vs_abc123",
createVectorStoreFileRequest: {
fileId: "file-abc123",
attributes: {
"category": "manual",
"version": "2.0",
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresCreateFile failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresCreateFileMutation
} from "@meetkai/mka1/react-query/llmVectorStoresCreateFile.js";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.VectorStoreFile>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listFiles
Retrieves a paginated list of all files in a specific vector store.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.listFiles({
vectorStoreId: "vs_abc123",
after: "file-abc123",
filter: "completed",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresListFiles } from "@meetkai/mka1/funcs/llmVectorStoresListFiles.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresListFiles(sdk, {
vectorStoreId: "vs_abc123",
after: "file-abc123",
filter: "completed",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresListFiles failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresListFiles,
useLlmVectorStoresListFilesSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresListFiles,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresListFiles,
invalidateAllLlmVectorStoresListFiles,
} from "@meetkai/mka1/react-query/llmVectorStoresListFiles.js";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.VectorStoreFileList>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getFile
Retrieves detailed information about a specific file within a vector store.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.getFile({
vectorStoreId: "vs_abc123",
fileId: "file-abc123",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresGetFile } from "@meetkai/mka1/funcs/llmVectorStoresGetFile.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresGetFile(sdk, {
vectorStoreId: "vs_abc123",
fileId: "file-abc123",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresGetFile failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresGetFile,
useLlmVectorStoresGetFileSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresGetFile,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresGetFile,
invalidateAllLlmVectorStoresGetFile,
} from "@meetkai/mka1/react-query/llmVectorStoresGetFile.js";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.VectorStoreFile>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
updateFile
Updates the metadata attributes attached to a file within a vector store.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.updateFile({
vectorStoreId: "vs_abc123",
fileId: "file-abc123",
updateVectorStoreFileAttributesRequest: {
attributes: {
"category": "manual",
"version": "3.0",
},
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresUpdateFile } from "@meetkai/mka1/funcs/llmVectorStoresUpdateFile.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresUpdateFile(sdk, {
vectorStoreId: "vs_abc123",
fileId: "file-abc123",
updateVectorStoreFileAttributesRequest: {
attributes: {
"category": "manual",
"version": "3.0",
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresUpdateFile failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresUpdateFileMutation
} from "@meetkai/mka1/react-query/llmVectorStoresUpdateFile.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.UpdateVectorStoreFileAttributesRequest | ✔️ | 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.VectorStoreFile>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteFile
Removes a file from a vector store and deletes its associated embeddings.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.deleteFile({
vectorStoreId: "vs_abc123",
fileId: "file-abc123",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresDeleteFile } from "@meetkai/mka1/funcs/llmVectorStoresDeleteFile.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresDeleteFile(sdk, {
vectorStoreId: "vs_abc123",
fileId: "file-abc123",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresDeleteFile failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresDeleteFileMutation
} from "@meetkai/mka1/react-query/llmVectorStoresDeleteFile.js";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.VectorStoreFileDeletionStatus>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getFileContent
Retrieves the complete parsed contents of a file within a vector store.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.getFileContent({
vectorStoreId: "vs_abc123",
fileId: "file-abc123",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresGetFileContent } from "@meetkai/mka1/funcs/llmVectorStoresGetFileContent.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresGetFileContent(sdk, {
vectorStoreId: "vs_abc123",
fileId: "file-abc123",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresGetFileContent failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresGetFileContent,
useLlmVectorStoresGetFileContentSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresGetFileContent,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresGetFileContent,
invalidateAllLlmVectorStoresGetFileContent,
} from "@meetkai/mka1/react-query/llmVectorStoresGetFileContent.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetVectorStoreFileContentRequest | ✔️ | 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.VectorStoreFileContent>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
createFileBatch
Adds multiple files to a vector store in a single batch operation.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.createFileBatch({
vectorStoreId: "vs_abc123",
createVectorStoreFileBatchRequest: {
fileIds: [
"file-abc123",
"file-def456",
"file-ghi789",
],
attributes: {
"batch_id": "import-2024-01",
},
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresCreateFileBatch } from "@meetkai/mka1/funcs/llmVectorStoresCreateFileBatch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresCreateFileBatch(sdk, {
vectorStoreId: "vs_abc123",
createVectorStoreFileBatchRequest: {
fileIds: [
"file-abc123",
"file-def456",
"file-ghi789",
],
attributes: {
"batch_id": "import-2024-01",
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresCreateFileBatch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresCreateFileBatchMutation
} from "@meetkai/mka1/react-query/llmVectorStoresCreateFileBatch.js";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.VectorStoreFileBatch>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getFileBatch
Retrieves the status of a specific file batch operation within a vector store.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.getFileBatch({
vectorStoreId: "vs_abc123",
batchId: "vsfb_abc123",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresGetFileBatch } from "@meetkai/mka1/funcs/llmVectorStoresGetFileBatch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresGetFileBatch(sdk, {
vectorStoreId: "vs_abc123",
batchId: "vsfb_abc123",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresGetFileBatch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresGetFileBatch,
useLlmVectorStoresGetFileBatchSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresGetFileBatch,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresGetFileBatch,
invalidateAllLlmVectorStoresGetFileBatch,
} from "@meetkai/mka1/react-query/llmVectorStoresGetFileBatch.js";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.VectorStoreFileBatch>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
cancelFileBatch
Cancels an in-progress file batch operation.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.cancelFileBatch({
vectorStoreId: "vs_abc123",
batchId: "vsfb_abc123",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresCancelFileBatch } from "@meetkai/mka1/funcs/llmVectorStoresCancelFileBatch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresCancelFileBatch(sdk, {
vectorStoreId: "vs_abc123",
batchId: "vsfb_abc123",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresCancelFileBatch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresCancelFileBatchMutation
} from "@meetkai/mka1/react-query/llmVectorStoresCancelFileBatch.js";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.VectorStoreFileBatch>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listFilesInBatch
Retrieves a paginated list of all files within a specific batch operation.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.listFilesInBatch({
vectorStoreId: "vs_abc123",
batchId: "vsfb_abc123",
after: "file-abc123",
filter: "completed",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresListFilesInBatch } from "@meetkai/mka1/funcs/llmVectorStoresListFilesInBatch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresListFilesInBatch(sdk, {
vectorStoreId: "vs_abc123",
batchId: "vsfb_abc123",
after: "file-abc123",
filter: "completed",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresListFilesInBatch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresListFilesInBatch,
useLlmVectorStoresListFilesInBatchSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresListFilesInBatch,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresListFilesInBatch,
invalidateAllLlmVectorStoresListFilesInBatch,
} from "@meetkai/mka1/react-query/llmVectorStoresListFilesInBatch.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListVectorStoreFilesInBatchRequest | ✔️ | 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.VectorStoreFileList>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |