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

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


class ParametersTypedDict(TypedDict):
    max_results: NotRequired[int]
    r"""Maximum number of search results to return per search call. Defaults to 5."""
    max_total_results: NotRequired[int]
    r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results."""


class Parameters(BaseModel):
    max_results: Optional[int] = None
    r"""Maximum number of search results to return per search call. Defaults to 5."""

    max_total_results: Optional[int] = None
    r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results."""


WebSearchServerToolOpenRouterType = Literal["openrouter:web_search",]


class WebSearchServerToolOpenRouterTypedDict(TypedDict):
    r"""OpenRouter built-in server tool: searches the web for current information"""

    type: WebSearchServerToolOpenRouterType
    parameters: NotRequired[ParametersTypedDict]


class WebSearchServerToolOpenRouter(BaseModel):
    r"""OpenRouter built-in server tool: searches the web for current information"""

    type: WebSearchServerToolOpenRouterType

    parameters: Optional[Parameters] = None
