- fetch - Get the content of a given dataset record
- delete - Delete a record from a dataset
- bulkDelete - Delete multiple records from datasets
- judge - Run Judge on a dataset record based on the given options
- updatePayload - Update a dataset record payload
- updateProperties - Update dataset record properties
Get the content of a given dataset record
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.datasets.records.fetch({
datasetRecordId: "ce995349-abbf-45c0-be75-885fc1c4b4c0",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsRecordsFetch } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsRecordsFetch.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 betaObservabilityDatasetsRecordsFetch(mistral, {
datasetRecordId: "ce995349-abbf-45c0-be75-885fc1c4b4c0",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsRecordsFetch failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIdGetRequest | ✔️ | 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.DatasetRecord>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete a record from a dataset
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
await mistral.beta.observability.datasets.records.delete({
datasetRecordId: "799fed99-80b4-4a9a-a15e-05352b811702",
});
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsRecordsDelete } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsRecordsDelete.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 betaObservabilityDatasetsRecordsDelete(mistral, {
datasetRecordId: "799fed99-80b4-4a9a-a15e-05352b811702",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("betaObservabilityDatasetsRecordsDelete failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIdDeleteRequest | ✔️ | 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<void>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete multiple records from datasets
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
await mistral.beta.observability.datasets.records.bulkDelete({
datasetRecordIds: [
"22fc78f7-e774-4ab5-b1ea-63852992ef31",
"1c533b4f-882e-4bd0-9ef6-9933b825f8b1",
],
});
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsRecordsBulkDelete } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsRecordsBulkDelete.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 betaObservabilityDatasetsRecordsBulkDelete(mistral, {
datasetRecordIds: [
"22fc78f7-e774-4ab5-b1ea-63852992ef31",
"1c533b4f-882e-4bd0-9ef6-9933b825f8b1",
],
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("betaObservabilityDatasetsRecordsBulkDelete failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.DeleteDatasetRecordsRequest | ✔️ | 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<void>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Run Judge on a dataset record based on the given options
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.datasets.records.judge({
datasetRecordId: "9de5d7a1-787a-45dd-b668-9f3407e76d8b",
judgeDatasetRecordRequest: {
judgeDefinition: {
name: "<value>",
description: "wisely railway deceivingly arcade minion back what yowza outrun service",
modelName: "<value>",
output: {
type: "CLASSIFICATION",
options: [
{
value: "<value>",
description: "spork excluding without retrospectivity bah next yearly",
},
],
},
instructions: "<value>",
tools: [
"<value 1>",
],
},
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsRecordsJudge } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsRecordsJudge.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 betaObservabilityDatasetsRecordsJudge(mistral, {
datasetRecordId: "9de5d7a1-787a-45dd-b668-9f3407e76d8b",
judgeDatasetRecordRequest: {
judgeDefinition: {
name: "<value>",
description: "wisely railway deceivingly arcade minion back what yowza outrun service",
modelName: "<value>",
output: {
type: "CLASSIFICATION",
options: [
{
value: "<value>",
description: "spork excluding without retrospectivity bah next yearly",
},
],
},
instructions: "<value>",
tools: [
"<value 1>",
],
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsRecordsJudge failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIdLiveJudgingPostRequest | ✔️ | 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.JudgeOutput>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Update a dataset record payload
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
await mistral.beta.observability.datasets.records.updatePayload({
datasetRecordId: "17506b15-748e-4e7c-9737-c97c44d04b0f",
updateDatasetRecordPayloadRequest: {
payload: {
"messages": [
{
"key": "<value>",
},
{
},
{
"key": "<value>",
},
],
},
},
});
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsRecordsUpdatePayload } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsRecordsUpdatePayload.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 betaObservabilityDatasetsRecordsUpdatePayload(mistral, {
datasetRecordId: "17506b15-748e-4e7c-9737-c97c44d04b0f",
updateDatasetRecordPayloadRequest: {
payload: {
"messages": [
{
"key": "<value>",
},
{
},
{
"key": "<value>",
},
],
},
},
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("betaObservabilityDatasetsRecordsUpdatePayload failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIdPayloadPutRequest | ✔️ | 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<void>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Update dataset record properties
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
await mistral.beta.observability.datasets.records.updateProperties({
datasetRecordId: "a4deefc5-0905-427e-ad15-1090ef9e216d",
updateDatasetRecordPropertiesRequest: {
properties: {
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
},
},
});
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsRecordsUpdateProperties } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsRecordsUpdateProperties.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 betaObservabilityDatasetsRecordsUpdateProperties(mistral, {
datasetRecordId: "a4deefc5-0905-427e-ad15-1090ef9e216d",
updateDatasetRecordPropertiesRequest: {
properties: {
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
},
},
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("betaObservabilityDatasetsRecordsUpdateProperties failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIdPropertiesPutRequest | ✔️ | 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<void>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |