# Beta.Observability.Spans ## Overview ### Available Operations * [search_spans](#search_spans) - Search spans * [aggregate](#aggregate) - Aggregate spans * [aggregate_span_evaluations](#aggregate_span_evaluations) - Aggregate span evaluations * [search_span_evaluations](#search_span_evaluations) - Search span evaluations * [search_latest_span_evaluations](#search_latest_span_evaluations) - Search latest span evaluations * [search_pipeline_results](#search_pipeline_results) - Search pipeline results * [list_span_fields](#list_span_fields) - Get span field definitions * [list_span_eval_fields](#list_span_eval_fields) - Get span evaluation field definitions * [fetch_span_field_options](#fetch_span_field_options) - Get options for a span field * [fetch_span_eval_field_options](#fetch_span_eval_field_options) - Get options for a span evaluation field ## search_spans Search spans ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.search_spans(page_size=50) # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `from_` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `to` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | | `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `search_expression` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.GetSpans](../../models/getspans.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## aggregate Aggregate spans ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.aggregate(metric={ "measure": "", "aggregation": "p99", }, limit=1000) # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | | `metric` | [models.MetricDefinition](../../models/metricdefinition.md) | :heavy_check_mark: | N/A | | `from_` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `to` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `dimensions` | List[*str*] | :heavy_minus_sign: | N/A | | `time_dimension` | [OptionalNullable[models.TimeDimension]](../../models/timedimension.md) | :heavy_minus_sign: | N/A | | `search_expression` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `order_by` | List[[models.OrderByClause](../../models/orderbyclause.md)] | :heavy_minus_sign: | N/A | | `limit` | *Optional[int]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.Aggregation](../../models/aggregation.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## aggregate_span_evaluations Aggregate span evaluations ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.aggregate_span_evaluations(metric={ "measure": "", "aggregation": "max", }, limit=1000) # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | | `metric` | [models.MetricDefinition](../../models/metricdefinition.md) | :heavy_check_mark: | N/A | | `from_` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `to` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `dimensions` | List[*str*] | :heavy_minus_sign: | N/A | | `time_dimension` | [OptionalNullable[models.TimeDimension]](../../models/timedimension.md) | :heavy_minus_sign: | N/A | | `search_expression` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `order_by` | List[[models.OrderByClause](../../models/orderbyclause.md)] | :heavy_minus_sign: | N/A | | `limit` | *Optional[int]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.Aggregation](../../models/aggregation.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## search_span_evaluations Search span evaluations ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.search_span_evaluations(page_size=50) # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `from_` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `to` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | | `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `search_expression` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.GetSpanEvaluations](../../models/getspanevaluations.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## search_latest_span_evaluations Search latest span evaluations ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.search_latest_span_evaluations(page_size=50) # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `from_` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `to` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | | `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `search_expression` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.GetSpanEvaluations](../../models/getspanevaluations.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## search_pipeline_results Search pipeline results ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.search_pipeline_results(pipeline_config_slugs=[ "", ], page_size=50) # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `pipeline_config_slugs` | List[*str*] | :heavy_check_mark: | N/A | | `from_` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `to` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | | `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `search_expression` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.GetPipelineResults](../../models/getpipelineresults.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## list_span_fields Get span field definitions ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.list_span_fields() # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.GetSpanFields](../../models/getspanfields.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## list_span_eval_fields Get span evaluation field definitions ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.list_span_eval_fields() # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.GetSpanEvaluationFields](../../models/getspanevaluationfields.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## fetch_span_field_options Get options for a span field ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.fetch_span_field_options(field_name="") # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `field_name` | *str* | :heavy_check_mark: | N/A | | `from_` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `to` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.GetSpanFieldOptions](../../models/getspanfieldoptions.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## fetch_span_eval_field_options Get options for a span evaluation field ### Example Usage ```python from mistralai.client import Mistral import os with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: res = mistral.beta.observability.spans.fetch_span_eval_field_options(field_name="") # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `field_name` | *str* | :heavy_check_mark: | N/A | | `from_` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `to` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[models.GetSpanEvaluationFieldOptions](../../models/getspanevaluationfieldoptions.md)** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* |