Beta.Observability.ChatCompletionEvents
search - Get Chat Completion Events
search_ids - Alternative to /search that returns only the IDs and that can return many IDs at once
fetch - Get Chat Completion Event
fetch_similar_events - Get Similar Chat Completion Events
judge - Run Judge on an event based on the given options
Get Chat Completion Events
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .chat_completion_events .search (search_params = {
"filters" : None ,
}, page_size = 50 )
# Handle response
print (res )
Parameter
Type
Required
Description
search_params
models.FilterPayload
✔️
N/A
page_size
Optional[int]
➖
N/A
cursor
OptionalNullable[str]
➖
N/A
extra_fields
List[str ]
➖
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.SearchChatCompletionEventsResponse
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Alternative to /search that returns only the IDs and that can return many IDs at once
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .chat_completion_events .search_ids (search_params = {
"filters" : {
"field" : "<value>" ,
"op" : "lt" ,
"value" : "<value>" ,
},
})
# Handle response
print (res )
models.SearchChatCompletionEventIdsResponse
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Get Chat Completion Event
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .chat_completion_events .fetch (event_id = "e79bf81b-b37f-425e-9dff-071a54592e44" )
# Handle response
print (res )
Parameter
Type
Required
Description
event_id
str
✔️
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.ChatCompletionEvent
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Get Similar Chat Completion Events
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .chat_completion_events .fetch_similar_events (event_id = "b7be6e08-d068-45fc-b77a-966232e92fd6" )
# Handle response
print (res )
Parameter
Type
Required
Description
event_id
str
✔️
N/A
retries
Optional[utils.RetryConfig]
➖
Configuration to override the default retry behavior of the client.
models.SearchChatCompletionEventsResponse
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*
Run Judge on an event based on the given options
from mistralai .client import Mistral
import os
with Mistral (
api_key = os .getenv ("MISTRAL_API_KEY" , "" ),
) as mistral :
res = mistral .beta .observability .chat_completion_events .judge (event_id = "dfcd5582-1373-4de5-af51-987464da561c" , judge_definition = {
"name" : "<value>" ,
"description" : "total plain self-confidence candid hungrily partial astride cruelly brr" ,
"model_name" : "<value>" ,
"output" : {
"type" : "CLASSIFICATION" ,
"options" : [
{
"value" : "<value>" ,
"description" : "indeed insolence delightfully following" ,
},
],
},
"instructions" : "<value>" ,
"tools" : [],
})
# Handle response
print (res )
models.JudgeOutput
Error Type
Status Code
Content Type
errors.ObservabilityError
400, 404, 408, 409, 422
application/json
errors.SDKError
4XX, 5XX
*/*