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

from __future__ import annotations
from .advisornestedtool import AdvisorNestedTool, AdvisorNestedToolTypedDict
from .advisorreasoning import AdvisorReasoning, AdvisorReasoningTypedDict
from openrouter.types import BaseModel
from typing import List, Optional
from typing_extensions import NotRequired, TypedDict


class AdvisorServerToolConfigTypedDict(TypedDict):
    r"""Configuration for one openrouter:advisor server tool entry."""

    forward_transcript: NotRequired[bool]
    r"""When true, the full parent conversation is forwarded to the advisor so it sees the same context the executor does (and the tool-call `prompt`, if given, is appended as a final user turn). When false or omitted, the advisor receives only the `prompt` the executor passes in the tool call."""
    instructions: NotRequired[str]
    r"""System instructions for the advisor sub-agent. When omitted, the advisor responds with no system prompt of its own."""
    max_completion_tokens: NotRequired[int]
    r"""Maximum number of output tokens (including reasoning) the advisor may produce. When omitted, the provider's default applies."""
    max_tool_calls: NotRequired[int]
    r"""Maximum number of tool-calling steps the advisor sub-agent may take during its agentic loop. Capped at 25. Only relevant when the advisor is given tools."""
    model: NotRequired[str]
    r"""Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used. The advisor tool itself cannot be the advisor model."""
    name: NotRequired[str]
    r"""Optional name for this advisor. The model sees one tool per named advisor (and one default for an unnamed entry). Names must be unique across advisor entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars."""
    reasoning: NotRequired[AdvisorReasoningTypedDict]
    r"""Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking."""
    stream: NotRequired[bool]
    r"""When true, the advisor's advice streams incrementally as it is produced. In the Responses API this emits `response.output_text.delta` events targeting the advisor output item; the final `advice` field is still set on the completed item. Has no effect on the Chat Completions API (where the advice arrives only as the final tool result). When false or omitted, the advice arrives only as the final result."""
    temperature: NotRequired[float]
    r"""Sampling temperature forwarded to the advisor call. When omitted, the provider's default applies."""
    tools: NotRequired[List[AdvisorNestedToolTypedDict]]
    r"""Tools the advisor sub-agent may use while forming its advice. The advisor runs as an agentic sub-agent over these tools, then returns its text. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the advisor tool itself."""


class AdvisorServerToolConfig(BaseModel):
    r"""Configuration for one openrouter:advisor server tool entry."""

    forward_transcript: Optional[bool] = None
    r"""When true, the full parent conversation is forwarded to the advisor so it sees the same context the executor does (and the tool-call `prompt`, if given, is appended as a final user turn). When false or omitted, the advisor receives only the `prompt` the executor passes in the tool call."""

    instructions: Optional[str] = None
    r"""System instructions for the advisor sub-agent. When omitted, the advisor responds with no system prompt of its own."""

    max_completion_tokens: Optional[int] = None
    r"""Maximum number of output tokens (including reasoning) the advisor may produce. When omitted, the provider's default applies."""

    max_tool_calls: Optional[int] = None
    r"""Maximum number of tool-calling steps the advisor sub-agent may take during its agentic loop. Capped at 25. Only relevant when the advisor is given tools."""

    model: Optional[str] = None
    r"""Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used. The advisor tool itself cannot be the advisor model."""

    name: Optional[str] = None
    r"""Optional name for this advisor. The model sees one tool per named advisor (and one default for an unnamed entry). Names must be unique across advisor entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars."""

    reasoning: Optional[AdvisorReasoning] = None
    r"""Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking."""

    stream: Optional[bool] = None
    r"""When true, the advisor's advice streams incrementally as it is produced. In the Responses API this emits `response.output_text.delta` events targeting the advisor output item; the final `advice` field is still set on the completed item. Has no effect on the Chat Completions API (where the advice arrives only as the final tool result). When false or omitted, the advice arrives only as the final result."""

    temperature: Optional[float] = None
    r"""Sampling temperature forwarded to the advisor call. When omitted, the provider's default applies."""

    tools: Optional[List[AdvisorNestedTool]] = None
    r"""Tools the advisor sub-agent may use while forming its advice. The advisor runs as an agentic sub-agent over these tools, then returns its text. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the advisor tool itself."""
