- create - Create and start a new campaign
- list - Get all campaigns
- fetch - Get campaign by id
- delete - Delete a campaign
- fetch_status - Get campaign status by campaign id
- list_events - Get event ids that were selected by the given campaign
Create and start a new campaign
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.campaigns.create(search_params={
"filters": {
"field": "<value>",
"op": "lt",
"value": "<value>",
},
}, judge_id="9b501b9f-3525-44a7-a51a-5352679be9ed", name="<value>", description="shakily triangular scotch requirement whether once oh", max_nb_events=232889)
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
search_params | models.FilterPayload | :heavy_check_mark: | N/A |
judge_id | str | :heavy_check_mark: | N/A |
name | str | :heavy_check_mark: | N/A |
description | str | :heavy_check_mark: | N/A |
max_nb_events | int | :heavy_check_mark: | N/A |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
models.Campaign
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get all campaigns
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.campaigns.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.ListCampaignsResponse
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get campaign by id
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.campaigns.fetch(campaign_id="fd7945d6-00e2-4852-9054-bcbb968d7f98")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
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.Campaign
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Delete a campaign
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
mistral.beta.observability.campaigns.delete(campaign_id="90e07b45-8cf7-4081-8558-a786779e039d")
# Use the SDK ...
| Parameter | Type | Required | Description |
|---|
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. |
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get campaign status by campaign id
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.campaigns.fetch_status(campaign_id="4b1dd9a5-8dc9-48e1-bd11-29443e959902")
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
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.FetchCampaignStatusResponse
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get event ids that were selected by the given campaign
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.beta.observability.campaigns.list_events(campaign_id="305b5e46-a650-4d8a-8b5b-d23ef90ec831", page_size=50, page=1)
# Handle response
print(res)
| Parameter | Type | Required | Description |
|---|
campaign_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.ListCampaignSelectedEventsResponse
| Error Type | Status Code | Content Type |
|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |