- getDeploymentSummaries - Get Deployment Summaries
- registerDeployment - Register (or re-register) a search index
- unregisterDeployment - Unregister Deployment
- updateIndexMetrics - Update Index Metrics
Fetch all indexes available to a user
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.searchIndexes.getDeploymentSummaries();
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaRagSearchIndexesGetDeploymentSummaries } from "@mistralai/mistralai/funcs/betaRagSearchIndexesGetDeploymentSummaries.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaRagSearchIndexesGetDeploymentSummaries(mistral);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaRagSearchIndexesGetDeploymentSummaries 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<components.GetDeploymentSummariesResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Register (or re-register) a search index
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.searchIndexes.registerDeployment({
name: "<value>",
deployment: {
type: "vespa",
vespaVersion: "<value>",
indexes: [],
queryUrl: "https://joyful-granny.info",
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaRagSearchIndexesRegisterDeployment } from "@mistralai/mistralai/funcs/betaRagSearchIndexesRegisterDeployment.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaRagSearchIndexesRegisterDeployment(mistral, {
name: "<value>",
deployment: {
type: "vespa",
vespaVersion: "<value>",
indexes: [],
queryUrl: "https://joyful-granny.info",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaRagSearchIndexesRegisterDeployment failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.RegisterDeploymentRequestDeployment | ✔️ | 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<components.RegisterSearchIndexResponseIndex>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete all information about a deployment
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.searchIndexes.unregisterDeployment({
deploymentId: "240a5e63-fd68-4806-8290-04cce22b4c37",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaRagSearchIndexesUnregisterDeployment } from "@mistralai/mistralai/funcs/betaRagSearchIndexesUnregisterDeployment.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaRagSearchIndexesUnregisterDeployment(mistral, {
deploymentId: "240a5e63-fd68-4806-8290-04cce22b4c37",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaRagSearchIndexesUnregisterDeployment failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UnregisterDeploymentV1RagDeploymentsDeploymentIdDeleteRequest | ✔️ | 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<any>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Update the metrics for a given index
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.rag.searchIndexes.updateIndexMetrics({
deploymentId: "b0c2f463-8aef-437d-83ac-d4bfae874584",
requestBody: {
status: "offline",
clearMetrics: false,
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaRagSearchIndexesUpdateIndexMetrics } from "@mistralai/mistralai/funcs/betaRagSearchIndexesUpdateIndexMetrics.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaRagSearchIndexesUpdateIndexMetrics(mistral, {
deploymentId: "b0c2f463-8aef-437d-83ac-d4bfae874584",
requestBody: {
status: "offline",
clearMetrics: false,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaRagSearchIndexesUpdateIndexMetrics failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UpdateIndexMetricsV1RagDeploymentsDeploymentIdMetricsPutRequest | ✔️ | 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<any>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |