Skip to content

Latest commit

 

History

History
235 lines (157 loc) · 19.1 KB

README.md

File metadata and controls

235 lines (157 loc) · 19.1 KB

Beta.Observability.Evaluations.Runs

Overview

Available Operations

  • search - Search evaluation runs with filters
  • search_all - Search evaluation runs across all evaluations
  • get - Get a specific evaluation run by ID
  • get_statistics - Get statistics for a specific evaluation run
  • compute_statistics - Compute statistics for a specific evaluation run with optional filters

search

Search evaluation runs with filters

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY"),
) as mistral:

    res = mistral.beta.observability.evaluations.runs.search(evaluation_slug="<value>", page_size=50, page=1)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
evaluation_slug str ✔️ N/A
page_size Optional[int] ➖ N/A
page Optional[int] ➖ N/A
run_ids List[str] ➖ N/A
evaluation_ids List[str] ➖ N/A
creator_ids List[str] ➖ N/A
project_ids List[str] ➖ N/A
ownership OptionalNullable[models.RunOwnershipFilter] ➖ N/A
tags OptionalNullable[models.TagFilter] ➖ N/A
score_filters OptionalNullable[models.ScoreFilterGroup] ➖ N/A
goal_filters OptionalNullable[models.GoalStatusFilterGroup] ➖ N/A
system OptionalNullable[models.SystemFilter] ➖ N/A
metadata OptionalNullable[models.MetadataFilterGroup] ➖ N/A
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.ListEvaluationRunsResponse

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

search_all

Search evaluation runs across all evaluations

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY"),
) as mistral:

    res = mistral.beta.observability.evaluations.runs.search_all(page_size=50, page=1)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
page_size Optional[int] ➖ N/A
page Optional[int] ➖ N/A
evaluation_run_filter_input OptionalNullable[models.EvaluationRunFilterInput] ➖ N/A
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.SearchAllEvaluationRunsResponse

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

get

Get a specific evaluation run by ID

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY"),
) as mistral:

    res = mistral.beta.observability.evaluations.runs.get(run_id="c120b634-146a-4ae3-bd38-b7a168c4c8ce")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
run_id str ✔️ N/A
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.EvaluationRunV2Response

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

get_statistics

Get statistics for a specific evaluation run

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY"),
) as mistral:

    res = mistral.beta.observability.evaluations.runs.get_statistics(run_id="a38473a2-532a-4cb8-9320-a7f617d16595")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
run_id str ✔️ N/A
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.RunStatisticsResponse

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*

compute_statistics

Compute statistics for a specific evaluation run with optional filters

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY"),
) as mistral:

    res = mistral.beta.observability.evaluations.runs.compute_statistics(run_id="c5e1142f-de29-45b2-b29c-fe37e6509c8a")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
run_id str ✔️ N/A
input_filters OptionalNullable[models.ContentSearchFilterGroup] ➖ N/A
output_filters OptionalNullable[models.ContentSearchFilterGroup] ➖ N/A
score_filters OptionalNullable[models.ScoreFilterGroup] ➖ N/A
goal_filters OptionalNullable[models.GoalStatusFilterGroup] ➖ N/A
sort OptionalNullable[models.Sort] ➖ N/A
retries Optional[utils.RetryConfig] ➖ Configuration to override the default retry behavior of the client.

Response

models.RunStatisticsResponse

Errors

Error Type Status Code Content Type
errors.ObservabilityError 400, 404, 408, 409, 422 application/json
errors.SDKError 4XX, 5XX */*