# Generated by ariadne-codegen
# Source: ./documents

from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import (
    ContentTypes,
    ConversationRoleTypes,
    ConversationTypes,
    EntityState,
    FileTypes,
    ModelServiceTypes,
    ObservableTypes,
)


class QueryConversations(BaseModel):
    conversations: Optional["QueryConversationsConversations"]


class QueryConversationsConversations(BaseModel):
    results: Optional[List[Optional["QueryConversationsConversationsResults"]]]


class QueryConversationsConversationsResults(BaseModel):
    id: str
    name: str
    creation_date: Any = Field(alias="creationDate")
    owner: "QueryConversationsConversationsResultsOwner"
    state: EntityState
    correlation_id: Optional[str] = Field(alias="correlationId")
    type: Optional[ConversationTypes]
    messages: Optional[List[Optional["QueryConversationsConversationsResultsMessages"]]]
    specification: Optional["QueryConversationsConversationsResultsSpecification"]
    filter: Optional["QueryConversationsConversationsResultsFilter"]


class QueryConversationsConversationsResultsOwner(BaseModel):
    id: str


class QueryConversationsConversationsResultsMessages(BaseModel):
    role: ConversationRoleTypes
    author: Optional[str]
    message: str
    citations: Optional[
        List[Optional["QueryConversationsConversationsResultsMessagesCitations"]]
    ]
    tokens: int
    throughput: Optional[float]
    completion_time: Optional[Any] = Field(alias="completionTime")
    timestamp: Any
    model_service: Optional[ModelServiceTypes] = Field(alias="modelService")
    model: Optional[str]


class QueryConversationsConversationsResultsMessagesCitations(BaseModel):
    content: Optional["QueryConversationsConversationsResultsMessagesCitationsContent"]
    index: Optional[int]
    text: Optional[str]
    start_time: Optional[Any] = Field(alias="startTime")
    end_time: Optional[Any] = Field(alias="endTime")
    page_number: Optional[int] = Field(alias="pageNumber")
    frame_number: Optional[int] = Field(alias="frameNumber")


class QueryConversationsConversationsResultsMessagesCitationsContent(BaseModel):
    id: str
    name: str
    state: EntityState
    type: Optional[ContentTypes]
    file_type: Optional[FileTypes] = Field(alias="fileType")
    file_name: Optional[str] = Field(alias="fileName")
    original_date: Optional[Any] = Field(alias="originalDate")
    uri: Optional[Any]


class QueryConversationsConversationsResultsSpecification(BaseModel):
    id: str
    name: str


class QueryConversationsConversationsResultsFilter(BaseModel):
    date_range: Optional["QueryConversationsConversationsResultsFilterDateRange"] = (
        Field(alias="dateRange")
    )
    creation_date_range: Optional[
        "QueryConversationsConversationsResultsFilterCreationDateRange"
    ] = Field(alias="creationDateRange")
    types: Optional[List[ContentTypes]]
    file_types: Optional[List[Optional[FileTypes]]] = Field(alias="fileTypes")
    contents: Optional[List["QueryConversationsConversationsResultsFilterContents"]]
    feeds: Optional[List["QueryConversationsConversationsResultsFilterFeeds"]]
    workflows: Optional[List["QueryConversationsConversationsResultsFilterWorkflows"]]
    collections: Optional[
        List["QueryConversationsConversationsResultsFilterCollections"]
    ]
    observations: Optional[
        List["QueryConversationsConversationsResultsFilterObservations"]
    ]


class QueryConversationsConversationsResultsFilterDateRange(BaseModel):
    from_: Optional[Any] = Field(alias="from")
    to: Optional[Any]


class QueryConversationsConversationsResultsFilterCreationDateRange(BaseModel):
    from_: Optional[Any] = Field(alias="from")
    to: Optional[Any]


class QueryConversationsConversationsResultsFilterContents(BaseModel):
    id: str


class QueryConversationsConversationsResultsFilterFeeds(BaseModel):
    id: str


class QueryConversationsConversationsResultsFilterWorkflows(BaseModel):
    id: str


class QueryConversationsConversationsResultsFilterCollections(BaseModel):
    id: str


class QueryConversationsConversationsResultsFilterObservations(BaseModel):
    type: ObservableTypes
    observable: "QueryConversationsConversationsResultsFilterObservationsObservable"
    states: Optional[List[Optional[EntityState]]]


class QueryConversationsConversationsResultsFilterObservationsObservable(BaseModel):
    id: str


QueryConversations.model_rebuild()
QueryConversationsConversations.model_rebuild()
QueryConversationsConversationsResults.model_rebuild()
QueryConversationsConversationsResultsMessages.model_rebuild()
QueryConversationsConversationsResultsMessagesCitations.model_rebuild()
QueryConversationsConversationsResultsFilter.model_rebuild()
QueryConversationsConversationsResultsFilterObservations.model_rebuild()
