"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations from .advisorservertoolconfig import ( AdvisorServerToolConfig, AdvisorServerToolConfigTypedDict, ) from openrouter.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer from typing import Literal, Optional from typing_extensions import NotRequired, TypedDict AdvisorServerToolOpenRouterType = Literal["openrouter:advisor",] class AdvisorServerToolOpenRouterTypedDict(TypedDict): r"""OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response. The advisor may run as a sub-agent with its own tools. Include multiple entries to offer several named advisors; at most one entry may omit `name` to act as the default advisor.""" type: AdvisorServerToolOpenRouterType parameters: NotRequired[AdvisorServerToolConfigTypedDict] r"""Configuration for one openrouter:advisor server tool entry.""" class AdvisorServerToolOpenRouter(BaseModel): r"""OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response. The advisor may run as a sub-agent with its own tools. Include multiple entries to offer several named advisors; at most one entry may omit `name` to act as the default advisor.""" type: AdvisorServerToolOpenRouterType parameters: Optional[AdvisorServerToolConfig] = None r"""Configuration for one openrouter:advisor server tool entry.""" @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set(["parameters"]) serialized = handler(self) m = {} for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: m[k] = val return m