chore: 🐝 Update SDK - Generate (spec change merged) 0.11.30 (#448)

Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
Co-authored-by: speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2026-07-14 17:53:19 +00:00
committed by GitHub
co-authored by speakeasybot speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
parent a4f0294713
commit 4d4ff3efdd
15 changed files with 169 additions and 128 deletions
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
__version__: str = "0.11.29"
__version__: str = "0.11.30"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
__user_agent__: str = "speakeasy-sdk/python 0.11.29 2.914.0 1.0.0 openrouter"
__user_agent__: str = "speakeasy-sdk/python 0.11.30 2.914.0 1.0.0 openrouter"
try:
if __package__ is not None:
+6 -4
View File
@@ -611,8 +611,6 @@ if TYPE_CHECKING:
ChatUsagePromptTokensDetails,
ChatUsagePromptTokensDetailsTypedDict,
ChatUsageTypedDict,
ServerToolUseDetails,
ServerToolUseDetailsTypedDict,
)
from .chatusermessage import (
ChatUserMessage,
@@ -2423,6 +2421,10 @@ if TYPE_CHECKING:
)
from .searchqualitylevel import SearchQualityLevel
from .security import Security, SecurityTypedDict
from .servertoolusedetails import (
ServerToolUseDetails,
ServerToolUseDetailsTypedDict,
)
from .serviceunavailableresponseerrordata import (
ServiceUnavailableResponseErrorData,
ServiceUnavailableResponseErrorDataTypedDict,
@@ -5331,8 +5333,6 @@ _dynamic_imports: dict[str, str] = {
"ChatUsagePromptTokensDetails": ".chatusage",
"ChatUsagePromptTokensDetailsTypedDict": ".chatusage",
"ChatUsageTypedDict": ".chatusage",
"ServerToolUseDetails": ".chatusage",
"ServerToolUseDetailsTypedDict": ".chatusage",
"ChatUserMessage": ".chatusermessage",
"ChatUserMessageContent": ".chatusermessage",
"ChatUserMessageContentTypedDict": ".chatusermessage",
@@ -6709,6 +6709,8 @@ _dynamic_imports: dict[str, str] = {
"SearchQualityLevel": ".searchqualitylevel",
"Security": ".security",
"SecurityTypedDict": ".security",
"ServerToolUseDetails": ".servertoolusedetails",
"ServerToolUseDetailsTypedDict": ".servertoolusedetails",
"ServiceUnavailableResponseErrorData": ".serviceunavailableresponseerrordata",
"ServiceUnavailableResponseErrorDataTypedDict": ".serviceunavailableresponseerrordata",
"ShellCallItem": ".shellcallitem",
+1 -53
View File
@@ -2,6 +2,7 @@
from __future__ import annotations
from .costdetails import CostDetails, CostDetailsTypedDict
from .servertoolusedetails import ServerToolUseDetails, ServerToolUseDetailsTypedDict
from openrouter.types import (
BaseModel,
Nullable,
@@ -129,59 +130,6 @@ class ChatUsagePromptTokensDetails(BaseModel):
return m
class ServerToolUseDetailsTypedDict(TypedDict):
r"""Usage for server-side tool execution (e.g., web search)"""
tool_calls_executed: NotRequired[Nullable[int]]
r"""Number of OpenRouter server tool calls that executed and produced a result"""
tool_calls_requested: NotRequired[Nullable[int]]
r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."""
web_search_requests: NotRequired[Nullable[int]]
r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."""
class ServerToolUseDetails(BaseModel):
r"""Usage for server-side tool execution (e.g., web search)"""
tool_calls_executed: OptionalNullable[int] = UNSET
r"""Number of OpenRouter server tool calls that executed and produced a result"""
tool_calls_requested: OptionalNullable[int] = UNSET
r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."""
web_search_requests: OptionalNullable[int] = UNSET
r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
["tool_calls_executed", "tool_calls_requested", "web_search_requests"]
)
nullable_fields = set(
["tool_calls_executed", "tool_calls_requested", "web_search_requests"]
)
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))
is_nullable_and_explicitly_set = (
k in nullable_fields
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
)
if val != UNSET_SENTINEL:
if (
val is not None
or k not in optional_fields
or is_nullable_and_explicitly_set
):
m[k] = val
return m
class ChatUsageTypedDict(TypedDict):
r"""Token usage statistics"""
@@ -0,0 +1,65 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing_extensions import NotRequired, TypedDict
class ServerToolUseDetailsTypedDict(TypedDict):
r"""Usage for server-side tool execution (e.g., web search)"""
tool_calls_executed: NotRequired[Nullable[int]]
r"""Number of OpenRouter server tool calls that executed and produced a result."""
tool_calls_requested: NotRequired[Nullable[int]]
r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."""
web_search_requests: NotRequired[Nullable[int]]
r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."""
class ServerToolUseDetails(BaseModel):
r"""Usage for server-side tool execution (e.g., web search)"""
tool_calls_executed: OptionalNullable[int] = UNSET
r"""Number of OpenRouter server tool calls that executed and produced a result."""
tool_calls_requested: OptionalNullable[int] = UNSET
r"""Total number of OpenRouter server-orchestrated tool calls the model requested, across all tool types. Provider-native tools (e.g. native web search) are not counted here."""
web_search_requests: OptionalNullable[int] = UNSET
r"""Number of web searches performed by server-side tools. For server-orchestrated tool calls a web search is also counted in tool_calls_requested; provider-native web search may report web_search_requests only. Do not sum the two."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
["tool_calls_executed", "tool_calls_requested", "web_search_requests"]
)
nullable_fields = set(
["tool_calls_executed", "tool_calls_requested", "web_search_requests"]
)
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))
is_nullable_and_explicitly_set = (
k in nullable_fields
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
)
if val != UNSET_SENTINEL:
if (
val is not None
or k not in optional_fields
or is_nullable_and_explicitly_set
):
m[k] = val
return m
+10 -2
View File
@@ -1,6 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .servertoolusedetails import ServerToolUseDetails, ServerToolUseDetailsTypedDict
from openrouter.types import (
BaseModel,
Nullable,
@@ -109,6 +110,8 @@ class UsageTypedDict(TypedDict):
cost_details: NotRequired[UsageCostDetailsTypedDict]
is_byok: NotRequired[bool]
r"""Whether a request was made using a Bring Your Own Key configuration"""
server_tool_use_details: NotRequired[Nullable[ServerToolUseDetailsTypedDict]]
r"""Usage for server-side tool execution (e.g., web search)"""
class Usage(BaseModel):
@@ -132,10 +135,15 @@ class Usage(BaseModel):
is_byok: Optional[bool] = None
r"""Whether a request was made using a Bring Your Own Key configuration"""
server_tool_use_details: OptionalNullable[ServerToolUseDetails] = UNSET
r"""Usage for server-side tool execution (e.g., web search)"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["cost", "cost_details", "is_byok"])
nullable_fields = set(["cost"])
optional_fields = set(
["cost", "cost_details", "is_byok", "server_tool_use_details"]
)
nullable_fields = set(["cost", "server_tool_use_details"])
serialized = handler(self)
m = {}