# Generated by ariadne-codegen
# Source: ../../schema.graphql

from typing import Any, Optional
from uuid import UUID

from pydantic import Field

from .base_model import BaseModel
from .enums import (
    AgentSubtype,
    ChatMode,
    ModelName,
    ReasoningLevel,
    SandboxProvider,
    ToolPermissionStatus,
)


class AttachmentInput(BaseModel):
    file_attachment: Optional["FileAttachmentInput"] = Field(
        alias="fileAttachment", default=None
    )
    url_attachment: Optional["URLAttachmentInput"] = Field(
        alias="urlAttachment", default=None
    )
    table_schema_attachment: Optional["TableSchemaAttachmentInput"] = Field(
        alias="tableSchemaAttachment", default=None
    )
    prompt_attachment: Optional["PromptAttachmentInput"] = Field(
        alias="promptAttachment", default=None
    )
    sql_attachment: Optional["SQLAttachmentInput"] = Field(
        alias="sqlAttachment", default=None
    )
    skill_attachment: Optional["SkillAttachmentInput"] = Field(
        alias="skillAttachment", default=None
    )


class ChatConfig(BaseModel):
    chat_uuid: UUID = Field(alias="chatUuid")
    model: Optional[ModelName] = None
    require_confirmation: Optional[bool] = Field(
        alias="requireConfirmation", default=False
    )
    read_only: Optional[bool] = Field(alias="readOnly", default=False)
    depth_limit: int = Field(alias="depthLimit", default=6)
    reasoning_level: ReasoningLevel = Field(
        alias="reasoningLevel", default=ReasoningLevel.LOW
    )
    internal_settings: Optional[Any] = Field(alias="internalSettings", default=None)


class ChatInput(BaseModel):
    prompt: Optional["Prompt"] = None
    client_sourced_event_uuid: Optional[UUID] = Field(
        alias="clientSourcedEventUuid", default=None
    )
    permission_status: Optional[ToolPermissionStatus] = Field(
        alias="permissionStatus", default=None
    )
    table_filter_config_uuid: Optional[UUID] = Field(
        alias="tableFilterConfigUuid", default=None
    )
    planning_required: Optional[bool] = Field(alias="planningRequired", default=None)
    timezone: Optional[str] = None
    mcp_server_configs: Optional["McpServerConfigsInput"] = Field(
        alias="mcpServerConfigs", default=None
    )
    database_resource_configs: Optional[list["DatabaseResourceConfigInput"]] = Field(
        alias="databaseResourceConfigs", default=None
    )
    repository_resource_config: Optional["RepositoryResourceConfigInput"] = Field(
        alias="repositoryResourceConfig", default=None
    )


class ChatResourceConfigInput(BaseModel):
    mode: ChatMode
    repositories: Optional[list["RepositoryResourceConfigInput"]] = None
    databases: Optional[list["DatabaseResourceConfigInput"]] = None
    mcp_server_configs: Optional["McpServerConfigsInput"] = Field(
        alias="mcpServerConfigs", default=None
    )
    skill_configs: Optional["SkillConfigsInput"] = Field(
        alias="skillConfigs", default=None
    )
    sandbox_provider: Optional[SandboxProvider] = Field(
        alias="sandboxProvider", default=None
    )
    cloud_agent_subtype: Optional[AgentSubtype] = Field(
        alias="cloudAgentSubtype", default=None
    )


class DatabaseResourceConfigInput(BaseModel):
    database_config_uuid: UUID = Field(alias="databaseConfigUuid")


class FileAttachmentInput(BaseModel):
    file: "FileInput"
    content: str


class FileInput(BaseModel):
    file_path: str = Field(alias="filePath")
    working_directory: str = Field(alias="workingDirectory")


class McpServerConfigInput(BaseModel):
    server_name: str = Field(alias="serverName")
    enabled_tools: list[str] = Field(alias="enabledTools")


class McpServerConfigsInput(BaseModel):
    all_servers: Optional[bool] = Field(alias="allServers", default=None)
    server_configs: Optional[list["McpServerConfigInput"]] = Field(
        alias="serverConfigs", default=None
    )


class Prompt(BaseModel):
    message: str
    attachments: list["AttachmentInput"]


class PromptAttachmentInput(BaseModel):
    prompt_name: str = Field(alias="promptName")
    prompt_content: str = Field(alias="promptContent")


class RepositoryInput(BaseModel):
    org_name: str = Field(alias="orgName")
    repo_name: str = Field(alias="repoName")


class RepositoryResourceConfigInput(BaseModel):
    repository_uuid: UUID = Field(alias="repositoryUuid")
    is_primary: bool = Field(alias="isPrimary", default=False)


class SQLAttachmentInput(BaseModel):
    query_content: str = Field(alias="queryContent")


class SkillAttachmentInput(BaseModel):
    skill_name: str = Field(alias="skillName")


class SkillConfigInput(BaseModel):
    skill_id: str = Field(alias="skillId")


class SkillConfigsInput(BaseModel):
    skill_configs: list["SkillConfigInput"] = Field(alias="skillConfigs")


class TableSchemaAttachmentInput(BaseModel):
    table_name: str = Field(alias="tableName")
    table_schema: Any = Field(alias="tableSchema")


class URLAttachmentInput(BaseModel):
    url: str
    content: str


AttachmentInput.model_rebuild()
ChatInput.model_rebuild()
ChatResourceConfigInput.model_rebuild()
FileAttachmentInput.model_rebuild()
McpServerConfigsInput.model_rebuild()
Prompt.model_rebuild()
SkillConfigsInput.model_rebuild()
