mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
56 lines
2.0 KiB
Python
56 lines
2.0 KiB
Python
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
|
|
from __future__ import annotations
|
|
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL
|
|
import pydantic
|
|
from pydantic import ConfigDict, model_serializer
|
|
from typing import Any, Dict, Optional
|
|
from typing_extensions import NotRequired, TypedDict
|
|
|
|
|
|
class AdvisorNestedToolTypedDict(TypedDict):
|
|
r"""A tool made available to the advisor sub-agent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the advisor has no way to execute them. The advisor tool may not list itself."""
|
|
|
|
type: str
|
|
parameters: NotRequired[Dict[str, Nullable[Any]]]
|
|
|
|
|
|
class AdvisorNestedTool(BaseModel):
|
|
r"""A tool made available to the advisor sub-agent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the advisor has no way to execute them. The advisor tool may not list itself."""
|
|
|
|
model_config = ConfigDict(
|
|
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
)
|
|
__pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)
|
|
|
|
type: str
|
|
|
|
parameters: Optional[Dict[str, Nullable[Any]]] = None
|
|
|
|
@property
|
|
def additional_properties(self):
|
|
return self.__pydantic_extra__
|
|
|
|
@additional_properties.setter
|
|
def additional_properties(self, value):
|
|
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
|
|
|
|
@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))
|
|
serialized.pop(k, serialized.pop(n, None))
|
|
|
|
if val != UNSET_SENTINEL:
|
|
if val is not None or k not in optional_fields:
|
|
m[k] = val
|
|
for k, v in serialized.items():
|
|
m[k] = v
|
|
|
|
return m
|