Skip to content

Latest commit

 

History

History
1213 lines (908 loc) · 100 KB

File metadata and controls

1213 lines (908 loc) · 100 KB

Beta.Observability.Datasets

Overview

Available Operations

create

Create a new empty dataset

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.Dataset>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

list

List existing datasets

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.ListDatasetsResponse>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

fetch

Get dataset by id

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DatasetPreview>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

delete

Delete a dataset

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<void>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

update

Patch dataset

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DatasetPreview>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

listRecords

List existing records in the dataset

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.ListDatasetRecordsResponse>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

createRecord

Add a conversation to the dataset

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DatasetRecord>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

importFromCampaign

Populate the dataset with a campaign

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DatasetImportTask>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

importFromExplorer

Populate the dataset with samples from the explorer

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DatasetImportTask>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

importFromFile

Populate the dataset with samples from an uploaded file

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DatasetImportTask>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

importFromPlayground

Populate the dataset with samples from the playground

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DatasetImportTask>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

importFromDatasetRecords

Populate the dataset with samples from another dataset

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DatasetImportTask>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

exportToJsonl

Export to the Files API and retrieve presigned URL to download the resulting JSONL file

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.ExportDatasetResponse>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

fetchTask

Get status of a dataset import task

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DatasetImportTask>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

listTasks

List import tasks for the given dataset

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.ListDatasetImportTasksResponse>

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*