Beta.Observability.Evaluations
Create a worker pipeline configuration
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .create_pipeline_config (name = "<value>" , pipeline_kind = "judge" , selectors = [], definition = {
"slug" : "<value>" ,
}, enabled = True )
# Handle response
print (res )
models.PipelineConfig
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
List worker pipeline configurations
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .list_pipeline_configs (page_size = 50 , page = 1 )
# Handle response
print (res )
Parameter
Type
Required
Description
pipeline_kind
OptionalNullable[models.PipelineKind]
➖
N/A
enabled
OptionalNullable[bool]
➖
N/A
page_size
Optional[int]
➖
N/A
page
Optional[int]
➖
N/A
q
OptionalNullable[str]
➖
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.PipelineConfigsResponse
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Get a worker pipeline configuration
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .get_pipeline_config (pipeline_config_id = "939fdf7d-2edf-45ca-bb75-a47326da1799" )
# Handle response
print (res )
Parameter
Type
Required
Description
pipeline_config_id
str
✔️
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.PipelineConfig
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Replace a worker pipeline configuration
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .update_pipeline_config (pipeline_config_id = "4ee75abd-cccd-4232-9858-0c535465bfd5" , name = "<value>" , pipeline_kind = "detection" , selectors = [], definition = {
"target_attributes" : [
"<value 1>" ,
],
"patterns" : [
{
"name" : "<value>" ,
"regex" : "<value>" ,
"category" : "<value>" ,
"confidence" : "<value>" ,
},
],
}, enabled = True )
# Handle response
print (res )
models.PipelineConfig
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Delete a worker pipeline configuration
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
mistral .beta .observability .evaluations .delete_pipeline_config (pipeline_config_id = "816cdd49-f7b2-4941-a73d-af3c25958c4d" )
# Use the SDK ...
Parameter
Type
Required
Description
pipeline_config_id
str
✔️
N/A
retries
Optional[utils.RetryConfig]
➖
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
*/*
Create a pipeline
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .create_pipeline (name = "<value>" , selectors = [], definitions = [
{
"slug" : "<value>" ,
},
], enabled = True )
# Handle response
print (res )
models.Pipeline
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
List pipelines
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .list_pipelines (page_size = 50 , page = 1 )
# Handle response
print (res )
Parameter
Type
Required
Description
enabled
OptionalNullable[bool]
➖
N/A
page_size
Optional[int]
➖
N/A
page
Optional[int]
➖
N/A
q
OptionalNullable[str]
➖
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.PipelinesResponse
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Get a pipeline
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .get_pipeline (pipeline_id = "aafed470-377a-4e11-85ec-e5de5b40c79f" )
# Handle response
print (res )
Parameter
Type
Required
Description
pipeline_id
str
✔️
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.Pipeline
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Update a pipeline
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .update_pipeline (pipeline_id = "2c18966b-8d2d-41fb-a02c-9a9bf9df2919" )
# Handle response
print (res )
models.Pipeline
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Delete a pipeline
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
mistral .beta .observability .evaluations .delete_pipeline (pipeline_id = "eb888b07-60a4-490b-9515-f6b32ee11ccf" )
# Use the SDK ...
Parameter
Type
Required
Description
pipeline_id
str
✔️
N/A
retries
Optional[utils.RetryConfig]
➖
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
*/*
List evaluations for a project
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .list (project_slug = "<value>" , page_size = 50 , page = 1 )
# Handle response
print (res )
Parameter
Type
Required
Description
project_slug
str
✔️
N/A
page_size
Optional[int]
➖
N/A
page
Optional[int]
➖
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.EvaluationsV2
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Get evaluation by slug
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .evaluations .get (evaluation_slug = "<value>" )
# Handle response
print (res )
Parameter
Type
Required
Description
evaluation_slug
str
✔️
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.EvaluationV2
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*