# coding: utf-8

"""
    Arthur GenAI Engine

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 2.1.294
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from datetime import datetime
from pydantic import Field, StrictInt, StrictStr
from typing import List, Optional, Union
from typing_extensions import Annotated
from _generated.models.agentic_annotation_type import AgenticAnnotationType
from _generated.models.continuous_eval_run_status import ContinuousEvalRunStatus
from _generated.models.pagination_sort_method import PaginationSortMethod
from _generated.models.query_spans_response import QuerySpansResponse
from _generated.models.query_traces_with_metrics_response import QueryTracesWithMetricsResponse
from _generated.models.span_list_response import SpanListResponse
from _generated.models.span_with_metrics_response import SpanWithMetricsResponse
from _generated.models.tool_class_enum import ToolClassEnum
from _generated.models.unregistered_root_spans_response import UnregisteredRootSpansResponse

from _generated.api_client import ApiClient, RequestSerialized
from _generated.api_response import ApiResponse
from _generated.rest import RESTResponseType


class SpansApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    def compute_span_metrics_api_v1_traces_spans_span_id_metrics_get(
        self,
        span_id: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> SpanWithMetricsResponse:
        """Compute Missing Span Metrics

        Compute all missing metrics for a single span on-demand. Returns span with computed metrics.

        :param span_id: (required)
        :type span_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._compute_span_metrics_api_v1_traces_spans_span_id_metrics_get_serialize(
            span_id=span_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def compute_span_metrics_api_v1_traces_spans_span_id_metrics_get_with_http_info(
        self,
        span_id: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[SpanWithMetricsResponse]:
        """Compute Missing Span Metrics

        Compute all missing metrics for a single span on-demand. Returns span with computed metrics.

        :param span_id: (required)
        :type span_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._compute_span_metrics_api_v1_traces_spans_span_id_metrics_get_serialize(
            span_id=span_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def compute_span_metrics_api_v1_traces_spans_span_id_metrics_get_without_preload_content(
        self,
        span_id: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Compute Missing Span Metrics

        Compute all missing metrics for a single span on-demand. Returns span with computed metrics.

        :param span_id: (required)
        :type span_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._compute_span_metrics_api_v1_traces_spans_span_id_metrics_get_serialize(
            span_id=span_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _compute_span_metrics_api_v1_traces_spans_span_id_metrics_get_serialize(
        self,
        span_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if span_id is not None:
            _path_params['span_id'] = span_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/traces/spans/{span_id}/metrics',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def compute_span_metrics_v1_span_span_id_metrics_get(
        self,
        span_id: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> SpanWithMetricsResponse:
        """(Deprecated) Compute Metrics for Span

        Compute metrics for a single span. Validates that the span is an LLM span.

        :param span_id: (required)
        :type span_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/span/{span_id}/metrics is deprecated.", DeprecationWarning)

        _param = self._compute_span_metrics_v1_span_span_id_metrics_get_serialize(
            span_id=span_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def compute_span_metrics_v1_span_span_id_metrics_get_with_http_info(
        self,
        span_id: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[SpanWithMetricsResponse]:
        """(Deprecated) Compute Metrics for Span

        Compute metrics for a single span. Validates that the span is an LLM span.

        :param span_id: (required)
        :type span_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/span/{span_id}/metrics is deprecated.", DeprecationWarning)

        _param = self._compute_span_metrics_v1_span_span_id_metrics_get_serialize(
            span_id=span_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def compute_span_metrics_v1_span_span_id_metrics_get_without_preload_content(
        self,
        span_id: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """(Deprecated) Compute Metrics for Span

        Compute metrics for a single span. Validates that the span is an LLM span.

        :param span_id: (required)
        :type span_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/span/{span_id}/metrics is deprecated.", DeprecationWarning)

        _param = self._compute_span_metrics_v1_span_span_id_metrics_get_serialize(
            span_id=span_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _compute_span_metrics_v1_span_span_id_metrics_get_serialize(
        self,
        span_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if span_id is not None:
            _path_params['span_id'] = span_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/span/{span_id}/metrics',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_span_by_id_api_v1_traces_spans_span_id_get(
        self,
        span_id: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> SpanWithMetricsResponse:
        """Get Single Span

        Get single span with existing metrics (no computation). Returns full span object with any existing metrics.

        :param span_id: (required)
        :type span_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_span_by_id_api_v1_traces_spans_span_id_get_serialize(
            span_id=span_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_span_by_id_api_v1_traces_spans_span_id_get_with_http_info(
        self,
        span_id: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[SpanWithMetricsResponse]:
        """Get Single Span

        Get single span with existing metrics (no computation). Returns full span object with any existing metrics.

        :param span_id: (required)
        :type span_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_span_by_id_api_v1_traces_spans_span_id_get_serialize(
            span_id=span_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_span_by_id_api_v1_traces_spans_span_id_get_without_preload_content(
        self,
        span_id: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Single Span

        Get single span with existing metrics (no computation). Returns full span object with any existing metrics.

        :param span_id: (required)
        :type span_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_span_by_id_api_v1_traces_spans_span_id_get_serialize(
            span_id=span_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_span_by_id_api_v1_traces_spans_span_id_get_serialize(
        self,
        span_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if span_id is not None:
            _path_params['span_id'] = span_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/traces/spans/{span_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_unregistered_root_spans_api_v1_traces_spans_unregistered_get(
        self,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Inclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> UnregisteredRootSpansResponse:
        """Get Unregistered Root Spans

        Get grouped root spans for traces without task_id. Groups are ordered by count descending. Supports pagination. Time bounds (start_time/end_time) are recommended for performance on large datasets.

        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Inclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_unregistered_root_spans_api_v1_traces_spans_unregistered_get_serialize(
            start_time=start_time,
            end_time=end_time,
            sort=sort,
            page_size=page_size,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UnregisteredRootSpansResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_unregistered_root_spans_api_v1_traces_spans_unregistered_get_with_http_info(
        self,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Inclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[UnregisteredRootSpansResponse]:
        """Get Unregistered Root Spans

        Get grouped root spans for traces without task_id. Groups are ordered by count descending. Supports pagination. Time bounds (start_time/end_time) are recommended for performance on large datasets.

        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Inclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_unregistered_root_spans_api_v1_traces_spans_unregistered_get_serialize(
            start_time=start_time,
            end_time=end_time,
            sort=sort,
            page_size=page_size,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UnregisteredRootSpansResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_unregistered_root_spans_api_v1_traces_spans_unregistered_get_without_preload_content(
        self,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Inclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Unregistered Root Spans

        Get grouped root spans for traces without task_id. Groups are ordered by count descending. Supports pagination. Time bounds (start_time/end_time) are recommended for performance on large datasets.

        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Inclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_unregistered_root_spans_api_v1_traces_spans_unregistered_get_serialize(
            start_time=start_time,
            end_time=end_time,
            sort=sort,
            page_size=page_size,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "UnregisteredRootSpansResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_unregistered_root_spans_api_v1_traces_spans_unregistered_get_serialize(
        self,
        start_time,
        end_time,
        sort,
        page_size,
        page,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if start_time is not None:
            if isinstance(start_time, datetime):
                _query_params.append(
                    (
                        'start_time',
                        start_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('start_time', start_time))
            
        if end_time is not None:
            if isinstance(end_time, datetime):
                _query_params.append(
                    (
                        'end_time',
                        end_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('end_time', end_time))
            
        if sort is not None:
            
            _query_params.append(('sort', sort.value))
            
        if page_size is not None:
            
            _query_params.append(('page_size', page_size))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/traces/spans/unregistered',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def list_spans_metadata_api_v1_traces_spans_get(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        trace_ids: Annotated[Optional[List[StrictStr]], Field(description="Trace IDs to filter on. Optional.")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        tool_name: Annotated[Optional[StrictStr], Field(description="Return only results with this tool name.")] = None,
        span_types: Annotated[Optional[List[StrictStr]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        annotation_score: Annotated[Optional[Annotated[int, Field(le=1, strict=True, ge=0)]], Field(description="Filter by trace annotation score (0 or 1).")] = None,
        annotation_type: Annotated[Optional[AgenticAnnotationType], Field(description="Filter by trace annotation type (i.e. 'human' or 'continuous_eval').")] = None,
        continuous_eval_run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).")] = None,
        continuous_eval_name: Annotated[Optional[StrictStr], Field(description="Filter by continuous eval name.")] = None,
        span_ids: Annotated[Optional[List[StrictStr]], Field(description="Span IDs to filter on. Optional.")] = None,
        session_ids: Annotated[Optional[List[StrictStr]], Field(description="Session IDs to filter on. Optional.")] = None,
        user_ids: Annotated[Optional[List[StrictStr]], Field(description="User IDs to filter on. Optional.")] = None,
        span_name: Annotated[Optional[StrictStr], Field(description="Return only results with this span name.")] = None,
        span_name_contains: Annotated[Optional[StrictStr], Field(description="Return only results where span name contains this substring.")] = None,
        status_code: Annotated[Optional[List[StrictStr]], Field(description="Status codes to filter on. Optional. Valid values: Ok, Error, Unset.")] = None,
        query_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        query_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        query_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        query_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        query_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        response_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        response_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        response_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        response_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        response_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        tool_selection: Annotated[Optional[ToolClassEnum], Field(description="Tool selection evaluation result.")] = None,
        tool_usage: Annotated[Optional[ToolClassEnum], Field(description="Tool usage evaluation result.")] = None,
        trace_duration_eq: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration exactly equal to this value (seconds).")] = None,
        trace_duration_gt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than this value (seconds).")] = None,
        trace_duration_gte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than or equal to this value (seconds).")] = None,
        trace_duration_lt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than this value (seconds).")] = None,
        trace_duration_lte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than or equal to this value (seconds).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> SpanListResponse:
        """List Span Metadata with Filtering

        Get lightweight span metadata with comprehensive filtering support. Returns individual spans that match filtering criteria with the same filtering capabilities as trace filtering. Supports trace-level filters, span-level filters, and metric filters.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param trace_ids: Trace IDs to filter on. Optional.
        :type trace_ids: List[str]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param tool_name: Return only results with this tool name.
        :type tool_name: str
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[str]
        :param annotation_score: Filter by trace annotation score (0 or 1).
        :type annotation_score: int
        :param annotation_type: Filter by trace annotation type (i.e. 'human' or 'continuous_eval').
        :type annotation_type: AgenticAnnotationType
        :param continuous_eval_run_status: Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).
        :type continuous_eval_run_status: ContinuousEvalRunStatus
        :param continuous_eval_name: Filter by continuous eval name.
        :type continuous_eval_name: str
        :param span_ids: Span IDs to filter on. Optional.
        :type span_ids: List[str]
        :param session_ids: Session IDs to filter on. Optional.
        :type session_ids: List[str]
        :param user_ids: User IDs to filter on. Optional.
        :type user_ids: List[str]
        :param span_name: Return only results with this span name.
        :type span_name: str
        :param span_name_contains: Return only results where span name contains this substring.
        :type span_name_contains: str
        :param status_code: Status codes to filter on. Optional. Valid values: Ok, Error, Unset.
        :type status_code: List[str]
        :param query_relevance_eq: Equal to this value.
        :type query_relevance_eq: float
        :param query_relevance_gt: Greater than this value.
        :type query_relevance_gt: float
        :param query_relevance_gte: Greater than or equal to this value.
        :type query_relevance_gte: float
        :param query_relevance_lt: Less than this value.
        :type query_relevance_lt: float
        :param query_relevance_lte: Less than or equal to this value.
        :type query_relevance_lte: float
        :param response_relevance_eq: Equal to this value.
        :type response_relevance_eq: float
        :param response_relevance_gt: Greater than this value.
        :type response_relevance_gt: float
        :param response_relevance_gte: Greater than or equal to this value.
        :type response_relevance_gte: float
        :param response_relevance_lt: Less than this value.
        :type response_relevance_lt: float
        :param response_relevance_lte: Less than or equal to this value.
        :type response_relevance_lte: float
        :param tool_selection: Tool selection evaluation result.
        :type tool_selection: ToolClassEnum
        :param tool_usage: Tool usage evaluation result.
        :type tool_usage: ToolClassEnum
        :param trace_duration_eq: Duration exactly equal to this value (seconds).
        :type trace_duration_eq: float
        :param trace_duration_gt: Duration greater than this value (seconds).
        :type trace_duration_gt: float
        :param trace_duration_gte: Duration greater than or equal to this value (seconds).
        :type trace_duration_gte: float
        :param trace_duration_lt: Duration less than this value (seconds).
        :type trace_duration_lt: float
        :param trace_duration_lte: Duration less than or equal to this value (seconds).
        :type trace_duration_lte: float
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_spans_metadata_api_v1_traces_spans_get_serialize(
            task_ids=task_ids,
            sort=sort,
            page_size=page_size,
            page=page,
            trace_ids=trace_ids,
            start_time=start_time,
            end_time=end_time,
            tool_name=tool_name,
            span_types=span_types,
            annotation_score=annotation_score,
            annotation_type=annotation_type,
            continuous_eval_run_status=continuous_eval_run_status,
            continuous_eval_name=continuous_eval_name,
            span_ids=span_ids,
            session_ids=session_ids,
            user_ids=user_ids,
            span_name=span_name,
            span_name_contains=span_name_contains,
            status_code=status_code,
            query_relevance_eq=query_relevance_eq,
            query_relevance_gt=query_relevance_gt,
            query_relevance_gte=query_relevance_gte,
            query_relevance_lt=query_relevance_lt,
            query_relevance_lte=query_relevance_lte,
            response_relevance_eq=response_relevance_eq,
            response_relevance_gt=response_relevance_gt,
            response_relevance_gte=response_relevance_gte,
            response_relevance_lt=response_relevance_lt,
            response_relevance_lte=response_relevance_lte,
            tool_selection=tool_selection,
            tool_usage=tool_usage,
            trace_duration_eq=trace_duration_eq,
            trace_duration_gt=trace_duration_gt,
            trace_duration_gte=trace_duration_gte,
            trace_duration_lt=trace_duration_lt,
            trace_duration_lte=trace_duration_lte,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanListResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def list_spans_metadata_api_v1_traces_spans_get_with_http_info(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        trace_ids: Annotated[Optional[List[StrictStr]], Field(description="Trace IDs to filter on. Optional.")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        tool_name: Annotated[Optional[StrictStr], Field(description="Return only results with this tool name.")] = None,
        span_types: Annotated[Optional[List[StrictStr]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        annotation_score: Annotated[Optional[Annotated[int, Field(le=1, strict=True, ge=0)]], Field(description="Filter by trace annotation score (0 or 1).")] = None,
        annotation_type: Annotated[Optional[AgenticAnnotationType], Field(description="Filter by trace annotation type (i.e. 'human' or 'continuous_eval').")] = None,
        continuous_eval_run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).")] = None,
        continuous_eval_name: Annotated[Optional[StrictStr], Field(description="Filter by continuous eval name.")] = None,
        span_ids: Annotated[Optional[List[StrictStr]], Field(description="Span IDs to filter on. Optional.")] = None,
        session_ids: Annotated[Optional[List[StrictStr]], Field(description="Session IDs to filter on. Optional.")] = None,
        user_ids: Annotated[Optional[List[StrictStr]], Field(description="User IDs to filter on. Optional.")] = None,
        span_name: Annotated[Optional[StrictStr], Field(description="Return only results with this span name.")] = None,
        span_name_contains: Annotated[Optional[StrictStr], Field(description="Return only results where span name contains this substring.")] = None,
        status_code: Annotated[Optional[List[StrictStr]], Field(description="Status codes to filter on. Optional. Valid values: Ok, Error, Unset.")] = None,
        query_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        query_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        query_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        query_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        query_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        response_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        response_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        response_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        response_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        response_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        tool_selection: Annotated[Optional[ToolClassEnum], Field(description="Tool selection evaluation result.")] = None,
        tool_usage: Annotated[Optional[ToolClassEnum], Field(description="Tool usage evaluation result.")] = None,
        trace_duration_eq: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration exactly equal to this value (seconds).")] = None,
        trace_duration_gt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than this value (seconds).")] = None,
        trace_duration_gte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than or equal to this value (seconds).")] = None,
        trace_duration_lt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than this value (seconds).")] = None,
        trace_duration_lte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than or equal to this value (seconds).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[SpanListResponse]:
        """List Span Metadata with Filtering

        Get lightweight span metadata with comprehensive filtering support. Returns individual spans that match filtering criteria with the same filtering capabilities as trace filtering. Supports trace-level filters, span-level filters, and metric filters.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param trace_ids: Trace IDs to filter on. Optional.
        :type trace_ids: List[str]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param tool_name: Return only results with this tool name.
        :type tool_name: str
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[str]
        :param annotation_score: Filter by trace annotation score (0 or 1).
        :type annotation_score: int
        :param annotation_type: Filter by trace annotation type (i.e. 'human' or 'continuous_eval').
        :type annotation_type: AgenticAnnotationType
        :param continuous_eval_run_status: Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).
        :type continuous_eval_run_status: ContinuousEvalRunStatus
        :param continuous_eval_name: Filter by continuous eval name.
        :type continuous_eval_name: str
        :param span_ids: Span IDs to filter on. Optional.
        :type span_ids: List[str]
        :param session_ids: Session IDs to filter on. Optional.
        :type session_ids: List[str]
        :param user_ids: User IDs to filter on. Optional.
        :type user_ids: List[str]
        :param span_name: Return only results with this span name.
        :type span_name: str
        :param span_name_contains: Return only results where span name contains this substring.
        :type span_name_contains: str
        :param status_code: Status codes to filter on. Optional. Valid values: Ok, Error, Unset.
        :type status_code: List[str]
        :param query_relevance_eq: Equal to this value.
        :type query_relevance_eq: float
        :param query_relevance_gt: Greater than this value.
        :type query_relevance_gt: float
        :param query_relevance_gte: Greater than or equal to this value.
        :type query_relevance_gte: float
        :param query_relevance_lt: Less than this value.
        :type query_relevance_lt: float
        :param query_relevance_lte: Less than or equal to this value.
        :type query_relevance_lte: float
        :param response_relevance_eq: Equal to this value.
        :type response_relevance_eq: float
        :param response_relevance_gt: Greater than this value.
        :type response_relevance_gt: float
        :param response_relevance_gte: Greater than or equal to this value.
        :type response_relevance_gte: float
        :param response_relevance_lt: Less than this value.
        :type response_relevance_lt: float
        :param response_relevance_lte: Less than or equal to this value.
        :type response_relevance_lte: float
        :param tool_selection: Tool selection evaluation result.
        :type tool_selection: ToolClassEnum
        :param tool_usage: Tool usage evaluation result.
        :type tool_usage: ToolClassEnum
        :param trace_duration_eq: Duration exactly equal to this value (seconds).
        :type trace_duration_eq: float
        :param trace_duration_gt: Duration greater than this value (seconds).
        :type trace_duration_gt: float
        :param trace_duration_gte: Duration greater than or equal to this value (seconds).
        :type trace_duration_gte: float
        :param trace_duration_lt: Duration less than this value (seconds).
        :type trace_duration_lt: float
        :param trace_duration_lte: Duration less than or equal to this value (seconds).
        :type trace_duration_lte: float
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_spans_metadata_api_v1_traces_spans_get_serialize(
            task_ids=task_ids,
            sort=sort,
            page_size=page_size,
            page=page,
            trace_ids=trace_ids,
            start_time=start_time,
            end_time=end_time,
            tool_name=tool_name,
            span_types=span_types,
            annotation_score=annotation_score,
            annotation_type=annotation_type,
            continuous_eval_run_status=continuous_eval_run_status,
            continuous_eval_name=continuous_eval_name,
            span_ids=span_ids,
            session_ids=session_ids,
            user_ids=user_ids,
            span_name=span_name,
            span_name_contains=span_name_contains,
            status_code=status_code,
            query_relevance_eq=query_relevance_eq,
            query_relevance_gt=query_relevance_gt,
            query_relevance_gte=query_relevance_gte,
            query_relevance_lt=query_relevance_lt,
            query_relevance_lte=query_relevance_lte,
            response_relevance_eq=response_relevance_eq,
            response_relevance_gt=response_relevance_gt,
            response_relevance_gte=response_relevance_gte,
            response_relevance_lt=response_relevance_lt,
            response_relevance_lte=response_relevance_lte,
            tool_selection=tool_selection,
            tool_usage=tool_usage,
            trace_duration_eq=trace_duration_eq,
            trace_duration_gt=trace_duration_gt,
            trace_duration_gte=trace_duration_gte,
            trace_duration_lt=trace_duration_lt,
            trace_duration_lte=trace_duration_lte,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanListResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def list_spans_metadata_api_v1_traces_spans_get_without_preload_content(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        trace_ids: Annotated[Optional[List[StrictStr]], Field(description="Trace IDs to filter on. Optional.")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        tool_name: Annotated[Optional[StrictStr], Field(description="Return only results with this tool name.")] = None,
        span_types: Annotated[Optional[List[StrictStr]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        annotation_score: Annotated[Optional[Annotated[int, Field(le=1, strict=True, ge=0)]], Field(description="Filter by trace annotation score (0 or 1).")] = None,
        annotation_type: Annotated[Optional[AgenticAnnotationType], Field(description="Filter by trace annotation type (i.e. 'human' or 'continuous_eval').")] = None,
        continuous_eval_run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).")] = None,
        continuous_eval_name: Annotated[Optional[StrictStr], Field(description="Filter by continuous eval name.")] = None,
        span_ids: Annotated[Optional[List[StrictStr]], Field(description="Span IDs to filter on. Optional.")] = None,
        session_ids: Annotated[Optional[List[StrictStr]], Field(description="Session IDs to filter on. Optional.")] = None,
        user_ids: Annotated[Optional[List[StrictStr]], Field(description="User IDs to filter on. Optional.")] = None,
        span_name: Annotated[Optional[StrictStr], Field(description="Return only results with this span name.")] = None,
        span_name_contains: Annotated[Optional[StrictStr], Field(description="Return only results where span name contains this substring.")] = None,
        status_code: Annotated[Optional[List[StrictStr]], Field(description="Status codes to filter on. Optional. Valid values: Ok, Error, Unset.")] = None,
        query_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        query_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        query_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        query_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        query_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        response_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        response_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        response_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        response_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        response_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        tool_selection: Annotated[Optional[ToolClassEnum], Field(description="Tool selection evaluation result.")] = None,
        tool_usage: Annotated[Optional[ToolClassEnum], Field(description="Tool usage evaluation result.")] = None,
        trace_duration_eq: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration exactly equal to this value (seconds).")] = None,
        trace_duration_gt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than this value (seconds).")] = None,
        trace_duration_gte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than or equal to this value (seconds).")] = None,
        trace_duration_lt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than this value (seconds).")] = None,
        trace_duration_lte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than or equal to this value (seconds).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List Span Metadata with Filtering

        Get lightweight span metadata with comprehensive filtering support. Returns individual spans that match filtering criteria with the same filtering capabilities as trace filtering. Supports trace-level filters, span-level filters, and metric filters.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param trace_ids: Trace IDs to filter on. Optional.
        :type trace_ids: List[str]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param tool_name: Return only results with this tool name.
        :type tool_name: str
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[str]
        :param annotation_score: Filter by trace annotation score (0 or 1).
        :type annotation_score: int
        :param annotation_type: Filter by trace annotation type (i.e. 'human' or 'continuous_eval').
        :type annotation_type: AgenticAnnotationType
        :param continuous_eval_run_status: Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).
        :type continuous_eval_run_status: ContinuousEvalRunStatus
        :param continuous_eval_name: Filter by continuous eval name.
        :type continuous_eval_name: str
        :param span_ids: Span IDs to filter on. Optional.
        :type span_ids: List[str]
        :param session_ids: Session IDs to filter on. Optional.
        :type session_ids: List[str]
        :param user_ids: User IDs to filter on. Optional.
        :type user_ids: List[str]
        :param span_name: Return only results with this span name.
        :type span_name: str
        :param span_name_contains: Return only results where span name contains this substring.
        :type span_name_contains: str
        :param status_code: Status codes to filter on. Optional. Valid values: Ok, Error, Unset.
        :type status_code: List[str]
        :param query_relevance_eq: Equal to this value.
        :type query_relevance_eq: float
        :param query_relevance_gt: Greater than this value.
        :type query_relevance_gt: float
        :param query_relevance_gte: Greater than or equal to this value.
        :type query_relevance_gte: float
        :param query_relevance_lt: Less than this value.
        :type query_relevance_lt: float
        :param query_relevance_lte: Less than or equal to this value.
        :type query_relevance_lte: float
        :param response_relevance_eq: Equal to this value.
        :type response_relevance_eq: float
        :param response_relevance_gt: Greater than this value.
        :type response_relevance_gt: float
        :param response_relevance_gte: Greater than or equal to this value.
        :type response_relevance_gte: float
        :param response_relevance_lt: Less than this value.
        :type response_relevance_lt: float
        :param response_relevance_lte: Less than or equal to this value.
        :type response_relevance_lte: float
        :param tool_selection: Tool selection evaluation result.
        :type tool_selection: ToolClassEnum
        :param tool_usage: Tool usage evaluation result.
        :type tool_usage: ToolClassEnum
        :param trace_duration_eq: Duration exactly equal to this value (seconds).
        :type trace_duration_eq: float
        :param trace_duration_gt: Duration greater than this value (seconds).
        :type trace_duration_gt: float
        :param trace_duration_gte: Duration greater than or equal to this value (seconds).
        :type trace_duration_gte: float
        :param trace_duration_lt: Duration less than this value (seconds).
        :type trace_duration_lt: float
        :param trace_duration_lte: Duration less than or equal to this value (seconds).
        :type trace_duration_lte: float
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._list_spans_metadata_api_v1_traces_spans_get_serialize(
            task_ids=task_ids,
            sort=sort,
            page_size=page_size,
            page=page,
            trace_ids=trace_ids,
            start_time=start_time,
            end_time=end_time,
            tool_name=tool_name,
            span_types=span_types,
            annotation_score=annotation_score,
            annotation_type=annotation_type,
            continuous_eval_run_status=continuous_eval_run_status,
            continuous_eval_name=continuous_eval_name,
            span_ids=span_ids,
            session_ids=session_ids,
            user_ids=user_ids,
            span_name=span_name,
            span_name_contains=span_name_contains,
            status_code=status_code,
            query_relevance_eq=query_relevance_eq,
            query_relevance_gt=query_relevance_gt,
            query_relevance_gte=query_relevance_gte,
            query_relevance_lt=query_relevance_lt,
            query_relevance_lte=query_relevance_lte,
            response_relevance_eq=response_relevance_eq,
            response_relevance_gt=response_relevance_gt,
            response_relevance_gte=response_relevance_gte,
            response_relevance_lt=response_relevance_lt,
            response_relevance_lte=response_relevance_lte,
            tool_selection=tool_selection,
            tool_usage=tool_usage,
            trace_duration_eq=trace_duration_eq,
            trace_duration_gt=trace_duration_gt,
            trace_duration_gte=trace_duration_gte,
            trace_duration_lt=trace_duration_lt,
            trace_duration_lte=trace_duration_lte,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "SpanListResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _list_spans_metadata_api_v1_traces_spans_get_serialize(
        self,
        task_ids,
        sort,
        page_size,
        page,
        trace_ids,
        start_time,
        end_time,
        tool_name,
        span_types,
        annotation_score,
        annotation_type,
        continuous_eval_run_status,
        continuous_eval_name,
        span_ids,
        session_ids,
        user_ids,
        span_name,
        span_name_contains,
        status_code,
        query_relevance_eq,
        query_relevance_gt,
        query_relevance_gte,
        query_relevance_lt,
        query_relevance_lte,
        response_relevance_eq,
        response_relevance_gt,
        response_relevance_gte,
        response_relevance_lt,
        response_relevance_lte,
        tool_selection,
        tool_usage,
        trace_duration_eq,
        trace_duration_gt,
        trace_duration_gte,
        trace_duration_lt,
        trace_duration_lte,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'task_ids': 'multi',
            'trace_ids': 'multi',
            'span_types': 'multi',
            'span_ids': 'multi',
            'session_ids': 'multi',
            'user_ids': 'multi',
            'status_code': 'multi',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if sort is not None:
            
            _query_params.append(('sort', sort.value))
            
        if page_size is not None:
            
            _query_params.append(('page_size', page_size))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        if task_ids is not None:
            
            _query_params.append(('task_ids', task_ids))
            
        if trace_ids is not None:
            
            _query_params.append(('trace_ids', trace_ids))
            
        if start_time is not None:
            if isinstance(start_time, datetime):
                _query_params.append(
                    (
                        'start_time',
                        start_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('start_time', start_time))
            
        if end_time is not None:
            if isinstance(end_time, datetime):
                _query_params.append(
                    (
                        'end_time',
                        end_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('end_time', end_time))
            
        if tool_name is not None:
            
            _query_params.append(('tool_name', tool_name))
            
        if span_types is not None:
            
            _query_params.append(('span_types', span_types))
            
        if annotation_score is not None:
            
            _query_params.append(('annotation_score', annotation_score))
            
        if annotation_type is not None:
            
            _query_params.append(('annotation_type', annotation_type.value))
            
        if continuous_eval_run_status is not None:
            
            _query_params.append(('continuous_eval_run_status', continuous_eval_run_status.value))
            
        if continuous_eval_name is not None:
            
            _query_params.append(('continuous_eval_name', continuous_eval_name))
            
        if span_ids is not None:
            
            _query_params.append(('span_ids', span_ids))
            
        if session_ids is not None:
            
            _query_params.append(('session_ids', session_ids))
            
        if user_ids is not None:
            
            _query_params.append(('user_ids', user_ids))
            
        if span_name is not None:
            
            _query_params.append(('span_name', span_name))
            
        if span_name_contains is not None:
            
            _query_params.append(('span_name_contains', span_name_contains))
            
        if status_code is not None:
            
            _query_params.append(('status_code', status_code))
            
        if query_relevance_eq is not None:
            
            _query_params.append(('query_relevance_eq', query_relevance_eq))
            
        if query_relevance_gt is not None:
            
            _query_params.append(('query_relevance_gt', query_relevance_gt))
            
        if query_relevance_gte is not None:
            
            _query_params.append(('query_relevance_gte', query_relevance_gte))
            
        if query_relevance_lt is not None:
            
            _query_params.append(('query_relevance_lt', query_relevance_lt))
            
        if query_relevance_lte is not None:
            
            _query_params.append(('query_relevance_lte', query_relevance_lte))
            
        if response_relevance_eq is not None:
            
            _query_params.append(('response_relevance_eq', response_relevance_eq))
            
        if response_relevance_gt is not None:
            
            _query_params.append(('response_relevance_gt', response_relevance_gt))
            
        if response_relevance_gte is not None:
            
            _query_params.append(('response_relevance_gte', response_relevance_gte))
            
        if response_relevance_lt is not None:
            
            _query_params.append(('response_relevance_lt', response_relevance_lt))
            
        if response_relevance_lte is not None:
            
            _query_params.append(('response_relevance_lte', response_relevance_lte))
            
        if tool_selection is not None:
            
            _query_params.append(('tool_selection', tool_selection.value))
            
        if tool_usage is not None:
            
            _query_params.append(('tool_usage', tool_usage.value))
            
        if trace_duration_eq is not None:
            
            _query_params.append(('trace_duration_eq', trace_duration_eq))
            
        if trace_duration_gt is not None:
            
            _query_params.append(('trace_duration_gt', trace_duration_gt))
            
        if trace_duration_gte is not None:
            
            _query_params.append(('trace_duration_gte', trace_duration_gte))
            
        if trace_duration_lt is not None:
            
            _query_params.append(('trace_duration_lt', trace_duration_lt))
            
        if trace_duration_lte is not None:
            
            _query_params.append(('trace_duration_lte', trace_duration_lte))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/traces/spans',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def query_spans_by_type_v1_spans_query_get(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        span_types: Annotated[Optional[List[StrictStr]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> QuerySpansResponse:
        """(Deprecated) Query Spans By Type

        Query spans filtered by span type. Task IDs are required. Returns spans with any existing metrics but does not compute new ones.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[str]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/spans/query is deprecated.", DeprecationWarning)

        _param = self._query_spans_by_type_v1_spans_query_get_serialize(
            task_ids=task_ids,
            span_types=span_types,
            start_time=start_time,
            end_time=end_time,
            sort=sort,
            page_size=page_size,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QuerySpansResponse",
            '400': None,
            '404': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def query_spans_by_type_v1_spans_query_get_with_http_info(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        span_types: Annotated[Optional[List[StrictStr]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[QuerySpansResponse]:
        """(Deprecated) Query Spans By Type

        Query spans filtered by span type. Task IDs are required. Returns spans with any existing metrics but does not compute new ones.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[str]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/spans/query is deprecated.", DeprecationWarning)

        _param = self._query_spans_by_type_v1_spans_query_get_serialize(
            task_ids=task_ids,
            span_types=span_types,
            start_time=start_time,
            end_time=end_time,
            sort=sort,
            page_size=page_size,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QuerySpansResponse",
            '400': None,
            '404': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def query_spans_by_type_v1_spans_query_get_without_preload_content(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        span_types: Annotated[Optional[List[StrictStr]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """(Deprecated) Query Spans By Type

        Query spans filtered by span type. Task IDs are required. Returns spans with any existing metrics but does not compute new ones.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[str]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/spans/query is deprecated.", DeprecationWarning)

        _param = self._query_spans_by_type_v1_spans_query_get_serialize(
            task_ids=task_ids,
            span_types=span_types,
            start_time=start_time,
            end_time=end_time,
            sort=sort,
            page_size=page_size,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QuerySpansResponse",
            '400': None,
            '404': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _query_spans_by_type_v1_spans_query_get_serialize(
        self,
        task_ids,
        span_types,
        start_time,
        end_time,
        sort,
        page_size,
        page,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'task_ids': 'multi',
            'span_types': 'multi',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if task_ids is not None:
            
            _query_params.append(('task_ids', task_ids))
            
        if span_types is not None:
            
            _query_params.append(('span_types', span_types))
            
        if start_time is not None:
            if isinstance(start_time, datetime):
                _query_params.append(
                    (
                        'start_time',
                        start_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('start_time', start_time))
            
        if end_time is not None:
            if isinstance(end_time, datetime):
                _query_params.append(
                    (
                        'end_time',
                        end_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('end_time', end_time))
            
        if sort is not None:
            
            _query_params.append(('sort', sort.value))
            
        if page_size is not None:
            
            _query_params.append(('page_size', page_size))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/spans/query',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def query_spans_v1_traces_query_get(
        self,
        task_ids: Annotated[List[Optional[StrictStr]], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        trace_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Trace IDs to filter on. Optional.")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        tool_name: Annotated[Optional[StrictStr], Field(description="Return only results with this tool name.")] = None,
        span_types: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        annotation_score: Annotated[Optional[Annotated[int, Field(le=1, strict=True, ge=0)]], Field(description="Filter by trace annotation score (0 or 1).")] = None,
        annotation_type: Annotated[Optional[AgenticAnnotationType], Field(description="Filter by trace annotation type (i.e. 'human' or 'continuous_eval').")] = None,
        continuous_eval_run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).")] = None,
        continuous_eval_name: Annotated[Optional[StrictStr], Field(description="Filter by continuous eval name.")] = None,
        span_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Span IDs to filter on. Optional.")] = None,
        session_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Session IDs to filter on. Optional.")] = None,
        user_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="User IDs to filter on. Optional.")] = None,
        span_name: Annotated[Optional[StrictStr], Field(description="Return only results with this span name.")] = None,
        span_name_contains: Annotated[Optional[StrictStr], Field(description="Return only results where span name contains this substring.")] = None,
        status_code: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Status codes to filter on. Optional. Valid values: Ok, Error, Unset.")] = None,
        query_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        query_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        query_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        query_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        query_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        response_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        response_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        response_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        response_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        response_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        tool_selection: Annotated[Optional[ToolClassEnum], Field(description="Tool selection evaluation result.")] = None,
        tool_usage: Annotated[Optional[ToolClassEnum], Field(description="Tool usage evaluation result.")] = None,
        trace_duration_eq: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration exactly equal to this value (seconds).")] = None,
        trace_duration_gt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than this value (seconds).")] = None,
        trace_duration_gte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than or equal to this value (seconds).")] = None,
        trace_duration_lt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than this value (seconds).")] = None,
        trace_duration_lte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than or equal to this value (seconds).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> QueryTracesWithMetricsResponse:
        """(Deprecated) Query Traces

        Query traces with comprehensive filtering. Returns traces containing spans that match the filters, not just the spans themselves.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[Optional[str]]
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param trace_ids: Trace IDs to filter on. Optional.
        :type trace_ids: List[Optional[str]]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param tool_name: Return only results with this tool name.
        :type tool_name: str
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[Optional[str]]
        :param annotation_score: Filter by trace annotation score (0 or 1).
        :type annotation_score: int
        :param annotation_type: Filter by trace annotation type (i.e. 'human' or 'continuous_eval').
        :type annotation_type: AgenticAnnotationType
        :param continuous_eval_run_status: Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).
        :type continuous_eval_run_status: ContinuousEvalRunStatus
        :param continuous_eval_name: Filter by continuous eval name.
        :type continuous_eval_name: str
        :param span_ids: Span IDs to filter on. Optional.
        :type span_ids: List[Optional[str]]
        :param session_ids: Session IDs to filter on. Optional.
        :type session_ids: List[Optional[str]]
        :param user_ids: User IDs to filter on. Optional.
        :type user_ids: List[Optional[str]]
        :param span_name: Return only results with this span name.
        :type span_name: str
        :param span_name_contains: Return only results where span name contains this substring.
        :type span_name_contains: str
        :param status_code: Status codes to filter on. Optional. Valid values: Ok, Error, Unset.
        :type status_code: List[Optional[str]]
        :param query_relevance_eq: Equal to this value.
        :type query_relevance_eq: float
        :param query_relevance_gt: Greater than this value.
        :type query_relevance_gt: float
        :param query_relevance_gte: Greater than or equal to this value.
        :type query_relevance_gte: float
        :param query_relevance_lt: Less than this value.
        :type query_relevance_lt: float
        :param query_relevance_lte: Less than or equal to this value.
        :type query_relevance_lte: float
        :param response_relevance_eq: Equal to this value.
        :type response_relevance_eq: float
        :param response_relevance_gt: Greater than this value.
        :type response_relevance_gt: float
        :param response_relevance_gte: Greater than or equal to this value.
        :type response_relevance_gte: float
        :param response_relevance_lt: Less than this value.
        :type response_relevance_lt: float
        :param response_relevance_lte: Less than or equal to this value.
        :type response_relevance_lte: float
        :param tool_selection: Tool selection evaluation result.
        :type tool_selection: ToolClassEnum
        :param tool_usage: Tool usage evaluation result.
        :type tool_usage: ToolClassEnum
        :param trace_duration_eq: Duration exactly equal to this value (seconds).
        :type trace_duration_eq: float
        :param trace_duration_gt: Duration greater than this value (seconds).
        :type trace_duration_gt: float
        :param trace_duration_gte: Duration greater than or equal to this value (seconds).
        :type trace_duration_gte: float
        :param trace_duration_lt: Duration less than this value (seconds).
        :type trace_duration_lt: float
        :param trace_duration_lte: Duration less than or equal to this value (seconds).
        :type trace_duration_lte: float
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/traces/query is deprecated.", DeprecationWarning)

        _param = self._query_spans_v1_traces_query_get_serialize(
            task_ids=task_ids,
            sort=sort,
            page_size=page_size,
            page=page,
            trace_ids=trace_ids,
            start_time=start_time,
            end_time=end_time,
            tool_name=tool_name,
            span_types=span_types,
            annotation_score=annotation_score,
            annotation_type=annotation_type,
            continuous_eval_run_status=continuous_eval_run_status,
            continuous_eval_name=continuous_eval_name,
            span_ids=span_ids,
            session_ids=session_ids,
            user_ids=user_ids,
            span_name=span_name,
            span_name_contains=span_name_contains,
            status_code=status_code,
            query_relevance_eq=query_relevance_eq,
            query_relevance_gt=query_relevance_gt,
            query_relevance_gte=query_relevance_gte,
            query_relevance_lt=query_relevance_lt,
            query_relevance_lte=query_relevance_lte,
            response_relevance_eq=response_relevance_eq,
            response_relevance_gt=response_relevance_gt,
            response_relevance_gte=response_relevance_gte,
            response_relevance_lt=response_relevance_lt,
            response_relevance_lte=response_relevance_lte,
            tool_selection=tool_selection,
            tool_usage=tool_usage,
            trace_duration_eq=trace_duration_eq,
            trace_duration_gt=trace_duration_gt,
            trace_duration_gte=trace_duration_gte,
            trace_duration_lt=trace_duration_lt,
            trace_duration_lte=trace_duration_lte,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QueryTracesWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def query_spans_v1_traces_query_get_with_http_info(
        self,
        task_ids: Annotated[List[Optional[StrictStr]], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        trace_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Trace IDs to filter on. Optional.")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        tool_name: Annotated[Optional[StrictStr], Field(description="Return only results with this tool name.")] = None,
        span_types: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        annotation_score: Annotated[Optional[Annotated[int, Field(le=1, strict=True, ge=0)]], Field(description="Filter by trace annotation score (0 or 1).")] = None,
        annotation_type: Annotated[Optional[AgenticAnnotationType], Field(description="Filter by trace annotation type (i.e. 'human' or 'continuous_eval').")] = None,
        continuous_eval_run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).")] = None,
        continuous_eval_name: Annotated[Optional[StrictStr], Field(description="Filter by continuous eval name.")] = None,
        span_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Span IDs to filter on. Optional.")] = None,
        session_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Session IDs to filter on. Optional.")] = None,
        user_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="User IDs to filter on. Optional.")] = None,
        span_name: Annotated[Optional[StrictStr], Field(description="Return only results with this span name.")] = None,
        span_name_contains: Annotated[Optional[StrictStr], Field(description="Return only results where span name contains this substring.")] = None,
        status_code: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Status codes to filter on. Optional. Valid values: Ok, Error, Unset.")] = None,
        query_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        query_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        query_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        query_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        query_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        response_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        response_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        response_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        response_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        response_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        tool_selection: Annotated[Optional[ToolClassEnum], Field(description="Tool selection evaluation result.")] = None,
        tool_usage: Annotated[Optional[ToolClassEnum], Field(description="Tool usage evaluation result.")] = None,
        trace_duration_eq: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration exactly equal to this value (seconds).")] = None,
        trace_duration_gt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than this value (seconds).")] = None,
        trace_duration_gte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than or equal to this value (seconds).")] = None,
        trace_duration_lt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than this value (seconds).")] = None,
        trace_duration_lte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than or equal to this value (seconds).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[QueryTracesWithMetricsResponse]:
        """(Deprecated) Query Traces

        Query traces with comprehensive filtering. Returns traces containing spans that match the filters, not just the spans themselves.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[Optional[str]]
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param trace_ids: Trace IDs to filter on. Optional.
        :type trace_ids: List[Optional[str]]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param tool_name: Return only results with this tool name.
        :type tool_name: str
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[Optional[str]]
        :param annotation_score: Filter by trace annotation score (0 or 1).
        :type annotation_score: int
        :param annotation_type: Filter by trace annotation type (i.e. 'human' or 'continuous_eval').
        :type annotation_type: AgenticAnnotationType
        :param continuous_eval_run_status: Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).
        :type continuous_eval_run_status: ContinuousEvalRunStatus
        :param continuous_eval_name: Filter by continuous eval name.
        :type continuous_eval_name: str
        :param span_ids: Span IDs to filter on. Optional.
        :type span_ids: List[Optional[str]]
        :param session_ids: Session IDs to filter on. Optional.
        :type session_ids: List[Optional[str]]
        :param user_ids: User IDs to filter on. Optional.
        :type user_ids: List[Optional[str]]
        :param span_name: Return only results with this span name.
        :type span_name: str
        :param span_name_contains: Return only results where span name contains this substring.
        :type span_name_contains: str
        :param status_code: Status codes to filter on. Optional. Valid values: Ok, Error, Unset.
        :type status_code: List[Optional[str]]
        :param query_relevance_eq: Equal to this value.
        :type query_relevance_eq: float
        :param query_relevance_gt: Greater than this value.
        :type query_relevance_gt: float
        :param query_relevance_gte: Greater than or equal to this value.
        :type query_relevance_gte: float
        :param query_relevance_lt: Less than this value.
        :type query_relevance_lt: float
        :param query_relevance_lte: Less than or equal to this value.
        :type query_relevance_lte: float
        :param response_relevance_eq: Equal to this value.
        :type response_relevance_eq: float
        :param response_relevance_gt: Greater than this value.
        :type response_relevance_gt: float
        :param response_relevance_gte: Greater than or equal to this value.
        :type response_relevance_gte: float
        :param response_relevance_lt: Less than this value.
        :type response_relevance_lt: float
        :param response_relevance_lte: Less than or equal to this value.
        :type response_relevance_lte: float
        :param tool_selection: Tool selection evaluation result.
        :type tool_selection: ToolClassEnum
        :param tool_usage: Tool usage evaluation result.
        :type tool_usage: ToolClassEnum
        :param trace_duration_eq: Duration exactly equal to this value (seconds).
        :type trace_duration_eq: float
        :param trace_duration_gt: Duration greater than this value (seconds).
        :type trace_duration_gt: float
        :param trace_duration_gte: Duration greater than or equal to this value (seconds).
        :type trace_duration_gte: float
        :param trace_duration_lt: Duration less than this value (seconds).
        :type trace_duration_lt: float
        :param trace_duration_lte: Duration less than or equal to this value (seconds).
        :type trace_duration_lte: float
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/traces/query is deprecated.", DeprecationWarning)

        _param = self._query_spans_v1_traces_query_get_serialize(
            task_ids=task_ids,
            sort=sort,
            page_size=page_size,
            page=page,
            trace_ids=trace_ids,
            start_time=start_time,
            end_time=end_time,
            tool_name=tool_name,
            span_types=span_types,
            annotation_score=annotation_score,
            annotation_type=annotation_type,
            continuous_eval_run_status=continuous_eval_run_status,
            continuous_eval_name=continuous_eval_name,
            span_ids=span_ids,
            session_ids=session_ids,
            user_ids=user_ids,
            span_name=span_name,
            span_name_contains=span_name_contains,
            status_code=status_code,
            query_relevance_eq=query_relevance_eq,
            query_relevance_gt=query_relevance_gt,
            query_relevance_gte=query_relevance_gte,
            query_relevance_lt=query_relevance_lt,
            query_relevance_lte=query_relevance_lte,
            response_relevance_eq=response_relevance_eq,
            response_relevance_gt=response_relevance_gt,
            response_relevance_gte=response_relevance_gte,
            response_relevance_lt=response_relevance_lt,
            response_relevance_lte=response_relevance_lte,
            tool_selection=tool_selection,
            tool_usage=tool_usage,
            trace_duration_eq=trace_duration_eq,
            trace_duration_gt=trace_duration_gt,
            trace_duration_gte=trace_duration_gte,
            trace_duration_lt=trace_duration_lt,
            trace_duration_lte=trace_duration_lte,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QueryTracesWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def query_spans_v1_traces_query_get_without_preload_content(
        self,
        task_ids: Annotated[List[Optional[StrictStr]], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        trace_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Trace IDs to filter on. Optional.")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        tool_name: Annotated[Optional[StrictStr], Field(description="Return only results with this tool name.")] = None,
        span_types: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        annotation_score: Annotated[Optional[Annotated[int, Field(le=1, strict=True, ge=0)]], Field(description="Filter by trace annotation score (0 or 1).")] = None,
        annotation_type: Annotated[Optional[AgenticAnnotationType], Field(description="Filter by trace annotation type (i.e. 'human' or 'continuous_eval').")] = None,
        continuous_eval_run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).")] = None,
        continuous_eval_name: Annotated[Optional[StrictStr], Field(description="Filter by continuous eval name.")] = None,
        span_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Span IDs to filter on. Optional.")] = None,
        session_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Session IDs to filter on. Optional.")] = None,
        user_ids: Annotated[Optional[List[Optional[StrictStr]]], Field(description="User IDs to filter on. Optional.")] = None,
        span_name: Annotated[Optional[StrictStr], Field(description="Return only results with this span name.")] = None,
        span_name_contains: Annotated[Optional[StrictStr], Field(description="Return only results where span name contains this substring.")] = None,
        status_code: Annotated[Optional[List[Optional[StrictStr]]], Field(description="Status codes to filter on. Optional. Valid values: Ok, Error, Unset.")] = None,
        query_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        query_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        query_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        query_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        query_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        response_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        response_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        response_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        response_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        response_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        tool_selection: Annotated[Optional[ToolClassEnum], Field(description="Tool selection evaluation result.")] = None,
        tool_usage: Annotated[Optional[ToolClassEnum], Field(description="Tool usage evaluation result.")] = None,
        trace_duration_eq: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration exactly equal to this value (seconds).")] = None,
        trace_duration_gt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than this value (seconds).")] = None,
        trace_duration_gte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than or equal to this value (seconds).")] = None,
        trace_duration_lt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than this value (seconds).")] = None,
        trace_duration_lte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than or equal to this value (seconds).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """(Deprecated) Query Traces

        Query traces with comprehensive filtering. Returns traces containing spans that match the filters, not just the spans themselves.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[Optional[str]]
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param trace_ids: Trace IDs to filter on. Optional.
        :type trace_ids: List[Optional[str]]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param tool_name: Return only results with this tool name.
        :type tool_name: str
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[Optional[str]]
        :param annotation_score: Filter by trace annotation score (0 or 1).
        :type annotation_score: int
        :param annotation_type: Filter by trace annotation type (i.e. 'human' or 'continuous_eval').
        :type annotation_type: AgenticAnnotationType
        :param continuous_eval_run_status: Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).
        :type continuous_eval_run_status: ContinuousEvalRunStatus
        :param continuous_eval_name: Filter by continuous eval name.
        :type continuous_eval_name: str
        :param span_ids: Span IDs to filter on. Optional.
        :type span_ids: List[Optional[str]]
        :param session_ids: Session IDs to filter on. Optional.
        :type session_ids: List[Optional[str]]
        :param user_ids: User IDs to filter on. Optional.
        :type user_ids: List[Optional[str]]
        :param span_name: Return only results with this span name.
        :type span_name: str
        :param span_name_contains: Return only results where span name contains this substring.
        :type span_name_contains: str
        :param status_code: Status codes to filter on. Optional. Valid values: Ok, Error, Unset.
        :type status_code: List[Optional[str]]
        :param query_relevance_eq: Equal to this value.
        :type query_relevance_eq: float
        :param query_relevance_gt: Greater than this value.
        :type query_relevance_gt: float
        :param query_relevance_gte: Greater than or equal to this value.
        :type query_relevance_gte: float
        :param query_relevance_lt: Less than this value.
        :type query_relevance_lt: float
        :param query_relevance_lte: Less than or equal to this value.
        :type query_relevance_lte: float
        :param response_relevance_eq: Equal to this value.
        :type response_relevance_eq: float
        :param response_relevance_gt: Greater than this value.
        :type response_relevance_gt: float
        :param response_relevance_gte: Greater than or equal to this value.
        :type response_relevance_gte: float
        :param response_relevance_lt: Less than this value.
        :type response_relevance_lt: float
        :param response_relevance_lte: Less than or equal to this value.
        :type response_relevance_lte: float
        :param tool_selection: Tool selection evaluation result.
        :type tool_selection: ToolClassEnum
        :param tool_usage: Tool usage evaluation result.
        :type tool_usage: ToolClassEnum
        :param trace_duration_eq: Duration exactly equal to this value (seconds).
        :type trace_duration_eq: float
        :param trace_duration_gt: Duration greater than this value (seconds).
        :type trace_duration_gt: float
        :param trace_duration_gte: Duration greater than or equal to this value (seconds).
        :type trace_duration_gte: float
        :param trace_duration_lt: Duration less than this value (seconds).
        :type trace_duration_lt: float
        :param trace_duration_lte: Duration less than or equal to this value (seconds).
        :type trace_duration_lte: float
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/traces/query is deprecated.", DeprecationWarning)

        _param = self._query_spans_v1_traces_query_get_serialize(
            task_ids=task_ids,
            sort=sort,
            page_size=page_size,
            page=page,
            trace_ids=trace_ids,
            start_time=start_time,
            end_time=end_time,
            tool_name=tool_name,
            span_types=span_types,
            annotation_score=annotation_score,
            annotation_type=annotation_type,
            continuous_eval_run_status=continuous_eval_run_status,
            continuous_eval_name=continuous_eval_name,
            span_ids=span_ids,
            session_ids=session_ids,
            user_ids=user_ids,
            span_name=span_name,
            span_name_contains=span_name_contains,
            status_code=status_code,
            query_relevance_eq=query_relevance_eq,
            query_relevance_gt=query_relevance_gt,
            query_relevance_gte=query_relevance_gte,
            query_relevance_lt=query_relevance_lt,
            query_relevance_lte=query_relevance_lte,
            response_relevance_eq=response_relevance_eq,
            response_relevance_gt=response_relevance_gt,
            response_relevance_gte=response_relevance_gte,
            response_relevance_lt=response_relevance_lt,
            response_relevance_lte=response_relevance_lte,
            tool_selection=tool_selection,
            tool_usage=tool_usage,
            trace_duration_eq=trace_duration_eq,
            trace_duration_gt=trace_duration_gt,
            trace_duration_gte=trace_duration_gte,
            trace_duration_lt=trace_duration_lt,
            trace_duration_lte=trace_duration_lte,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QueryTracesWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _query_spans_v1_traces_query_get_serialize(
        self,
        task_ids,
        sort,
        page_size,
        page,
        trace_ids,
        start_time,
        end_time,
        tool_name,
        span_types,
        annotation_score,
        annotation_type,
        continuous_eval_run_status,
        continuous_eval_name,
        span_ids,
        session_ids,
        user_ids,
        span_name,
        span_name_contains,
        status_code,
        query_relevance_eq,
        query_relevance_gt,
        query_relevance_gte,
        query_relevance_lt,
        query_relevance_lte,
        response_relevance_eq,
        response_relevance_gt,
        response_relevance_gte,
        response_relevance_lt,
        response_relevance_lte,
        tool_selection,
        tool_usage,
        trace_duration_eq,
        trace_duration_gt,
        trace_duration_gte,
        trace_duration_lt,
        trace_duration_lte,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'task_ids': 'multi',
            'trace_ids': 'multi',
            'span_types': 'multi',
            'span_ids': 'multi',
            'session_ids': 'multi',
            'user_ids': 'multi',
            'status_code': 'multi',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if sort is not None:
            
            _query_params.append(('sort', sort.value))
            
        if page_size is not None:
            
            _query_params.append(('page_size', page_size))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        if task_ids is not None:
            
            _query_params.append(('task_ids', task_ids))
            
        if trace_ids is not None:
            
            _query_params.append(('trace_ids', trace_ids))
            
        if start_time is not None:
            if isinstance(start_time, datetime):
                _query_params.append(
                    (
                        'start_time',
                        start_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('start_time', start_time))
            
        if end_time is not None:
            if isinstance(end_time, datetime):
                _query_params.append(
                    (
                        'end_time',
                        end_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('end_time', end_time))
            
        if tool_name is not None:
            
            _query_params.append(('tool_name', tool_name))
            
        if span_types is not None:
            
            _query_params.append(('span_types', span_types))
            
        if annotation_score is not None:
            
            _query_params.append(('annotation_score', annotation_score))
            
        if annotation_type is not None:
            
            _query_params.append(('annotation_type', annotation_type.value))
            
        if continuous_eval_run_status is not None:
            
            _query_params.append(('continuous_eval_run_status', continuous_eval_run_status.value))
            
        if continuous_eval_name is not None:
            
            _query_params.append(('continuous_eval_name', continuous_eval_name))
            
        if span_ids is not None:
            
            _query_params.append(('span_ids', span_ids))
            
        if session_ids is not None:
            
            _query_params.append(('session_ids', session_ids))
            
        if user_ids is not None:
            
            _query_params.append(('user_ids', user_ids))
            
        if span_name is not None:
            
            _query_params.append(('span_name', span_name))
            
        if span_name_contains is not None:
            
            _query_params.append(('span_name_contains', span_name_contains))
            
        if status_code is not None:
            
            _query_params.append(('status_code', status_code))
            
        if query_relevance_eq is not None:
            
            _query_params.append(('query_relevance_eq', query_relevance_eq))
            
        if query_relevance_gt is not None:
            
            _query_params.append(('query_relevance_gt', query_relevance_gt))
            
        if query_relevance_gte is not None:
            
            _query_params.append(('query_relevance_gte', query_relevance_gte))
            
        if query_relevance_lt is not None:
            
            _query_params.append(('query_relevance_lt', query_relevance_lt))
            
        if query_relevance_lte is not None:
            
            _query_params.append(('query_relevance_lte', query_relevance_lte))
            
        if response_relevance_eq is not None:
            
            _query_params.append(('response_relevance_eq', response_relevance_eq))
            
        if response_relevance_gt is not None:
            
            _query_params.append(('response_relevance_gt', response_relevance_gt))
            
        if response_relevance_gte is not None:
            
            _query_params.append(('response_relevance_gte', response_relevance_gte))
            
        if response_relevance_lt is not None:
            
            _query_params.append(('response_relevance_lt', response_relevance_lt))
            
        if response_relevance_lte is not None:
            
            _query_params.append(('response_relevance_lte', response_relevance_lte))
            
        if tool_selection is not None:
            
            _query_params.append(('tool_selection', tool_selection.value))
            
        if tool_usage is not None:
            
            _query_params.append(('tool_usage', tool_usage.value))
            
        if trace_duration_eq is not None:
            
            _query_params.append(('trace_duration_eq', trace_duration_eq))
            
        if trace_duration_gt is not None:
            
            _query_params.append(('trace_duration_gt', trace_duration_gt))
            
        if trace_duration_gte is not None:
            
            _query_params.append(('trace_duration_gte', trace_duration_gte))
            
        if trace_duration_lt is not None:
            
            _query_params.append(('trace_duration_lt', trace_duration_lt))
            
        if trace_duration_lte is not None:
            
            _query_params.append(('trace_duration_lte', trace_duration_lte))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/traces/query',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def query_spans_with_metrics_v1_traces_metrics_get(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        trace_ids: Annotated[Optional[List[StrictStr]], Field(description="Trace IDs to filter on. Optional.")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        tool_name: Annotated[Optional[StrictStr], Field(description="Return only results with this tool name.")] = None,
        span_types: Annotated[Optional[List[StrictStr]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        annotation_score: Annotated[Optional[Annotated[int, Field(le=1, strict=True, ge=0)]], Field(description="Filter by trace annotation score (0 or 1).")] = None,
        annotation_type: Annotated[Optional[AgenticAnnotationType], Field(description="Filter by trace annotation type (i.e. 'human' or 'continuous_eval').")] = None,
        continuous_eval_run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).")] = None,
        continuous_eval_name: Annotated[Optional[StrictStr], Field(description="Filter by continuous eval name.")] = None,
        span_ids: Annotated[Optional[List[StrictStr]], Field(description="Span IDs to filter on. Optional.")] = None,
        session_ids: Annotated[Optional[List[StrictStr]], Field(description="Session IDs to filter on. Optional.")] = None,
        user_ids: Annotated[Optional[List[StrictStr]], Field(description="User IDs to filter on. Optional.")] = None,
        span_name: Annotated[Optional[StrictStr], Field(description="Return only results with this span name.")] = None,
        span_name_contains: Annotated[Optional[StrictStr], Field(description="Return only results where span name contains this substring.")] = None,
        status_code: Annotated[Optional[List[StrictStr]], Field(description="Status codes to filter on. Optional. Valid values: Ok, Error, Unset.")] = None,
        query_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        query_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        query_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        query_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        query_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        response_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        response_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        response_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        response_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        response_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        tool_selection: Annotated[Optional[ToolClassEnum], Field(description="Tool selection evaluation result.")] = None,
        tool_usage: Annotated[Optional[ToolClassEnum], Field(description="Tool usage evaluation result.")] = None,
        trace_duration_eq: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration exactly equal to this value (seconds).")] = None,
        trace_duration_gt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than this value (seconds).")] = None,
        trace_duration_gte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than or equal to this value (seconds).")] = None,
        trace_duration_lt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than this value (seconds).")] = None,
        trace_duration_lte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than or equal to this value (seconds).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> QueryTracesWithMetricsResponse:
        """(Deprecated) Compute Missing Metrics and Query Traces

        Query traces with comprehensive filtering and compute metrics. Returns traces containing spans that match the filters with computed metrics.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param trace_ids: Trace IDs to filter on. Optional.
        :type trace_ids: List[str]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param tool_name: Return only results with this tool name.
        :type tool_name: str
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[str]
        :param annotation_score: Filter by trace annotation score (0 or 1).
        :type annotation_score: int
        :param annotation_type: Filter by trace annotation type (i.e. 'human' or 'continuous_eval').
        :type annotation_type: AgenticAnnotationType
        :param continuous_eval_run_status: Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).
        :type continuous_eval_run_status: ContinuousEvalRunStatus
        :param continuous_eval_name: Filter by continuous eval name.
        :type continuous_eval_name: str
        :param span_ids: Span IDs to filter on. Optional.
        :type span_ids: List[str]
        :param session_ids: Session IDs to filter on. Optional.
        :type session_ids: List[str]
        :param user_ids: User IDs to filter on. Optional.
        :type user_ids: List[str]
        :param span_name: Return only results with this span name.
        :type span_name: str
        :param span_name_contains: Return only results where span name contains this substring.
        :type span_name_contains: str
        :param status_code: Status codes to filter on. Optional. Valid values: Ok, Error, Unset.
        :type status_code: List[str]
        :param query_relevance_eq: Equal to this value.
        :type query_relevance_eq: float
        :param query_relevance_gt: Greater than this value.
        :type query_relevance_gt: float
        :param query_relevance_gte: Greater than or equal to this value.
        :type query_relevance_gte: float
        :param query_relevance_lt: Less than this value.
        :type query_relevance_lt: float
        :param query_relevance_lte: Less than or equal to this value.
        :type query_relevance_lte: float
        :param response_relevance_eq: Equal to this value.
        :type response_relevance_eq: float
        :param response_relevance_gt: Greater than this value.
        :type response_relevance_gt: float
        :param response_relevance_gte: Greater than or equal to this value.
        :type response_relevance_gte: float
        :param response_relevance_lt: Less than this value.
        :type response_relevance_lt: float
        :param response_relevance_lte: Less than or equal to this value.
        :type response_relevance_lte: float
        :param tool_selection: Tool selection evaluation result.
        :type tool_selection: ToolClassEnum
        :param tool_usage: Tool usage evaluation result.
        :type tool_usage: ToolClassEnum
        :param trace_duration_eq: Duration exactly equal to this value (seconds).
        :type trace_duration_eq: float
        :param trace_duration_gt: Duration greater than this value (seconds).
        :type trace_duration_gt: float
        :param trace_duration_gte: Duration greater than or equal to this value (seconds).
        :type trace_duration_gte: float
        :param trace_duration_lt: Duration less than this value (seconds).
        :type trace_duration_lt: float
        :param trace_duration_lte: Duration less than or equal to this value (seconds).
        :type trace_duration_lte: float
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/traces/metrics/ is deprecated.", DeprecationWarning)

        _param = self._query_spans_with_metrics_v1_traces_metrics_get_serialize(
            task_ids=task_ids,
            sort=sort,
            page_size=page_size,
            page=page,
            trace_ids=trace_ids,
            start_time=start_time,
            end_time=end_time,
            tool_name=tool_name,
            span_types=span_types,
            annotation_score=annotation_score,
            annotation_type=annotation_type,
            continuous_eval_run_status=continuous_eval_run_status,
            continuous_eval_name=continuous_eval_name,
            span_ids=span_ids,
            session_ids=session_ids,
            user_ids=user_ids,
            span_name=span_name,
            span_name_contains=span_name_contains,
            status_code=status_code,
            query_relevance_eq=query_relevance_eq,
            query_relevance_gt=query_relevance_gt,
            query_relevance_gte=query_relevance_gte,
            query_relevance_lt=query_relevance_lt,
            query_relevance_lte=query_relevance_lte,
            response_relevance_eq=response_relevance_eq,
            response_relevance_gt=response_relevance_gt,
            response_relevance_gte=response_relevance_gte,
            response_relevance_lt=response_relevance_lt,
            response_relevance_lte=response_relevance_lte,
            tool_selection=tool_selection,
            tool_usage=tool_usage,
            trace_duration_eq=trace_duration_eq,
            trace_duration_gt=trace_duration_gt,
            trace_duration_gte=trace_duration_gte,
            trace_duration_lt=trace_duration_lt,
            trace_duration_lte=trace_duration_lte,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QueryTracesWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def query_spans_with_metrics_v1_traces_metrics_get_with_http_info(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        trace_ids: Annotated[Optional[List[StrictStr]], Field(description="Trace IDs to filter on. Optional.")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        tool_name: Annotated[Optional[StrictStr], Field(description="Return only results with this tool name.")] = None,
        span_types: Annotated[Optional[List[StrictStr]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        annotation_score: Annotated[Optional[Annotated[int, Field(le=1, strict=True, ge=0)]], Field(description="Filter by trace annotation score (0 or 1).")] = None,
        annotation_type: Annotated[Optional[AgenticAnnotationType], Field(description="Filter by trace annotation type (i.e. 'human' or 'continuous_eval').")] = None,
        continuous_eval_run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).")] = None,
        continuous_eval_name: Annotated[Optional[StrictStr], Field(description="Filter by continuous eval name.")] = None,
        span_ids: Annotated[Optional[List[StrictStr]], Field(description="Span IDs to filter on. Optional.")] = None,
        session_ids: Annotated[Optional[List[StrictStr]], Field(description="Session IDs to filter on. Optional.")] = None,
        user_ids: Annotated[Optional[List[StrictStr]], Field(description="User IDs to filter on. Optional.")] = None,
        span_name: Annotated[Optional[StrictStr], Field(description="Return only results with this span name.")] = None,
        span_name_contains: Annotated[Optional[StrictStr], Field(description="Return only results where span name contains this substring.")] = None,
        status_code: Annotated[Optional[List[StrictStr]], Field(description="Status codes to filter on. Optional. Valid values: Ok, Error, Unset.")] = None,
        query_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        query_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        query_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        query_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        query_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        response_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        response_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        response_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        response_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        response_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        tool_selection: Annotated[Optional[ToolClassEnum], Field(description="Tool selection evaluation result.")] = None,
        tool_usage: Annotated[Optional[ToolClassEnum], Field(description="Tool usage evaluation result.")] = None,
        trace_duration_eq: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration exactly equal to this value (seconds).")] = None,
        trace_duration_gt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than this value (seconds).")] = None,
        trace_duration_gte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than or equal to this value (seconds).")] = None,
        trace_duration_lt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than this value (seconds).")] = None,
        trace_duration_lte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than or equal to this value (seconds).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[QueryTracesWithMetricsResponse]:
        """(Deprecated) Compute Missing Metrics and Query Traces

        Query traces with comprehensive filtering and compute metrics. Returns traces containing spans that match the filters with computed metrics.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param trace_ids: Trace IDs to filter on. Optional.
        :type trace_ids: List[str]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param tool_name: Return only results with this tool name.
        :type tool_name: str
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[str]
        :param annotation_score: Filter by trace annotation score (0 or 1).
        :type annotation_score: int
        :param annotation_type: Filter by trace annotation type (i.e. 'human' or 'continuous_eval').
        :type annotation_type: AgenticAnnotationType
        :param continuous_eval_run_status: Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).
        :type continuous_eval_run_status: ContinuousEvalRunStatus
        :param continuous_eval_name: Filter by continuous eval name.
        :type continuous_eval_name: str
        :param span_ids: Span IDs to filter on. Optional.
        :type span_ids: List[str]
        :param session_ids: Session IDs to filter on. Optional.
        :type session_ids: List[str]
        :param user_ids: User IDs to filter on. Optional.
        :type user_ids: List[str]
        :param span_name: Return only results with this span name.
        :type span_name: str
        :param span_name_contains: Return only results where span name contains this substring.
        :type span_name_contains: str
        :param status_code: Status codes to filter on. Optional. Valid values: Ok, Error, Unset.
        :type status_code: List[str]
        :param query_relevance_eq: Equal to this value.
        :type query_relevance_eq: float
        :param query_relevance_gt: Greater than this value.
        :type query_relevance_gt: float
        :param query_relevance_gte: Greater than or equal to this value.
        :type query_relevance_gte: float
        :param query_relevance_lt: Less than this value.
        :type query_relevance_lt: float
        :param query_relevance_lte: Less than or equal to this value.
        :type query_relevance_lte: float
        :param response_relevance_eq: Equal to this value.
        :type response_relevance_eq: float
        :param response_relevance_gt: Greater than this value.
        :type response_relevance_gt: float
        :param response_relevance_gte: Greater than or equal to this value.
        :type response_relevance_gte: float
        :param response_relevance_lt: Less than this value.
        :type response_relevance_lt: float
        :param response_relevance_lte: Less than or equal to this value.
        :type response_relevance_lte: float
        :param tool_selection: Tool selection evaluation result.
        :type tool_selection: ToolClassEnum
        :param tool_usage: Tool usage evaluation result.
        :type tool_usage: ToolClassEnum
        :param trace_duration_eq: Duration exactly equal to this value (seconds).
        :type trace_duration_eq: float
        :param trace_duration_gt: Duration greater than this value (seconds).
        :type trace_duration_gt: float
        :param trace_duration_gte: Duration greater than or equal to this value (seconds).
        :type trace_duration_gte: float
        :param trace_duration_lt: Duration less than this value (seconds).
        :type trace_duration_lt: float
        :param trace_duration_lte: Duration less than or equal to this value (seconds).
        :type trace_duration_lte: float
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/traces/metrics/ is deprecated.", DeprecationWarning)

        _param = self._query_spans_with_metrics_v1_traces_metrics_get_serialize(
            task_ids=task_ids,
            sort=sort,
            page_size=page_size,
            page=page,
            trace_ids=trace_ids,
            start_time=start_time,
            end_time=end_time,
            tool_name=tool_name,
            span_types=span_types,
            annotation_score=annotation_score,
            annotation_type=annotation_type,
            continuous_eval_run_status=continuous_eval_run_status,
            continuous_eval_name=continuous_eval_name,
            span_ids=span_ids,
            session_ids=session_ids,
            user_ids=user_ids,
            span_name=span_name,
            span_name_contains=span_name_contains,
            status_code=status_code,
            query_relevance_eq=query_relevance_eq,
            query_relevance_gt=query_relevance_gt,
            query_relevance_gte=query_relevance_gte,
            query_relevance_lt=query_relevance_lt,
            query_relevance_lte=query_relevance_lte,
            response_relevance_eq=response_relevance_eq,
            response_relevance_gt=response_relevance_gt,
            response_relevance_gte=response_relevance_gte,
            response_relevance_lt=response_relevance_lt,
            response_relevance_lte=response_relevance_lte,
            tool_selection=tool_selection,
            tool_usage=tool_usage,
            trace_duration_eq=trace_duration_eq,
            trace_duration_gt=trace_duration_gt,
            trace_duration_gte=trace_duration_gte,
            trace_duration_lt=trace_duration_lt,
            trace_duration_lte=trace_duration_lte,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QueryTracesWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def query_spans_with_metrics_v1_traces_metrics_get_without_preload_content(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        sort: Annotated[Optional[PaginationSortMethod], Field(description="Sort the results (asc/desc)")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Page size. Default is 10. Must be greater than 0 and less than 5000.")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number")] = None,
        trace_ids: Annotated[Optional[List[StrictStr]], Field(description="Trace IDs to filter on. Optional.")] = None,
        start_time: Annotated[Optional[datetime], Field(description="Inclusive start date in ISO8601 string format. Use local time (not UTC).")] = None,
        end_time: Annotated[Optional[datetime], Field(description="Exclusive end date in ISO8601 string format. Use local time (not UTC).")] = None,
        tool_name: Annotated[Optional[StrictStr], Field(description="Return only results with this tool name.")] = None,
        span_types: Annotated[Optional[List[StrictStr]], Field(description="Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN")] = None,
        annotation_score: Annotated[Optional[Annotated[int, Field(le=1, strict=True, ge=0)]], Field(description="Filter by trace annotation score (0 or 1).")] = None,
        annotation_type: Annotated[Optional[AgenticAnnotationType], Field(description="Filter by trace annotation type (i.e. 'human' or 'continuous_eval').")] = None,
        continuous_eval_run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).")] = None,
        continuous_eval_name: Annotated[Optional[StrictStr], Field(description="Filter by continuous eval name.")] = None,
        span_ids: Annotated[Optional[List[StrictStr]], Field(description="Span IDs to filter on. Optional.")] = None,
        session_ids: Annotated[Optional[List[StrictStr]], Field(description="Session IDs to filter on. Optional.")] = None,
        user_ids: Annotated[Optional[List[StrictStr]], Field(description="User IDs to filter on. Optional.")] = None,
        span_name: Annotated[Optional[StrictStr], Field(description="Return only results with this span name.")] = None,
        span_name_contains: Annotated[Optional[StrictStr], Field(description="Return only results where span name contains this substring.")] = None,
        status_code: Annotated[Optional[List[StrictStr]], Field(description="Status codes to filter on. Optional. Valid values: Ok, Error, Unset.")] = None,
        query_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        query_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        query_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        query_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        query_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        response_relevance_eq: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Equal to this value.")] = None,
        response_relevance_gt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than this value.")] = None,
        response_relevance_gte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Greater than or equal to this value.")] = None,
        response_relevance_lt: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than this value.")] = None,
        response_relevance_lte: Annotated[Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]], Field(description="Less than or equal to this value.")] = None,
        tool_selection: Annotated[Optional[ToolClassEnum], Field(description="Tool selection evaluation result.")] = None,
        tool_usage: Annotated[Optional[ToolClassEnum], Field(description="Tool usage evaluation result.")] = None,
        trace_duration_eq: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration exactly equal to this value (seconds).")] = None,
        trace_duration_gt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than this value (seconds).")] = None,
        trace_duration_gte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration greater than or equal to this value (seconds).")] = None,
        trace_duration_lt: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than this value (seconds).")] = None,
        trace_duration_lte: Annotated[Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]], Field(description="Duration less than or equal to this value (seconds).")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """(Deprecated) Compute Missing Metrics and Query Traces

        Query traces with comprehensive filtering and compute metrics. Returns traces containing spans that match the filters with computed metrics.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param sort: Sort the results (asc/desc)
        :type sort: PaginationSortMethod
        :param page_size: Page size. Default is 10. Must be greater than 0 and less than 5000.
        :type page_size: int
        :param page: Page number
        :type page: int
        :param trace_ids: Trace IDs to filter on. Optional.
        :type trace_ids: List[str]
        :param start_time: Inclusive start date in ISO8601 string format. Use local time (not UTC).
        :type start_time: datetime
        :param end_time: Exclusive end date in ISO8601 string format. Use local time (not UTC).
        :type end_time: datetime
        :param tool_name: Return only results with this tool name.
        :type tool_name: str
        :param span_types: Span types to filter on. Optional. Valid values: AGENT, CHAIN, EMBEDDING, EVALUATOR, GUARDRAIL, LLM, RERANKER, RETRIEVER, TOOL, UNKNOWN
        :type span_types: List[str]
        :param annotation_score: Filter by trace annotation score (0 or 1).
        :type annotation_score: int
        :param annotation_type: Filter by trace annotation type (i.e. 'human' or 'continuous_eval').
        :type annotation_type: AgenticAnnotationType
        :param continuous_eval_run_status: Filter by trace annotation run status (e.g. 'passed', 'failed', etc.).
        :type continuous_eval_run_status: ContinuousEvalRunStatus
        :param continuous_eval_name: Filter by continuous eval name.
        :type continuous_eval_name: str
        :param span_ids: Span IDs to filter on. Optional.
        :type span_ids: List[str]
        :param session_ids: Session IDs to filter on. Optional.
        :type session_ids: List[str]
        :param user_ids: User IDs to filter on. Optional.
        :type user_ids: List[str]
        :param span_name: Return only results with this span name.
        :type span_name: str
        :param span_name_contains: Return only results where span name contains this substring.
        :type span_name_contains: str
        :param status_code: Status codes to filter on. Optional. Valid values: Ok, Error, Unset.
        :type status_code: List[str]
        :param query_relevance_eq: Equal to this value.
        :type query_relevance_eq: float
        :param query_relevance_gt: Greater than this value.
        :type query_relevance_gt: float
        :param query_relevance_gte: Greater than or equal to this value.
        :type query_relevance_gte: float
        :param query_relevance_lt: Less than this value.
        :type query_relevance_lt: float
        :param query_relevance_lte: Less than or equal to this value.
        :type query_relevance_lte: float
        :param response_relevance_eq: Equal to this value.
        :type response_relevance_eq: float
        :param response_relevance_gt: Greater than this value.
        :type response_relevance_gt: float
        :param response_relevance_gte: Greater than or equal to this value.
        :type response_relevance_gte: float
        :param response_relevance_lt: Less than this value.
        :type response_relevance_lt: float
        :param response_relevance_lte: Less than or equal to this value.
        :type response_relevance_lte: float
        :param tool_selection: Tool selection evaluation result.
        :type tool_selection: ToolClassEnum
        :param tool_usage: Tool usage evaluation result.
        :type tool_usage: ToolClassEnum
        :param trace_duration_eq: Duration exactly equal to this value (seconds).
        :type trace_duration_eq: float
        :param trace_duration_gt: Duration greater than this value (seconds).
        :type trace_duration_gt: float
        :param trace_duration_gte: Duration greater than or equal to this value (seconds).
        :type trace_duration_gte: float
        :param trace_duration_lt: Duration less than this value (seconds).
        :type trace_duration_lt: float
        :param trace_duration_lte: Duration less than or equal to this value (seconds).
        :type trace_duration_lte: float
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501
        warnings.warn("GET /v1/traces/metrics/ is deprecated.", DeprecationWarning)

        _param = self._query_spans_with_metrics_v1_traces_metrics_get_serialize(
            task_ids=task_ids,
            sort=sort,
            page_size=page_size,
            page=page,
            trace_ids=trace_ids,
            start_time=start_time,
            end_time=end_time,
            tool_name=tool_name,
            span_types=span_types,
            annotation_score=annotation_score,
            annotation_type=annotation_type,
            continuous_eval_run_status=continuous_eval_run_status,
            continuous_eval_name=continuous_eval_name,
            span_ids=span_ids,
            session_ids=session_ids,
            user_ids=user_ids,
            span_name=span_name,
            span_name_contains=span_name_contains,
            status_code=status_code,
            query_relevance_eq=query_relevance_eq,
            query_relevance_gt=query_relevance_gt,
            query_relevance_gte=query_relevance_gte,
            query_relevance_lt=query_relevance_lt,
            query_relevance_lte=query_relevance_lte,
            response_relevance_eq=response_relevance_eq,
            response_relevance_gt=response_relevance_gt,
            response_relevance_gte=response_relevance_gte,
            response_relevance_lt=response_relevance_lt,
            response_relevance_lte=response_relevance_lte,
            tool_selection=tool_selection,
            tool_usage=tool_usage,
            trace_duration_eq=trace_duration_eq,
            trace_duration_gt=trace_duration_gt,
            trace_duration_gte=trace_duration_gte,
            trace_duration_lt=trace_duration_lt,
            trace_duration_lte=trace_duration_lte,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "QueryTracesWithMetricsResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _query_spans_with_metrics_v1_traces_metrics_get_serialize(
        self,
        task_ids,
        sort,
        page_size,
        page,
        trace_ids,
        start_time,
        end_time,
        tool_name,
        span_types,
        annotation_score,
        annotation_type,
        continuous_eval_run_status,
        continuous_eval_name,
        span_ids,
        session_ids,
        user_ids,
        span_name,
        span_name_contains,
        status_code,
        query_relevance_eq,
        query_relevance_gt,
        query_relevance_gte,
        query_relevance_lt,
        query_relevance_lte,
        response_relevance_eq,
        response_relevance_gt,
        response_relevance_gte,
        response_relevance_lt,
        response_relevance_lte,
        tool_selection,
        tool_usage,
        trace_duration_eq,
        trace_duration_gt,
        trace_duration_gte,
        trace_duration_lt,
        trace_duration_lte,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'task_ids': 'multi',
            'trace_ids': 'multi',
            'span_types': 'multi',
            'span_ids': 'multi',
            'session_ids': 'multi',
            'user_ids': 'multi',
            'status_code': 'multi',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if sort is not None:
            
            _query_params.append(('sort', sort.value))
            
        if page_size is not None:
            
            _query_params.append(('page_size', page_size))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        if task_ids is not None:
            
            _query_params.append(('task_ids', task_ids))
            
        if trace_ids is not None:
            
            _query_params.append(('trace_ids', trace_ids))
            
        if start_time is not None:
            if isinstance(start_time, datetime):
                _query_params.append(
                    (
                        'start_time',
                        start_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('start_time', start_time))
            
        if end_time is not None:
            if isinstance(end_time, datetime):
                _query_params.append(
                    (
                        'end_time',
                        end_time.strftime(
                            self.api_client.configuration.datetime_format
                        )
                    )
                )
            else:
                _query_params.append(('end_time', end_time))
            
        if tool_name is not None:
            
            _query_params.append(('tool_name', tool_name))
            
        if span_types is not None:
            
            _query_params.append(('span_types', span_types))
            
        if annotation_score is not None:
            
            _query_params.append(('annotation_score', annotation_score))
            
        if annotation_type is not None:
            
            _query_params.append(('annotation_type', annotation_type.value))
            
        if continuous_eval_run_status is not None:
            
            _query_params.append(('continuous_eval_run_status', continuous_eval_run_status.value))
            
        if continuous_eval_name is not None:
            
            _query_params.append(('continuous_eval_name', continuous_eval_name))
            
        if span_ids is not None:
            
            _query_params.append(('span_ids', span_ids))
            
        if session_ids is not None:
            
            _query_params.append(('session_ids', session_ids))
            
        if user_ids is not None:
            
            _query_params.append(('user_ids', user_ids))
            
        if span_name is not None:
            
            _query_params.append(('span_name', span_name))
            
        if span_name_contains is not None:
            
            _query_params.append(('span_name_contains', span_name_contains))
            
        if status_code is not None:
            
            _query_params.append(('status_code', status_code))
            
        if query_relevance_eq is not None:
            
            _query_params.append(('query_relevance_eq', query_relevance_eq))
            
        if query_relevance_gt is not None:
            
            _query_params.append(('query_relevance_gt', query_relevance_gt))
            
        if query_relevance_gte is not None:
            
            _query_params.append(('query_relevance_gte', query_relevance_gte))
            
        if query_relevance_lt is not None:
            
            _query_params.append(('query_relevance_lt', query_relevance_lt))
            
        if query_relevance_lte is not None:
            
            _query_params.append(('query_relevance_lte', query_relevance_lte))
            
        if response_relevance_eq is not None:
            
            _query_params.append(('response_relevance_eq', response_relevance_eq))
            
        if response_relevance_gt is not None:
            
            _query_params.append(('response_relevance_gt', response_relevance_gt))
            
        if response_relevance_gte is not None:
            
            _query_params.append(('response_relevance_gte', response_relevance_gte))
            
        if response_relevance_lt is not None:
            
            _query_params.append(('response_relevance_lt', response_relevance_lt))
            
        if response_relevance_lte is not None:
            
            _query_params.append(('response_relevance_lte', response_relevance_lte))
            
        if tool_selection is not None:
            
            _query_params.append(('tool_selection', tool_selection.value))
            
        if tool_usage is not None:
            
            _query_params.append(('tool_usage', tool_usage.value))
            
        if trace_duration_eq is not None:
            
            _query_params.append(('trace_duration_eq', trace_duration_eq))
            
        if trace_duration_gt is not None:
            
            _query_params.append(('trace_duration_gt', trace_duration_gt))
            
        if trace_duration_gte is not None:
            
            _query_params.append(('trace_duration_gte', trace_duration_gte))
            
        if trace_duration_lt is not None:
            
            _query_params.append(('trace_duration_lt', trace_duration_lt))
            
        if trace_duration_lte is not None:
            
            _query_params.append(('trace_duration_lte', trace_duration_lte))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'API Key'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/traces/metrics/',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


