Beta.Observability.Judges
Create a new judge
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .judges .create (name = "<value>" , description = "border freely down whenever broadly whenever restructure catalyze after" , model_name = "<value>" , output = {
"type" : "REGRESSION" ,
"min" : 0 ,
"min_description" : "<value>" ,
"max" : 1 ,
"max_description" : "<value>" ,
}, instructions = "<value>" , tools = [
"<value 1>" ,
"<value 2>" ,
])
# Handle response
print (res )
Parameter
Type
Required
Description
name
str
✔️
N/A
description
str
✔️
N/A
model_name
str
✔️
N/A
output
models.CreateJudgeRequestOutput
✔️
N/A
instructions
str
✔️
N/A
tools
List[str ]
✔️
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.Judge
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Get judges with optional filtering and search
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .judges .list (page_size = 50 , page = 1 )
# Handle response
print (res )
Parameter
Type
Required
Description
type_filter
List[models.JudgeOutputType ]
➖
Filter by judge output types
model_filter
List[str ]
➖
Filter by model names
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.ListJudgesResponse
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Get judge by id
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .judges .fetch (judge_id = "19ae5cf8-2ade-4a40-b9d2-730aaebe8429" )
# Handle response
print (res )
Parameter
Type
Required
Description
judge_id
str
✔️
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.Judge
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Delete a judge
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
mistral .beta .observability .judges .delete (judge_id = "80deecde-e10f-409c-a13a-c242d3760f6e" )
# Use the SDK ...
Parameter
Type
Required
Description
judge_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
*/*
Update a judge
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
mistral .beta .observability .judges .update (judge_id = "9f28c7db-1fb7-4e1c-b137-d7039561ddb7" , name = "<value>" , description = "noteworthy and unless" , model_name = "<value>" , output = {
"type" : "REGRESSION" ,
"min" : 0 ,
"min_description" : "<value>" ,
"max" : 1 ,
"max_description" : "<value>" ,
}, instructions = "<value>" , tools = [])
# Use the SDK ...
Parameter
Type
Required
Description
judge_id
str
✔️
N/A
name
str
✔️
N/A
description
str
✔️
N/A
model_name
str
✔️
N/A
output
models.UpdateJudgeRequestOutput
✔️
N/A
instructions
str
✔️
N/A
tools
List[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
*/*
Run a saved judge on a conversation
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .judges .judge_conversation (judge_id = "7fb9f06a-22fb-45db-ad58-6a5715280755" , messages = [])
# Handle response
print (res )
Parameter
Type
Required
Description
judge_id
str
✔️
N/A
messages
List[Dict[str, Any ]]
✔️
N/A
properties
Dict[str, Any ]
➖
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.JudgeOutput
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*