- create - Create a new empty dataset
- list - List existing datasets
- fetch - Get dataset by id
- delete - Delete a dataset
- update - Patch dataset
- listRecords - List existing records in the dataset
- createRecord - Add a conversation to the dataset
- importFromCampaign - Populate the dataset with a campaign
- importFromExplorer - Populate the dataset with samples from the explorer
- importFromFile - Populate the dataset with samples from an uploaded file
- importFromPlayground - Populate the dataset with samples from the playground
- importFromDatasetRecords - Populate the dataset with samples from another dataset
- exportToJsonl - Export to the Files API and retrieve presigned URL to download the resulting JSONL file
- fetchTask - Get status of a dataset import task
- listTasks - List import tasks for the given dataset
Create a new empty dataset
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.create({
name: "<value>",
description: "citizen whoever sustenance necessary vibrant openly",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsCreate } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsCreate.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 betaObservabilityDatasetsCreate(mistral, {
name: "<value>",
description: "citizen whoever sustenance necessary vibrant openly",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsCreate failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.CreateDatasetRequest | ✔️ | 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.Dataset>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List existing datasets
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.list({});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsList } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsList.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 betaObservabilityDatasetsList(mistral, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsList failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetDatasetsV1ObservabilityDatasetsGetRequest | ✔️ | 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.ListDatasetsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get dataset by id
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.fetch({
datasetId: "036fa362-e080-4fa5-beff-a334a70efb58",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsFetch } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsFetch.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 betaObservabilityDatasetsFetch(mistral, {
datasetId: "036fa362-e080-4fa5-beff-a334a70efb58",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsFetch failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetDatasetByIdV1ObservabilityDatasetsDatasetIdGetRequest | ✔️ | 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.DatasetPreview>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete 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.delete({
datasetId: "baf961a3-bb8e-4085-89ef-de9c5d8c4e77",
});
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsDelete } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsDelete.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 betaObservabilityDatasetsDelete(mistral, {
datasetId: "baf961a3-bb8e-4085-89ef-de9c5d8c4e77",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("betaObservabilityDatasetsDelete failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DeleteDatasetV1ObservabilityDatasetsDatasetIdDeleteRequest | ✔️ | 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 | */* |
Patch dataset
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.update({
datasetId: "95be9afc-fc05-44a6-af9f-2362de1224f9",
updateDatasetRequest: {},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsUpdate } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsUpdate.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 betaObservabilityDatasetsUpdate(mistral, {
datasetId: "95be9afc-fc05-44a6-af9f-2362de1224f9",
updateDatasetRequest: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsUpdate failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UpdateDatasetV1ObservabilityDatasetsDatasetIdPatchRequest | ✔️ | 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.DatasetPreview>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List existing records in the dataset
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.listRecords({
datasetId: "444d2a88-e636-4bc0-ab6c-919bedaed112",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsListRecords } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsListRecords.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 betaObservabilityDatasetsListRecords(mistral, {
datasetId: "444d2a88-e636-4bc0-ab6c-919bedaed112",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsListRecords failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetDatasetRecordsV1ObservabilityDatasetsDatasetIdRecordsGetRequest | ✔️ | 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.ListDatasetRecordsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Add a conversation to the dataset
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.createRecord({
datasetId: "4c54ed13-1459-44e1-8696-1a6df06f7177",
createDatasetRecordRequest: {
payload: {
messages: [
{
"key": "<value>",
},
{
"key": "<value>",
"key1": "<value>",
},
],
},
properties: {
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
},
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsCreateRecord } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsCreateRecord.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 betaObservabilityDatasetsCreateRecord(mistral, {
datasetId: "4c54ed13-1459-44e1-8696-1a6df06f7177",
createDatasetRecordRequest: {
payload: {
messages: [
{
"key": "<value>",
},
{
"key": "<value>",
"key1": "<value>",
},
],
},
properties: {
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsCreateRecord failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CreateDatasetRecordV1ObservabilityDatasetsDatasetIdRecordsPostRequest | ✔️ | 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 | */* |
Populate the dataset with a campaign
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.importFromCampaign({
datasetId: "306b5f31-e31c-4e06-9220-e3008c61bf1b",
importDatasetFromCampaignRequest: {
campaignId: "71a2e42d-7414-4fe6-89cb-44a2122b6f6b",
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsImportFromCampaign } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsImportFromCampaign.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 betaObservabilityDatasetsImportFromCampaign(mistral, {
datasetId: "306b5f31-e31c-4e06-9220-e3008c61bf1b",
importDatasetFromCampaignRequest: {
campaignId: "71a2e42d-7414-4fe6-89cb-44a2122b6f6b",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsImportFromCampaign failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIdImportsFromCampaignPostRequest | ✔️ | 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.DatasetImportTask>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Populate the dataset with samples from the explorer
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.importFromExplorer({
datasetId: "ee1930e9-54f7-4c68-aa8a-40fe5d2a3485",
importDatasetFromExplorerRequest: {
completionEventIds: [
"<value 1>",
"<value 2>",
"<value 3>",
],
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsImportFromExplorer } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsImportFromExplorer.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 betaObservabilityDatasetsImportFromExplorer(mistral, {
datasetId: "ee1930e9-54f7-4c68-aa8a-40fe5d2a3485",
importDatasetFromExplorerRequest: {
completionEventIds: [
"<value 1>",
"<value 2>",
"<value 3>",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsImportFromExplorer failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIdImportsFromExplorerPostRequest | ✔️ | 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.DatasetImportTask>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Populate the dataset with samples from an uploaded file
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.importFromFile({
datasetId: "1c96c925-cc58-4529-863d-9fe66a6f1924",
importDatasetFromFileRequest: {
fileId: "<id>",
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsImportFromFile } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsImportFromFile.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 betaObservabilityDatasetsImportFromFile(mistral, {
datasetId: "1c96c925-cc58-4529-863d-9fe66a6f1924",
importDatasetFromFileRequest: {
fileId: "<id>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsImportFromFile failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIdImportsFromFilePostRequest | ✔️ | 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.DatasetImportTask>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Populate the dataset with samples from the playground
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.importFromPlayground({
datasetId: "5cb42584-5fcf-4837-997a-6a67c5e6900d",
importDatasetFromPlaygroundRequest: {
conversationIds: [],
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsImportFromPlayground } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsImportFromPlayground.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 betaObservabilityDatasetsImportFromPlayground(mistral, {
datasetId: "5cb42584-5fcf-4837-997a-6a67c5e6900d",
importDatasetFromPlaygroundRequest: {
conversationIds: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsImportFromPlayground failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIdImportsFromPlaygroundPostRequest | ✔️ | 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.DatasetImportTask>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Populate the dataset with samples from another dataset
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.importFromDatasetRecords({
datasetId: "ada96a08-d724-4e5c-9111-aaf1bdb7d588",
importDatasetFromDatasetRequest: {
datasetRecordIds: [
"58fe798a-537b-4c61-9efc-d1d96d5d264a",
"cfa1d197-deda-456e-906b-dd84dccfcd17",
],
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsImportFromDatasetRecords } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsImportFromDatasetRecords.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 betaObservabilityDatasetsImportFromDatasetRecords(mistral, {
datasetId: "ada96a08-d724-4e5c-9111-aaf1bdb7d588",
importDatasetFromDatasetRequest: {
datasetRecordIds: [
"58fe798a-537b-4c61-9efc-d1d96d5d264a",
"cfa1d197-deda-456e-906b-dd84dccfcd17",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsImportFromDatasetRecords failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIdImportsFromDatasetPostRequest | ✔️ | 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.DatasetImportTask>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Export to the Files API and retrieve presigned URL to download the resulting JSONL file
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.exportToJsonl({
datasetId: "d521add6-d909-4a69-a460-cb880d87b773",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsExportToJsonl } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsExportToJsonl.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 betaObservabilityDatasetsExportToJsonl(mistral, {
datasetId: "d521add6-d909-4a69-a460-cb880d87b773",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsExportToJsonl failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIdExportsToJsonlGetRequest | ✔️ | 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.ExportDatasetResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get status of a dataset import task
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.fetchTask({
datasetId: "b64b504e-58a2-4d52-979b-e2634b301235",
taskId: "1713cde2-dea1-410d-851e-8cea964ffa14",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsFetchTask } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsFetchTask.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 betaObservabilityDatasetsFetchTask(mistral, {
datasetId: "b64b504e-58a2-4d52-979b-e2634b301235",
taskId: "1713cde2-dea1-410d-851e-8cea964ffa14",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsFetchTask failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetDatasetImportTaskV1ObservabilityDatasetsDatasetIdTasksTaskIdGetRequest | ✔️ | 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.DatasetImportTask>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List import tasks for the given dataset
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.listTasks({
datasetId: "29903443-7f9c-42a6-9b6b-fc5cbef4191a",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityDatasetsListTasks } from "@mistralai/mistralai/funcs/betaObservabilityDatasetsListTasks.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 betaObservabilityDatasetsListTasks(mistral, {
datasetId: "29903443-7f9c-42a6-9b6b-fc5cbef4191a",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityDatasetsListTasks failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetDatasetImportTasksV1ObservabilityDatasetsDatasetIdTasksGetRequest | ✔️ | 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.ListDatasetImportTasksResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |