- ingest - Ingest content into managed search index
- query - Search managed index
- delete - Delete item by ID
- deleteByType - Delete all items of a type
- listTypes - List distinct types and counts
- configure - Update search configuration
Ingest content into managed search index
import { SDK } from "@aerostack/sdk-node";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.ai.search.ingest({
content: "<value>",
type: "<value>",
});
console.log(result);
}
run();The standalone function version of this method:
import { SDKCore } from "@aerostack/sdk-node/core.js";
import { aiSearchIngest } from "@aerostack/sdk-node/funcs/aiSearchIngest.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await aiSearchIngest(sdk, {
content: "<value>",
type: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("aiSearchIngest failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.IngestRequestBody | ✔️ | 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. |
Promise<operations.IngestResponseBody>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Search managed index
import { SDK } from "@aerostack/sdk-node";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.ai.search.query({
text: "<value>",
});
console.log(result);
}
run();The standalone function version of this method:
import { SDKCore } from "@aerostack/sdk-node/core.js";
import { aiSearchQuery } from "@aerostack/sdk-node/funcs/aiSearchQuery.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await aiSearchQuery(sdk, {
text: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("aiSearchQuery failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.QueryRequestBody | ✔️ | 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. |
Promise<operations.QueryResponseBody>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Delete item by ID
import { SDK } from "@aerostack/sdk-node";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.ai.search.delete({
id: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { SDKCore } from "@aerostack/sdk-node/core.js";
import { aiSearchDelete } from "@aerostack/sdk-node/funcs/aiSearchDelete.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await aiSearchDelete(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("aiSearchDelete failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DeleteRequestBody | ✔️ | 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. |
Promise<operations.DeleteResponseBody>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Delete all items of a type
import { SDK } from "@aerostack/sdk-node";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.ai.search.deleteByType({
type: "<value>",
});
console.log(result);
}
run();The standalone function version of this method:
import { SDKCore } from "@aerostack/sdk-node/core.js";
import { aiSearchDeleteByType } from "@aerostack/sdk-node/funcs/aiSearchDeleteByType.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await aiSearchDeleteByType(sdk, {
type: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("aiSearchDeleteByType failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DeleteByTypeRequestBody | ✔️ | 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. |
Promise<operations.DeleteByTypeResponseBody>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
List distinct types and counts
import { SDK } from "@aerostack/sdk-node";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.ai.search.listTypes();
console.log(result);
}
run();The standalone function version of this method:
import { SDKCore } from "@aerostack/sdk-node/core.js";
import { aiSearchListTypes } from "@aerostack/sdk-node/funcs/aiSearchListTypes.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await aiSearchListTypes(sdk);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("aiSearchListTypes failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
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. |
Promise<operations.ListTypesResponseBody>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Update search configuration
import { SDK } from "@aerostack/sdk-node";
const sdk = new SDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await sdk.ai.search.configure({
embeddingModel: "multilingual",
});
console.log(result);
}
run();The standalone function version of this method:
import { SDKCore } from "@aerostack/sdk-node/core.js";
import { aiSearchConfigure } from "@aerostack/sdk-node/funcs/aiSearchConfigure.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await aiSearchConfigure(sdk, {
embeddingModel: "multilingual",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("aiSearchConfigure failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ConfigureRequestBody | ✔️ | 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. |
Promise<operations.ConfigureResponseBody>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |