# 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, StrictBool, StrictBytes, StrictInt, StrictStr
from typing import Any, List, Optional, Tuple, Union
from typing_extensions import Annotated
from _generated.models.agentic_annotation_request import AgenticAnnotationRequest
from _generated.models.agentic_annotation_response import AgenticAnnotationResponse
from _generated.models.agentic_annotation_type import AgenticAnnotationType
from _generated.models.continuous_eval_run_status import ContinuousEvalRunStatus
from _generated.models.list_agentic_annotations_response import ListAgenticAnnotationsResponse
from _generated.models.pagination_sort_method import PaginationSortMethod
from _generated.models.tool_class_enum import ToolClassEnum
from _generated.models.trace_list_response import TraceListResponse
from _generated.models.trace_response import TraceResponse

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


class TracesApi:
    """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 annotate_trace_api_v1_traces_trace_id_annotations_post(
        self,
        trace_id: StrictStr,
        agentic_annotation_request: AgenticAnnotationRequest,
        _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,
    ) -> AgenticAnnotationResponse:
        """Annotate a Trace

        Annotate a trace with a score and description (1 = liked, 0 = disliked)

        :param trace_id: (required)
        :type trace_id: str
        :param agentic_annotation_request: (required)
        :type agentic_annotation_request: AgenticAnnotationRequest
        :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._annotate_trace_api_v1_traces_trace_id_annotations_post_serialize(
            trace_id=trace_id,
            agentic_annotation_request=agentic_annotation_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AgenticAnnotationResponse",
            '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 annotate_trace_api_v1_traces_trace_id_annotations_post_with_http_info(
        self,
        trace_id: StrictStr,
        agentic_annotation_request: AgenticAnnotationRequest,
        _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[AgenticAnnotationResponse]:
        """Annotate a Trace

        Annotate a trace with a score and description (1 = liked, 0 = disliked)

        :param trace_id: (required)
        :type trace_id: str
        :param agentic_annotation_request: (required)
        :type agentic_annotation_request: AgenticAnnotationRequest
        :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._annotate_trace_api_v1_traces_trace_id_annotations_post_serialize(
            trace_id=trace_id,
            agentic_annotation_request=agentic_annotation_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AgenticAnnotationResponse",
            '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 annotate_trace_api_v1_traces_trace_id_annotations_post_without_preload_content(
        self,
        trace_id: StrictStr,
        agentic_annotation_request: AgenticAnnotationRequest,
        _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:
        """Annotate a Trace

        Annotate a trace with a score and description (1 = liked, 0 = disliked)

        :param trace_id: (required)
        :type trace_id: str
        :param agentic_annotation_request: (required)
        :type agentic_annotation_request: AgenticAnnotationRequest
        :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._annotate_trace_api_v1_traces_trace_id_annotations_post_serialize(
            trace_id=trace_id,
            agentic_annotation_request=agentic_annotation_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _annotate_trace_api_v1_traces_trace_id_annotations_post_serialize(
        self,
        trace_id,
        agentic_annotation_request,
        _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 trace_id is not None:
            _path_params['trace_id'] = trace_id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if agentic_annotation_request is not None:
            _body_params = agentic_annotation_request


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/traces/{trace_id}/annotations',
            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_trace_metrics_api_v1_traces_trace_id_metrics_get(
        self,
        trace_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,
    ) -> TraceResponse:
        """Compute Missing Trace Metrics

        Compute all missing metrics for trace spans on-demand. Returns full trace tree with computed metrics.

        :param trace_id: (required)
        :type trace_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_trace_metrics_api_v1_traces_trace_id_metrics_get_serialize(
            trace_id=trace_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TraceResponse",
            '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_trace_metrics_api_v1_traces_trace_id_metrics_get_with_http_info(
        self,
        trace_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[TraceResponse]:
        """Compute Missing Trace Metrics

        Compute all missing metrics for trace spans on-demand. Returns full trace tree with computed metrics.

        :param trace_id: (required)
        :type trace_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_trace_metrics_api_v1_traces_trace_id_metrics_get_serialize(
            trace_id=trace_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TraceResponse",
            '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_trace_metrics_api_v1_traces_trace_id_metrics_get_without_preload_content(
        self,
        trace_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 Trace Metrics

        Compute all missing metrics for trace spans on-demand. Returns full trace tree with computed metrics.

        :param trace_id: (required)
        :type trace_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_trace_metrics_api_v1_traces_trace_id_metrics_get_serialize(
            trace_id=trace_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _compute_trace_metrics_api_v1_traces_trace_id_metrics_get_serialize(
        self,
        trace_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 trace_id is not None:
            _path_params['trace_id'] = trace_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/{trace_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 delete_annotation_from_trace_api_v1_traces_trace_id_annotations_delete(
        self,
        trace_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,
    ) -> None:
        """Delete an annotation from a trace

        Delete an annotation from a trace

        :param trace_id: (required)
        :type trace_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._delete_annotation_from_trace_api_v1_traces_trace_id_annotations_delete_serialize(
            trace_id=trace_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': 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 delete_annotation_from_trace_api_v1_traces_trace_id_annotations_delete_with_http_info(
        self,
        trace_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[None]:
        """Delete an annotation from a trace

        Delete an annotation from a trace

        :param trace_id: (required)
        :type trace_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._delete_annotation_from_trace_api_v1_traces_trace_id_annotations_delete_serialize(
            trace_id=trace_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '204': 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 delete_annotation_from_trace_api_v1_traces_trace_id_annotations_delete_without_preload_content(
        self,
        trace_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:
        """Delete an annotation from a trace

        Delete an annotation from a trace

        :param trace_id: (required)
        :type trace_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._delete_annotation_from_trace_api_v1_traces_trace_id_annotations_delete_serialize(
            trace_id=trace_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _delete_annotation_from_trace_api_v1_traces_trace_id_annotations_delete_serialize(
        self,
        trace_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 trace_id is not None:
            _path_params['trace_id'] = trace_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='DELETE',
            resource_path='/api/v1/traces/{trace_id}/annotations',
            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_annotation_by_id_api_v1_traces_annotations_annotation_id_get(
        self,
        annotation_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,
    ) -> AgenticAnnotationResponse:
        """Get an annotation by id

        Get an annotation by id

        :param annotation_id: (required)
        :type annotation_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_annotation_by_id_api_v1_traces_annotations_annotation_id_get_serialize(
            annotation_id=annotation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AgenticAnnotationResponse",
            '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_annotation_by_id_api_v1_traces_annotations_annotation_id_get_with_http_info(
        self,
        annotation_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[AgenticAnnotationResponse]:
        """Get an annotation by id

        Get an annotation by id

        :param annotation_id: (required)
        :type annotation_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_annotation_by_id_api_v1_traces_annotations_annotation_id_get_serialize(
            annotation_id=annotation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "AgenticAnnotationResponse",
            '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_annotation_by_id_api_v1_traces_annotations_annotation_id_get_without_preload_content(
        self,
        annotation_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 an annotation by id

        Get an annotation by id

        :param annotation_id: (required)
        :type annotation_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_annotation_by_id_api_v1_traces_annotations_annotation_id_get_serialize(
            annotation_id=annotation_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _get_annotation_by_id_api_v1_traces_annotations_annotation_id_get_serialize(
        self,
        annotation_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 annotation_id is not None:
            _path_params['annotation_id'] = annotation_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/annotations/{annotation_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_trace_by_id_api_v1_traces_trace_id_get(
        self,
        trace_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,
    ) -> TraceResponse:
        """Get Single Trace

        Get complete trace tree with existing metrics (no computation). Returns full trace structure with spans.

        :param trace_id: (required)
        :type trace_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_trace_by_id_api_v1_traces_trace_id_get_serialize(
            trace_id=trace_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TraceResponse",
            '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_trace_by_id_api_v1_traces_trace_id_get_with_http_info(
        self,
        trace_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[TraceResponse]:
        """Get Single Trace

        Get complete trace tree with existing metrics (no computation). Returns full trace structure with spans.

        :param trace_id: (required)
        :type trace_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_trace_by_id_api_v1_traces_trace_id_get_serialize(
            trace_id=trace_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "TraceResponse",
            '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_trace_by_id_api_v1_traces_trace_id_get_without_preload_content(
        self,
        trace_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 Trace

        Get complete trace tree with existing metrics (no computation). Returns full trace structure with spans.

        :param trace_id: (required)
        :type trace_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_trace_by_id_api_v1_traces_trace_id_get_serialize(
            trace_id=trace_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _get_trace_by_id_api_v1_traces_trace_id_get_serialize(
        self,
        trace_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 trace_id is not None:
            _path_params['trace_id'] = trace_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/{trace_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 list_annotations_for_trace_api_v1_traces_trace_id_annotations_get(
        self,
        trace_id: StrictStr,
        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,
        continuous_eval_id: Annotated[Optional[StrictStr], Field(description="ID of the continuous eval to filter on.")] = None,
        annotation_type: Annotated[Optional[StrictStr], Field(description="Annotation type to filter on.")] = None,
        annotation_score: Annotated[Optional[StrictInt], Field(description="Annotation score to filter on.")] = None,
        run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Run status to filter on.")] = None,
        created_after: Annotated[Optional[StrictStr], Field(description="Inclusive start date for prompt creation in ISO8601 string format. Use local time (not UTC).")] = None,
        created_before: Annotated[Optional[StrictStr], Field(description="Exclusive end date for prompt creation in ISO8601 string format. Use local time (not UTC).")] = 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,
    ) -> ListAgenticAnnotationsResponse:
        """List Annotations for a Trace

        List annotations for a trace

        :param trace_id: (required)
        :type trace_id: 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 continuous_eval_id: ID of the continuous eval to filter on.
        :type continuous_eval_id: str
        :param annotation_type: Annotation type to filter on.
        :type annotation_type: str
        :param annotation_score: Annotation score to filter on.
        :type annotation_score: int
        :param run_status: Run status to filter on.
        :type run_status: ContinuousEvalRunStatus
        :param created_after: Inclusive start date for prompt creation in ISO8601 string format. Use local time (not UTC).
        :type created_after: str
        :param created_before: Exclusive end date for prompt creation in ISO8601 string format. Use local time (not UTC).
        :type created_before: 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._list_annotations_for_trace_api_v1_traces_trace_id_annotations_get_serialize(
            trace_id=trace_id,
            sort=sort,
            page_size=page_size,
            page=page,
            continuous_eval_id=continuous_eval_id,
            annotation_type=annotation_type,
            annotation_score=annotation_score,
            run_status=run_status,
            created_after=created_after,
            created_before=created_before,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ListAgenticAnnotationsResponse",
            '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_annotations_for_trace_api_v1_traces_trace_id_annotations_get_with_http_info(
        self,
        trace_id: StrictStr,
        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,
        continuous_eval_id: Annotated[Optional[StrictStr], Field(description="ID of the continuous eval to filter on.")] = None,
        annotation_type: Annotated[Optional[StrictStr], Field(description="Annotation type to filter on.")] = None,
        annotation_score: Annotated[Optional[StrictInt], Field(description="Annotation score to filter on.")] = None,
        run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Run status to filter on.")] = None,
        created_after: Annotated[Optional[StrictStr], Field(description="Inclusive start date for prompt creation in ISO8601 string format. Use local time (not UTC).")] = None,
        created_before: Annotated[Optional[StrictStr], Field(description="Exclusive end date for prompt creation in ISO8601 string format. Use local time (not UTC).")] = 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[ListAgenticAnnotationsResponse]:
        """List Annotations for a Trace

        List annotations for a trace

        :param trace_id: (required)
        :type trace_id: 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 continuous_eval_id: ID of the continuous eval to filter on.
        :type continuous_eval_id: str
        :param annotation_type: Annotation type to filter on.
        :type annotation_type: str
        :param annotation_score: Annotation score to filter on.
        :type annotation_score: int
        :param run_status: Run status to filter on.
        :type run_status: ContinuousEvalRunStatus
        :param created_after: Inclusive start date for prompt creation in ISO8601 string format. Use local time (not UTC).
        :type created_after: str
        :param created_before: Exclusive end date for prompt creation in ISO8601 string format. Use local time (not UTC).
        :type created_before: 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._list_annotations_for_trace_api_v1_traces_trace_id_annotations_get_serialize(
            trace_id=trace_id,
            sort=sort,
            page_size=page_size,
            page=page,
            continuous_eval_id=continuous_eval_id,
            annotation_type=annotation_type,
            annotation_score=annotation_score,
            run_status=run_status,
            created_after=created_after,
            created_before=created_before,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ListAgenticAnnotationsResponse",
            '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_annotations_for_trace_api_v1_traces_trace_id_annotations_get_without_preload_content(
        self,
        trace_id: StrictStr,
        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,
        continuous_eval_id: Annotated[Optional[StrictStr], Field(description="ID of the continuous eval to filter on.")] = None,
        annotation_type: Annotated[Optional[StrictStr], Field(description="Annotation type to filter on.")] = None,
        annotation_score: Annotated[Optional[StrictInt], Field(description="Annotation score to filter on.")] = None,
        run_status: Annotated[Optional[ContinuousEvalRunStatus], Field(description="Run status to filter on.")] = None,
        created_after: Annotated[Optional[StrictStr], Field(description="Inclusive start date for prompt creation in ISO8601 string format. Use local time (not UTC).")] = None,
        created_before: Annotated[Optional[StrictStr], Field(description="Exclusive end date for prompt creation in ISO8601 string format. Use local time (not UTC).")] = 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 Annotations for a Trace

        List annotations for a trace

        :param trace_id: (required)
        :type trace_id: 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 continuous_eval_id: ID of the continuous eval to filter on.
        :type continuous_eval_id: str
        :param annotation_type: Annotation type to filter on.
        :type annotation_type: str
        :param annotation_score: Annotation score to filter on.
        :type annotation_score: int
        :param run_status: Run status to filter on.
        :type run_status: ContinuousEvalRunStatus
        :param created_after: Inclusive start date for prompt creation in ISO8601 string format. Use local time (not UTC).
        :type created_after: str
        :param created_before: Exclusive end date for prompt creation in ISO8601 string format. Use local time (not UTC).
        :type created_before: 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._list_annotations_for_trace_api_v1_traces_trace_id_annotations_get_serialize(
            trace_id=trace_id,
            sort=sort,
            page_size=page_size,
            page=page,
            continuous_eval_id=continuous_eval_id,
            annotation_type=annotation_type,
            annotation_score=annotation_score,
            run_status=run_status,
            created_after=created_after,
            created_before=created_before,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _list_annotations_for_trace_api_v1_traces_trace_id_annotations_get_serialize(
        self,
        trace_id,
        sort,
        page_size,
        page,
        continuous_eval_id,
        annotation_type,
        annotation_score,
        run_status,
        created_after,
        created_before,
        _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 trace_id is not None:
            _path_params['trace_id'] = trace_id
        # 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 continuous_eval_id is not None:
            
            _query_params.append(('continuous_eval_id', continuous_eval_id))
            
        if annotation_type is not None:
            
            _query_params.append(('annotation_type', annotation_type))
            
        if annotation_score is not None:
            
            _query_params.append(('annotation_score', annotation_score))
            
        if run_status is not None:
            
            _query_params.append(('run_status', run_status.value))
            
        if created_after is not None:
            
            _query_params.append(('created_after', created_after))
            
        if created_before is not None:
            
            _query_params.append(('created_before', created_before))
            
        # 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/{trace_id}/annotations',
            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_traces_metadata_api_v1_traces_get(
        self,
        task_ids: Annotated[List[StrictStr], Field(min_length=1, description="Task IDs to filter on. At least one is required.")],
        include_spans: Annotated[Optional[StrictBool], Field(description="Include flat list of spans for each trace. Defaults to false for performance.")] = 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,
        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,
    ) -> TraceListResponse:
        """List Trace Metadata

        Get lightweight trace metadata for browsing/filtering operations. Returns metadata only without spans or metrics for fast performance. Set include_spans=true to include flat list of spans for each trace.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param include_spans: Include flat list of spans for each trace. Defaults to false for performance.
        :type include_spans: bool
        :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_traces_metadata_api_v1_traces_get_serialize(
            task_ids=task_ids,
            include_spans=include_spans,
            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': "TraceListResponse",
            '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_traces_metadata_api_v1_traces_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.")],
        include_spans: Annotated[Optional[StrictBool], Field(description="Include flat list of spans for each trace. Defaults to false for performance.")] = 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,
        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[TraceListResponse]:
        """List Trace Metadata

        Get lightweight trace metadata for browsing/filtering operations. Returns metadata only without spans or metrics for fast performance. Set include_spans=true to include flat list of spans for each trace.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param include_spans: Include flat list of spans for each trace. Defaults to false for performance.
        :type include_spans: bool
        :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_traces_metadata_api_v1_traces_get_serialize(
            task_ids=task_ids,
            include_spans=include_spans,
            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': "TraceListResponse",
            '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_traces_metadata_api_v1_traces_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.")],
        include_spans: Annotated[Optional[StrictBool], Field(description="Include flat list of spans for each trace. Defaults to false for performance.")] = 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,
        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 Trace Metadata

        Get lightweight trace metadata for browsing/filtering operations. Returns metadata only without spans or metrics for fast performance. Set include_spans=true to include flat list of spans for each trace.

        :param task_ids: Task IDs to filter on. At least one is required. (required)
        :type task_ids: List[str]
        :param include_spans: Include flat list of spans for each trace. Defaults to false for performance.
        :type include_spans: bool
        :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_traces_metadata_api_v1_traces_get_serialize(
            task_ids=task_ids,
            include_spans=include_spans,
            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': "TraceListResponse",
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _list_traces_metadata_api_v1_traces_get_serialize(
        self,
        task_ids,
        include_spans,
        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 include_spans is not None:
            
            _query_params.append(('include_spans', include_spans))
            
        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',
            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 receive_traces_api_v1_traces_post(
        self,
        body: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        _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,
    ) -> object:
        """Receive Traces

        Receiver for OpenInference trace standard.

        :param body: (required)
        :type body: bytearray
        :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._receive_traces_api_v1_traces_post_serialize(
            body=body,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '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 receive_traces_api_v1_traces_post_with_http_info(
        self,
        body: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        _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[object]:
        """Receive Traces

        Receiver for OpenInference trace standard.

        :param body: (required)
        :type body: bytearray
        :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._receive_traces_api_v1_traces_post_serialize(
            body=body,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '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 receive_traces_api_v1_traces_post_without_preload_content(
        self,
        body: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        _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:
        """Receive Traces

        Receiver for OpenInference trace standard.

        :param body: (required)
        :type body: bytearray
        :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._receive_traces_api_v1_traces_post_serialize(
            body=body,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _receive_traces_api_v1_traces_post_serialize(
        self,
        body,
        _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
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if body is not None:
            # convert to byte array if the input is a file name (str)
            if isinstance(body, str):
                with open(body, "rb") as _fp:
                    _body_params = _fp.read()
            elif isinstance(body, tuple):
                # drop the filename from the tuple
                _body_params = body[1]
            else:
                _body_params = body


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/traces',
            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 receive_traces_v1_traces_post(
        self,
        body: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        _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,
    ) -> object:
        """(Deprecated) Receive Traces

        Receiver for OpenInference trace standard.

        :param body: (required)
        :type body: bytearray
        :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("POST /v1/traces is deprecated.", DeprecationWarning)

        _param = self._receive_traces_v1_traces_post_serialize(
            body=body,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '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 receive_traces_v1_traces_post_with_http_info(
        self,
        body: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        _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[object]:
        """(Deprecated) Receive Traces

        Receiver for OpenInference trace standard.

        :param body: (required)
        :type body: bytearray
        :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("POST /v1/traces is deprecated.", DeprecationWarning)

        _param = self._receive_traces_v1_traces_post_serialize(
            body=body,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
            '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 receive_traces_v1_traces_post_without_preload_content(
        self,
        body: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        _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) Receive Traces

        Receiver for OpenInference trace standard.

        :param body: (required)
        :type body: bytearray
        :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("POST /v1/traces is deprecated.", DeprecationWarning)

        _param = self._receive_traces_v1_traces_post_serialize(
            body=body,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _receive_traces_v1_traces_post_serialize(
        self,
        body,
        _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
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if body is not None:
            # convert to byte array if the input is a file name (str)
            if isinstance(body, str):
                with open(body, "rb") as _fp:
                    _body_params = _fp.read()
            elif isinstance(body, tuple):
                # drop the filename from the tuple
                _body_params = body[1]
            else:
                _body_params = body


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

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/traces',
            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
        )


