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

from __future__ import annotations
from r9s.types import BaseModel
from typing import Any, Dict, Literal
from typing_extensions import TypedDict


SearchResponseEngine = Literal[
    "exa",
    "tavily",
    "google",
]
r"""Search engine used"""


class SearchResponseTypedDict(TypedDict):
    engine: SearchResponseEngine
    r"""Search engine used"""
    result: Dict[str, Any]
    r"""Search results, format depends on the engine used.

    **Exa response format:**
    - requestId: Request ID
    - results: Results array (includes id, title, url, text, publishedDate, author, etc.)
    - searchTime: Search duration

    **Tavily response format:**
    - query: Original query
    - answer: AI-generated summary answer (if enabled)
    - results: Results array (includes title, url, content, score, etc.)
    - response_time: Response time
    - request_id: Request ID

    **Google response format:**
    - items: Results array (includes title, link, snippet, etc.)
    - searchInformation: Search metadata (totalResults, searchTime)

    """


class SearchResponse(BaseModel):
    engine: SearchResponseEngine
    r"""Search engine used"""

    result: Dict[str, Any]
    r"""Search results, format depends on the engine used.

    **Exa response format:**
    - requestId: Request ID
    - results: Results array (includes id, title, url, text, publishedDate, author, etc.)
    - searchTime: Search duration

    **Tavily response format:**
    - query: Original query
    - answer: AI-generated summary answer (if enabled)
    - results: Results array (includes title, url, content, score, etc.)
    - response_time: Response time
    - request_id: Request ID

    **Google response format:**
    - items: Results array (includes title, link, snippet, etc.)
    - searchInformation: Search metadata (totalResults, searchTime)

    """
