"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from honeyhive.types import BaseModel
from honeyhive.utils import FieldMetadata, PathParamMetadata, RequestMetadata
import httpx
from typing import Any, Dict, List, Optional, TypedDict
from typing_extensions import Annotated, NotRequired


class MappingTypedDict(TypedDict):
    r"""Mapping of keys in the data object to be used as inputs, ground truth, and history, everything else goes into metadata"""

    inputs: List[str]
    r"""List of keys in the data object to be used as inputs"""
    ground_truth: List[str]
    r"""List of keys in the data object to be used as ground truth"""
    history: List[str]
    r"""List of keys in the data object to be used as chat history, can be empty list if not needed"""


class Mapping(BaseModel):
    r"""Mapping of keys in the data object to be used as inputs, ground truth, and history, everything else goes into metadata"""

    inputs: List[str]
    r"""List of keys in the data object to be used as inputs"""

    ground_truth: List[str]
    r"""List of keys in the data object to be used as ground truth"""

    history: List[str]
    r"""List of keys in the data object to be used as chat history, can be empty list if not needed"""


class AddDatapointsRequestBodyTypedDict(TypedDict):
    project: str
    r"""Name of the project associated with this dataset like `New Project`"""
    data: List[Dict[str, Any]]
    r"""List of JSON objects to be added as datapoints"""
    mapping: MappingTypedDict
    r"""Mapping of keys in the data object to be used as inputs, ground truth, and history, everything else goes into metadata"""


class AddDatapointsRequestBody(BaseModel):
    project: str
    r"""Name of the project associated with this dataset like `New Project`"""

    data: List[Dict[str, Any]]
    r"""List of JSON objects to be added as datapoints"""

    mapping: Mapping
    r"""Mapping of keys in the data object to be used as inputs, ground truth, and history, everything else goes into metadata"""


class AddDatapointsRequestTypedDict(TypedDict):
    dataset_id: str
    r"""The unique identifier of the dataset to add datapoints to like  `663876ec4611c47f4970f0c3`"""
    request_body: AddDatapointsRequestBodyTypedDict


class AddDatapointsRequest(BaseModel):
    dataset_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The unique identifier of the dataset to add datapoints to like  `663876ec4611c47f4970f0c3`"""

    request_body: Annotated[
        AddDatapointsRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]


class AddDatapointsResponseBodyTypedDict(TypedDict):
    r"""Successful addition"""

    inserted: NotRequired[bool]
    datapoint_ids: NotRequired[List[str]]
    r"""List of unique datapoint ids added to the dataset"""


class AddDatapointsResponseBody(BaseModel):
    r"""Successful addition"""

    inserted: Optional[bool] = None

    datapoint_ids: Optional[List[str]] = None
    r"""List of unique datapoint ids added to the dataset"""


class AddDatapointsResponseTypedDict(TypedDict):
    content_type: str
    r"""HTTP response content type for this operation"""
    status_code: int
    r"""HTTP response status code for this operation"""
    raw_response: httpx.Response
    r"""Raw HTTP response; suitable for custom response parsing"""
    object: NotRequired[AddDatapointsResponseBodyTypedDict]
    r"""Successful addition"""


class AddDatapointsResponse(BaseModel):
    content_type: str
    r"""HTTP response content type for this operation"""

    status_code: int
    r"""HTTP response status code for this operation"""

    raw_response: httpx.Response
    r"""Raw HTTP response; suitable for custom response parsing"""

    object: Optional[AddDatapointsResponseBody] = None
    r"""Successful addition"""
