Create a new empty dataset
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.create(name="<value>", description="citizen whoever sustenance necessary vibrant openly")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
name | str | :heavy_check_mark: | N/A |
description | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.Dataset
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
List existing datasets
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.list(page_size=50, page=1)
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
page_size | Optional[int] | :heavy_minus_sign: | N/A |
page | Optional[int] | :heavy_minus_sign: | N/A |
q | OptionalNullable[str] | :heavy_minus_sign: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.ListDatasetsResponse
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get dataset by id
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.fetch(dataset_id="036fa362-e080-4fa5-beff-a334a70efb58")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.DatasetPreview
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete a dataset
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
mistral.beta.observability.datasets.delete(dataset_id="baf961a3-bb8e-4085-89ef-de9c5d8c4e77")
# Use the SDK ...
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Patch dataset
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.update(dataset_id="95be9afc-fc05-44a6-af9f-2362de1224f9")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
name | OptionalNullable[str] | :heavy_minus_sign: | N/A |
description | OptionalNullable[str] | :heavy_minus_sign: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.list_records(dataset_id="444d2a88-e636-4bc0-ab6c-919bedaed112", page_size=50, page=1)
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
page_size | Optional[int] | :heavy_minus_sign: | N/A |
page | Optional[int] | :heavy_minus_sign: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral, models
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.create_record(dataset_id="4c54ed13-1459-44e1-8696-1a6df06f7177", payload=models.ConversationPayload(
messages=[
{
"key": "<value>",
},
{
"key": "<value>",
"key1": "<value>",
},
],
), properties={
"key": "<value>",
"key1": "<value>",
"key2": "<value>",
})
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
payload | models.ConversationPayload | :heavy_check_mark: | N/A |
properties | Dict[str, Any] | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.import_from_campaign(dataset_id="306b5f31-e31c-4e06-9220-e3008c61bf1b", campaign_id="71a2e42d-7414-4fe6-89cb-44a2122b6f6b")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
campaign_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.import_from_explorer(dataset_id="ee1930e9-54f7-4c68-aa8a-40fe5d2a3485", completion_event_ids=[
"<value 1>",
"<value 2>",
"<value 3>",
])
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
completion_event_ids | List[str] | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.import_from_file(dataset_id="1c96c925-cc58-4529-863d-9fe66a6f1924", file_id="<id>")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
file_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.import_from_playground(dataset_id="5cb42584-5fcf-4837-997a-6a67c5e6900d", conversation_ids=[])
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
conversation_ids | List[str] | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.import_from_dataset_records(dataset_id="ada96a08-d724-4e5c-9111-aaf1bdb7d588", dataset_record_ids=[
"58fe798a-537b-4c61-9efc-d1d96d5d264a",
"cfa1d197-deda-456e-906b-dd84dccfcd17",
])
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
dataset_record_ids | List[str] | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.export_to_jsonl(dataset_id="d521add6-d909-4a69-a460-cb880d87b773")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.fetch_task(dataset_id="b64b504e-58a2-4d52-979b-e2634b301235", task_id="1713cde2-dea1-410d-851e-8cea964ffa14")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
task_id | str | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.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
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.datasets.list_tasks(dataset_id="29903443-7f9c-42a6-9b6b-fc5cbef4191a", page_size=50, page=1)
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
dataset_id | str | :heavy_check_mark: | N/A |
page_size | Optional[int] | :heavy_minus_sign: | N/A |
page | Optional[int] | :heavy_minus_sign: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.ListDatasetImportTasksResponse
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |