Search.TextStore
Overview
Available Operations
- createTextStore - Create Store
- addTexts - Add Texts
- deleteTexts - Delete Texts
- searchTexts - Search Texts
- deleteTextStore - Delete Store
createTextStore
Create a new text store
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.search.textStore.createTextStore({
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
createTextStoreRequest: {
storeName: "product_catalog",
dimension: 3,
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTextStoreCreateTextStore } from "@meetkai/mka1/funcs/searchTextStoreCreateTextStore.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 searchTextStoreCreateTextStore(sdk, {
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
createTextStoreRequest: {
storeName: "product_catalog",
dimension: 3,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTextStoreCreateTextStore 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.
useSearchTextStoreCreateTextStoreMutation
} from "@meetkai/mka1/react-query/searchTextStoreCreateTextStore.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CreateTextStoreRequest | ✔️ | 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.CreateTextStoreResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TextStoreErrorResponse | 400 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
addTexts
Add texts to a store with a group identifier
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.search.textStore.addTexts({
storeName: "<value>",
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
addTextsRequest: {
texts: [
"Wireless noise-cancelling headphones with 30-hour battery life",
"USB-C charging cable with braided nylon sleeve",
"Portable 65W GaN wall charger with two USB-C ports",
],
vectors: [
[
0.14,
-0.07,
0.31,
],
[
0.19,
-0.11,
0.27,
],
[
0.09,
-0.04,
0.22,
],
],
group: "electronics_q1_2026",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTextStoreAddTexts } from "@meetkai/mka1/funcs/searchTextStoreAddTexts.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 searchTextStoreAddTexts(sdk, {
storeName: "<value>",
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
addTextsRequest: {
texts: [
"Wireless noise-cancelling headphones with 30-hour battery life",
"USB-C charging cable with braided nylon sleeve",
"Portable 65W GaN wall charger with two USB-C ports",
],
vectors: [
[
0.14,
-0.07,
0.31,
],
[
0.19,
-0.11,
0.27,
],
[
0.09,
-0.04,
0.22,
],
],
group: "electronics_q1_2026",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTextStoreAddTexts 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.
useSearchTextStoreAddTextsMutation
} from "@meetkai/mka1/react-query/searchTextStoreAddTexts.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.AddTextsRequest | ✔️ | 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.AddTextsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TextStoreErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
deleteTexts
Delete texts from a store by specific texts or group identifiers
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.search.textStore.deleteTexts({
storeName: "<value>",
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
deleteTextsRequest: {
texts: [
"USB-C charging cable with braided nylon sleeve",
],
groups: [
"electronics_q1_2026",
],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTextStoreDeleteTexts } from "@meetkai/mka1/funcs/searchTextStoreDeleteTexts.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 searchTextStoreDeleteTexts(sdk, {
storeName: "<value>",
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
deleteTextsRequest: {
texts: [
"USB-C charging cable with braided nylon sleeve",
],
groups: [
"electronics_q1_2026",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTextStoreDeleteTexts 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.
useSearchTextStoreDeleteTextsMutation
} from "@meetkai/mka1/react-query/searchTextStoreDeleteTexts.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteTextsRequest | ✔️ | 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.DeleteTextsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TextStoreErrorResponse | 400, 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
searchTexts
Search for similar texts in a store
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.search.textStore.searchTexts({
storeName: "<value>",
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
searchTextRequest: {
query: "noise-cancelling headphones",
vector: [
0.16,
-0.08,
0.29,
],
limit: 5,
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTextStoreSearchTexts } from "@meetkai/mka1/funcs/searchTextStoreSearchTexts.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 searchTextStoreSearchTexts(sdk, {
storeName: "<value>",
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
searchTextRequest: {
query: "noise-cancelling headphones",
vector: [
0.16,
-0.08,
0.29,
],
limit: 5,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTextStoreSearchTexts 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.
useSearchTextStoreSearchTextsMutation
} from "@meetkai/mka1/react-query/searchTextStoreSearchTexts.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SearchTextsRequest | ✔️ | 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.SearchTextResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TextStoreErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
deleteTextStore
Delete a text store and all its data
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.search.textStore.deleteTextStore({
storeName: "<value>",
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchTextStoreDeleteTextStore } from "@meetkai/mka1/funcs/searchTextStoreDeleteTextStore.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 searchTextStoreDeleteTextStore(sdk, {
storeName: "<value>",
xApiKeyId: "<id>",
xUserId: "<id>",
xExchangeJwtExternalUserId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("searchTextStoreDeleteTextStore 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.
useSearchTextStoreDeleteTextStoreMutation
} from "@meetkai/mka1/react-query/searchTextStoreDeleteTextStore.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteTextStoreRequest | ✔️ | 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.DeleteTextStoreResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.TextStoreErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |