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

from __future__ import annotations
from enum import Enum
from honeyhive.types import BaseModel
from typing import Any, Dict, List, Optional, TypedDict
from typing_extensions import NotRequired


class CreateEventRequestEventType(str, Enum):
    r"""Specify whether the event is of \"model\", \"tool\" or \"chain\" type"""

    MODEL = "model"
    TOOL = "tool"
    CHAIN = "chain"


class CreateEventRequestTypedDict(TypedDict):
    project: str
    r"""Project associated with the event"""
    source: str
    r"""Source of the event - production, staging, etc"""
    event_name: str
    r"""Name of the event"""
    event_type: CreateEventRequestEventType
    r"""Specify whether the event is of \"model\", \"tool\" or \"chain\" type"""
    config: Dict[str, Any]
    r"""Associated configuration JSON for the event - model name, vector index name, etc"""
    inputs: Dict[str, Any]
    r"""Input JSON given to the event - prompt, chunks, etc"""
    duration: float
    r"""How long the event took in milliseconds"""
    event_id: NotRequired[str]
    r"""Unique id of the event, if not set, it will be auto-generated"""
    session_id: NotRequired[str]
    r"""Unique id of the session associated with the event, if not set, it will be auto-generated"""
    parent_id: NotRequired[str]
    r"""Id of the parent event if nested"""
    children_ids: NotRequired[List[str]]
    r"""Id of events that are nested within the event"""
    outputs: NotRequired[Dict[str, Any]]
    r"""Final output JSON of the event"""
    error: NotRequired[str]
    r"""Any error description if event failed"""
    start_time: NotRequired[float]
    r"""UTC timestamp (in milliseconds) for the event start"""
    end_time: NotRequired[int]
    r"""UTC timestamp (in milliseconds) for the event end"""
    metadata: NotRequired[Dict[str, Any]]
    r"""Any system or application metadata associated with the event"""
    feedback: NotRequired[Dict[str, Any]]
    r"""Any user feedback provided for the event output"""
    metrics: NotRequired[Dict[str, Any]]
    r"""Any values computed over the output of the event"""
    user_properties: NotRequired[Dict[str, Any]]
    r"""Any user properties associated with the event"""


class CreateEventRequest(BaseModel):
    project: str
    r"""Project associated with the event"""

    source: str
    r"""Source of the event - production, staging, etc"""

    event_name: str
    r"""Name of the event"""

    event_type: CreateEventRequestEventType
    r"""Specify whether the event is of \"model\", \"tool\" or \"chain\" type"""

    config: Dict[str, Any]
    r"""Associated configuration JSON for the event - model name, vector index name, etc"""

    inputs: Dict[str, Any]
    r"""Input JSON given to the event - prompt, chunks, etc"""

    duration: float
    r"""How long the event took in milliseconds"""

    event_id: Optional[str] = None
    r"""Unique id of the event, if not set, it will be auto-generated"""

    session_id: Optional[str] = None
    r"""Unique id of the session associated with the event, if not set, it will be auto-generated"""

    parent_id: Optional[str] = None
    r"""Id of the parent event if nested"""

    children_ids: Optional[List[str]] = None
    r"""Id of events that are nested within the event"""

    outputs: Optional[Dict[str, Any]] = None
    r"""Final output JSON of the event"""

    error: Optional[str] = None
    r"""Any error description if event failed"""

    start_time: Optional[float] = None
    r"""UTC timestamp (in milliseconds) for the event start"""

    end_time: Optional[int] = None
    r"""UTC timestamp (in milliseconds) for the event end"""

    metadata: Optional[Dict[str, Any]] = None
    r"""Any system or application metadata associated with the event"""

    feedback: Optional[Dict[str, Any]] = None
    r"""Any user feedback provided for the event output"""

    metrics: Optional[Dict[str, Any]] = None
    r"""Any values computed over the output of the event"""

    user_properties: Optional[Dict[str, Any]] = None
    r"""Any user properties associated with the event"""
