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

from __future__ import annotations
from fermisdk.types import BaseModel
from typing import List, Literal, Optional
from typing_extensions import NotRequired, TypedDict


VisualizationRequestAction = Literal["visualization",]
r"""Must be 'visualization'"""


ConfidenceThreshold = Literal[
    "high",
    "medium",
    "low",
]
r"""Confidence level for external relationship filtering"""


ResponseFormat = Literal[
    "html",
    "json",
]
r"""Response format: 'html' returns PyVis HTML, 'json' returns MongoDB schema-style JSON"""


class VisualizationRequestTypedDict(TypedDict):
    action: VisualizationRequestAction
    r"""Must be 'visualization'"""
    connection_ids: NotRequired[List[str]]
    r"""Multiple connections to merge (preferred)"""
    connection_id: NotRequired[str]
    r"""Legacy single-connection input"""
    discover_external_relationships: NotRequired[bool]
    r"""Enable LLM-based cross-connection edges"""
    confidence_threshold: NotRequired[ConfidenceThreshold]
    r"""Confidence level for external relationship filtering"""
    response_format: NotRequired[ResponseFormat]
    r"""Response format: 'html' returns PyVis HTML, 'json' returns MongoDB schema-style JSON"""


class VisualizationRequest(BaseModel):
    action: VisualizationRequestAction
    r"""Must be 'visualization'"""

    connection_ids: Optional[List[str]] = None
    r"""Multiple connections to merge (preferred)"""

    connection_id: Optional[str] = None
    r"""Legacy single-connection input"""

    discover_external_relationships: Optional[bool] = True
    r"""Enable LLM-based cross-connection edges"""

    confidence_threshold: Optional[ConfidenceThreshold] = "high"
    r"""Confidence level for external relationship filtering"""

    response_format: Optional[ResponseFormat] = "html"
    r"""Response format: 'html' returns PyVis HTML, 'json' returns MongoDB schema-style JSON"""
