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

from __future__ import annotations
from .chatcontent import ChatContent, ChatContentTypedDict
from .chatsources import ChatSources, ChatSourcesTypedDict
from fermisdk.types import BaseModel
from typing import Any, Dict, List, Literal, Optional
from typing_extensions import NotRequired, TypedDict


Role = Literal[
    "assistant",
    "user",
]


class ChatResponseTypedDict(TypedDict):
    content: NotRequired[ChatContentTypedDict]
    type: NotRequired[str]
    role: NotRequired[Role]
    components: NotRequired[Dict[str, Any]]
    r"""UI components (dynamic structure)"""
    tables: NotRequired[List[Dict[str, Any]]]
    r"""Table data (dynamic structure)"""
    charts: NotRequired[List[Dict[str, Any]]]
    r"""Chart data (dynamic structure)"""
    metadata: NotRequired[Dict[str, Any]]
    r"""Additional metadata (dynamic structure)"""
    sources: NotRequired[ChatSourcesTypedDict]
    files: NotRequired[List[Dict[str, Any]]]
    r"""File attachments (dynamic structure)"""
    reports: NotRequired[List[Dict[str, Any]]]
    r"""Reports (dynamic structure)"""
    reasoning: NotRequired[str]
    r"""Explanation of how the response was generated"""


class ChatResponse(BaseModel):
    content: Optional[ChatContent] = None

    type: Optional[str] = None

    role: Optional[Role] = None

    components: Optional[Dict[str, Any]] = None
    r"""UI components (dynamic structure)"""

    tables: Optional[List[Dict[str, Any]]] = None
    r"""Table data (dynamic structure)"""

    charts: Optional[List[Dict[str, Any]]] = None
    r"""Chart data (dynamic structure)"""

    metadata: Optional[Dict[str, Any]] = None
    r"""Additional metadata (dynamic structure)"""

    sources: Optional[ChatSources] = None

    files: Optional[List[Dict[str, Any]]] = None
    r"""File attachments (dynamic structure)"""

    reports: Optional[List[Dict[str, Any]]] = None
    r"""Reports (dynamic structure)"""

    reasoning: Optional[str] = None
    r"""Explanation of how the response was generated"""
