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

from __future__ import annotations
from .filesearchresult import FileSearchResult, FileSearchResultTypedDict
from enum import Enum
import pydantic
from pydantic.functional_validators import AfterValidator
from ragie.types import BaseModel
from ragie.utils import validate_const
from typing import List, Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class FileSearchOutputStatus(str, Enum):
    IN_PROGRESS = "in_progress"
    SEARCHING = "searching"
    INCOMPLETE = "incomplete"
    COMPLETED = "completed"
    FAILED = "failed"


class FileSearchOutputTypedDict(TypedDict):
    id: str
    queries: List[str]
    r"""The queries used to search for files."""
    results: List[FileSearchResultTypedDict]
    r"""The results of the file search tool call."""
    status: NotRequired[FileSearchOutputStatus]
    type: Literal["file_search_call"]


class FileSearchOutput(BaseModel):
    id: str

    queries: List[str]
    r"""The queries used to search for files."""

    results: List[FileSearchResult]
    r"""The results of the file search tool call."""

    status: Optional[FileSearchOutputStatus] = FileSearchOutputStatus.SEARCHING

    TYPE: Annotated[
        Annotated[
            Literal["file_search_call"],
            AfterValidator(validate_const("file_search_call")),
        ],
        pydantic.Field(alias="type"),
    ] = "file_search_call"
