mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
chore: 🐝 Update SDK - Generate (spec change merged) 0.11.18 (#424)
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:
co-authored by
speakeasybot
speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
parent
0ade477fcc
commit
d78ff13303
@@ -8,6 +8,19 @@ if TYPE_CHECKING:
|
||||
from .aabenchmarkentry import AABenchmarkEntry, AABenchmarkEntryTypedDict
|
||||
from .activityitem import ActivityItem, ActivityItemTypedDict
|
||||
from .activityresponse import ActivityResponse, ActivityResponseTypedDict
|
||||
from .additionaltoolsitem import (
|
||||
AdditionalToolsItem,
|
||||
AdditionalToolsItemRole,
|
||||
AdditionalToolsItemTool,
|
||||
AdditionalToolsItemToolFunction,
|
||||
AdditionalToolsItemToolFunctionTypedDict,
|
||||
AdditionalToolsItemToolTypedDict,
|
||||
AdditionalToolsItemToolUnion,
|
||||
AdditionalToolsItemToolUnionTypedDict,
|
||||
AdditionalToolsItemTypeFunction,
|
||||
AdditionalToolsItemTypedDict,
|
||||
TypeAdditionalTools,
|
||||
)
|
||||
from .advisornestedtool import AdvisorNestedTool, AdvisorNestedToolTypedDict
|
||||
from .advisorreasoning import (
|
||||
AdvisorReasoning,
|
||||
@@ -2769,6 +2782,16 @@ __all__ = [
|
||||
"ActivityItemTypedDict",
|
||||
"ActivityResponse",
|
||||
"ActivityResponseTypedDict",
|
||||
"AdditionalToolsItem",
|
||||
"AdditionalToolsItemRole",
|
||||
"AdditionalToolsItemTool",
|
||||
"AdditionalToolsItemToolFunction",
|
||||
"AdditionalToolsItemToolFunctionTypedDict",
|
||||
"AdditionalToolsItemToolTypedDict",
|
||||
"AdditionalToolsItemToolUnion",
|
||||
"AdditionalToolsItemToolUnionTypedDict",
|
||||
"AdditionalToolsItemTypeFunction",
|
||||
"AdditionalToolsItemTypedDict",
|
||||
"AdvisorNestedTool",
|
||||
"AdvisorNestedToolTypedDict",
|
||||
"AdvisorReasoning",
|
||||
@@ -4586,6 +4609,7 @@ __all__ = [
|
||||
"Truncation",
|
||||
"Type",
|
||||
"TypeAdaptive",
|
||||
"TypeAdditionalTools",
|
||||
"TypeAdvisor20260301",
|
||||
"TypeAny",
|
||||
"TypeBash20250124",
|
||||
@@ -4782,6 +4806,17 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ActivityItemTypedDict": ".activityitem",
|
||||
"ActivityResponse": ".activityresponse",
|
||||
"ActivityResponseTypedDict": ".activityresponse",
|
||||
"AdditionalToolsItem": ".additionaltoolsitem",
|
||||
"AdditionalToolsItemRole": ".additionaltoolsitem",
|
||||
"AdditionalToolsItemTool": ".additionaltoolsitem",
|
||||
"AdditionalToolsItemToolFunction": ".additionaltoolsitem",
|
||||
"AdditionalToolsItemToolFunctionTypedDict": ".additionaltoolsitem",
|
||||
"AdditionalToolsItemToolTypedDict": ".additionaltoolsitem",
|
||||
"AdditionalToolsItemToolUnion": ".additionaltoolsitem",
|
||||
"AdditionalToolsItemToolUnionTypedDict": ".additionaltoolsitem",
|
||||
"AdditionalToolsItemTypeFunction": ".additionaltoolsitem",
|
||||
"AdditionalToolsItemTypedDict": ".additionaltoolsitem",
|
||||
"TypeAdditionalTools": ".additionaltoolsitem",
|
||||
"AdvisorNestedTool": ".advisornestedtool",
|
||||
"AdvisorNestedToolTypedDict": ".advisornestedtool",
|
||||
"AdvisorReasoning": ".advisorreasoning",
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from .advisorservertool_openrouter import (
|
||||
AdvisorServerToolOpenRouter,
|
||||
AdvisorServerToolOpenRouterTypedDict,
|
||||
)
|
||||
from .applypatchservertool import ApplyPatchServerTool, ApplyPatchServerToolTypedDict
|
||||
from .applypatchservertool_openrouter import (
|
||||
ApplyPatchServerToolOpenRouter,
|
||||
ApplyPatchServerToolOpenRouterTypedDict,
|
||||
)
|
||||
from .bashservertool import BashServerTool, BashServerToolTypedDict
|
||||
from .chatsearchmodelsservertool import (
|
||||
ChatSearchModelsServerTool,
|
||||
ChatSearchModelsServerToolTypedDict,
|
||||
)
|
||||
from .codeinterpreterservertool import (
|
||||
CodeInterpreterServerTool,
|
||||
CodeInterpreterServerToolTypedDict,
|
||||
)
|
||||
from .codexlocalshelltool import CodexLocalShellTool, CodexLocalShellToolTypedDict
|
||||
from .computeruseservertool import ComputerUseServerTool, ComputerUseServerToolTypedDict
|
||||
from .customtool import CustomTool, CustomToolTypedDict
|
||||
from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict
|
||||
from .filesearchservertool import FileSearchServerTool, FileSearchServerToolTypedDict
|
||||
from .filesservertool import FilesServerTool, FilesServerToolTypedDict
|
||||
from .fusionservertool_openrouter import (
|
||||
FusionServerToolOpenRouter,
|
||||
FusionServerToolOpenRouterTypedDict,
|
||||
)
|
||||
from .imagegenerationservertool import (
|
||||
ImageGenerationServerTool,
|
||||
ImageGenerationServerToolTypedDict,
|
||||
)
|
||||
from .imagegenerationservertool_openrouter import (
|
||||
ImageGenerationServerToolOpenRouter,
|
||||
ImageGenerationServerToolOpenRouterTypedDict,
|
||||
)
|
||||
from .legacy_websearchservertool import (
|
||||
LegacyWebSearchServerTool,
|
||||
LegacyWebSearchServerToolTypedDict,
|
||||
)
|
||||
from .mcpservertool import McpServerTool, McpServerToolTypedDict
|
||||
from .preview_20250311_websearchservertool import (
|
||||
Preview20250311WebSearchServerTool,
|
||||
Preview20250311WebSearchServerToolTypedDict,
|
||||
)
|
||||
from .preview_websearchservertool import (
|
||||
PreviewWebSearchServerTool,
|
||||
PreviewWebSearchServerToolTypedDict,
|
||||
)
|
||||
from .shellservertool import ShellServerTool, ShellServerToolTypedDict
|
||||
from .shellservertool_openrouter import (
|
||||
ShellServerToolOpenRouter,
|
||||
ShellServerToolOpenRouterTypedDict,
|
||||
)
|
||||
from .subagentservertool_openrouter import (
|
||||
SubagentServerToolOpenRouter,
|
||||
SubagentServerToolOpenRouterTypedDict,
|
||||
)
|
||||
from .webfetchservertool import WebFetchServerTool, WebFetchServerToolTypedDict
|
||||
from .websearchservertool import WebSearchServerTool, WebSearchServerToolTypedDict
|
||||
from .websearchservertool_openrouter import (
|
||||
WebSearchServerToolOpenRouter,
|
||||
WebSearchServerToolOpenRouterTypedDict,
|
||||
)
|
||||
from openrouter.types import (
|
||||
BaseModel,
|
||||
Nullable,
|
||||
OptionalNullable,
|
||||
UNSET,
|
||||
UNSET_SENTINEL,
|
||||
UnrecognizedStr,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import ConfigDict, model_serializer
|
||||
from typing import Any, Dict, List, Literal, Union
|
||||
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
AdditionalToolsItemRole = Union[
|
||||
Literal[
|
||||
"unknown",
|
||||
"user",
|
||||
"assistant",
|
||||
"system",
|
||||
"critic",
|
||||
"discriminator",
|
||||
"developer",
|
||||
"tool",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class AdditionalToolsItemToolTypedDict(TypedDict):
|
||||
type: str
|
||||
|
||||
|
||||
class AdditionalToolsItemTool(BaseModel):
|
||||
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
|
||||
|
||||
@property
|
||||
def additional_properties(self):
|
||||
return self.__pydantic_extra__
|
||||
|
||||
@additional_properties.setter
|
||||
def additional_properties(self, value):
|
||||
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
|
||||
|
||||
|
||||
AdditionalToolsItemTypeFunction = Literal["function",]
|
||||
|
||||
|
||||
class AdditionalToolsItemToolFunctionTypedDict(TypedDict):
|
||||
r"""Function tool definition"""
|
||||
|
||||
name: str
|
||||
parameters: Nullable[Dict[str, Nullable[Any]]]
|
||||
type: AdditionalToolsItemTypeFunction
|
||||
description: NotRequired[Nullable[str]]
|
||||
strict: NotRequired[Nullable[bool]]
|
||||
|
||||
|
||||
class AdditionalToolsItemToolFunction(BaseModel):
|
||||
r"""Function tool definition"""
|
||||
|
||||
name: str
|
||||
|
||||
parameters: Nullable[Dict[str, Nullable[Any]]]
|
||||
|
||||
type: AdditionalToolsItemTypeFunction
|
||||
|
||||
description: OptionalNullable[str] = UNSET
|
||||
|
||||
strict: OptionalNullable[bool] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(["description", "strict"])
|
||||
nullable_fields = set(["description", "parameters", "strict"])
|
||||
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
|
||||
|
||||
|
||||
AdditionalToolsItemToolUnionTypedDict = TypeAliasType(
|
||||
"AdditionalToolsItemToolUnionTypedDict",
|
||||
Union[
|
||||
CodexLocalShellToolTypedDict,
|
||||
ApplyPatchServerToolTypedDict,
|
||||
ShellServerToolTypedDict,
|
||||
FusionServerToolOpenRouterTypedDict,
|
||||
ImageGenerationServerToolOpenRouterTypedDict,
|
||||
AdditionalToolsItemToolTypedDict,
|
||||
ShellServerToolOpenRouterTypedDict,
|
||||
CodeInterpreterServerToolTypedDict,
|
||||
BashServerToolTypedDict,
|
||||
ApplyPatchServerToolOpenRouterTypedDict,
|
||||
WebSearchServerToolOpenRouterTypedDict,
|
||||
WebFetchServerToolTypedDict,
|
||||
ChatSearchModelsServerToolTypedDict,
|
||||
FilesServerToolTypedDict,
|
||||
AdvisorServerToolOpenRouterTypedDict,
|
||||
SubagentServerToolOpenRouterTypedDict,
|
||||
DatetimeServerToolTypedDict,
|
||||
CustomToolTypedDict,
|
||||
ComputerUseServerToolTypedDict,
|
||||
AdditionalToolsItemToolFunctionTypedDict,
|
||||
FileSearchServerToolTypedDict,
|
||||
WebSearchServerToolTypedDict,
|
||||
PreviewWebSearchServerToolTypedDict,
|
||||
Preview20250311WebSearchServerToolTypedDict,
|
||||
LegacyWebSearchServerToolTypedDict,
|
||||
McpServerToolTypedDict,
|
||||
ImageGenerationServerToolTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
AdditionalToolsItemToolUnion = TypeAliasType(
|
||||
"AdditionalToolsItemToolUnion",
|
||||
Union[
|
||||
CodexLocalShellTool,
|
||||
ApplyPatchServerTool,
|
||||
ShellServerTool,
|
||||
FusionServerToolOpenRouter,
|
||||
ImageGenerationServerToolOpenRouter,
|
||||
AdditionalToolsItemTool,
|
||||
ShellServerToolOpenRouter,
|
||||
CodeInterpreterServerTool,
|
||||
BashServerTool,
|
||||
ApplyPatchServerToolOpenRouter,
|
||||
WebSearchServerToolOpenRouter,
|
||||
WebFetchServerTool,
|
||||
ChatSearchModelsServerTool,
|
||||
FilesServerTool,
|
||||
AdvisorServerToolOpenRouter,
|
||||
SubagentServerToolOpenRouter,
|
||||
DatetimeServerTool,
|
||||
CustomTool,
|
||||
ComputerUseServerTool,
|
||||
AdditionalToolsItemToolFunction,
|
||||
FileSearchServerTool,
|
||||
WebSearchServerTool,
|
||||
PreviewWebSearchServerTool,
|
||||
Preview20250311WebSearchServerTool,
|
||||
LegacyWebSearchServerTool,
|
||||
McpServerTool,
|
||||
ImageGenerationServerTool,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
TypeAdditionalTools = Literal["additional_tools",]
|
||||
|
||||
|
||||
class AdditionalToolsItemTypedDict(TypedDict):
|
||||
r"""Additional tools made available to the model at this point in the input"""
|
||||
|
||||
role: AdditionalToolsItemRole
|
||||
tools: List[AdditionalToolsItemToolUnionTypedDict]
|
||||
type: TypeAdditionalTools
|
||||
id: NotRequired[Nullable[str]]
|
||||
|
||||
|
||||
class AdditionalToolsItem(BaseModel):
|
||||
r"""Additional tools made available to the model at this point in the input"""
|
||||
|
||||
role: AdditionalToolsItemRole
|
||||
|
||||
tools: List[AdditionalToolsItemToolUnion]
|
||||
|
||||
type: TypeAdditionalTools
|
||||
|
||||
id: OptionalNullable[str] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(["id"])
|
||||
nullable_fields = set(["id"])
|
||||
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
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from .additionaltoolsitem import AdditionalToolsItem, AdditionalToolsItemTypedDict
|
||||
from .applypatchcallitem import ApplyPatchCallItem, ApplyPatchCallItemTypedDict
|
||||
from .applypatchcalloutputitem import (
|
||||
ApplyPatchCallOutputItem,
|
||||
@@ -375,40 +376,41 @@ InputsUnion1TypedDict = TypeAliasType(
|
||||
Union[
|
||||
ItemReferenceItemTypedDict,
|
||||
CompactionItemTypedDict,
|
||||
OutputFileSearchCallItemTypedDict,
|
||||
EasyInputMessageTypedDict,
|
||||
InputMessageItemTypedDict,
|
||||
AdditionalToolsItemTypedDict,
|
||||
OutputImageGenerationCallItemTypedDict,
|
||||
LocalShellCallOutputItemTypedDict,
|
||||
OutputToolSearchServerToolItemTypedDict,
|
||||
OutputFileSearchServerToolItemTypedDict,
|
||||
OutputWebSearchServerToolItemTypedDict,
|
||||
CustomToolCallOutputItemTypedDict,
|
||||
OutputImageGenerationCallItemTypedDict,
|
||||
InputMessageItemTypedDict,
|
||||
EasyInputMessageTypedDict,
|
||||
OutputWebSearchServerToolItemTypedDict,
|
||||
OutputWebSearchCallItemTypedDict,
|
||||
OutputFileSearchCallItemTypedDict,
|
||||
OutputDatetimeItemTypedDict,
|
||||
OutputMcpServerToolItemTypedDict,
|
||||
FunctionCallOutputItemTypedDict,
|
||||
OutputSearchModelsServerToolItemTypedDict,
|
||||
LocalShellCallItemTypedDict,
|
||||
ApplyPatchCallItemTypedDict,
|
||||
McpListToolsItemTypedDict,
|
||||
ApplyPatchCallOutputItemTypedDict,
|
||||
McpApprovalResponseItemTypedDict,
|
||||
OutputBrowserUseServerToolItemTypedDict,
|
||||
McpApprovalRequestItemTypedDict,
|
||||
OutputTextEditorServerToolItemTypedDict,
|
||||
OutputApplyPatchServerToolItemTypedDict,
|
||||
FunctionCallOutputItemTypedDict,
|
||||
LocalShellCallItemTypedDict,
|
||||
McpListToolsItemTypedDict,
|
||||
OutputSearchModelsServerToolItemTypedDict,
|
||||
ApplyPatchCallOutputItemTypedDict,
|
||||
OutputMcpServerToolItemTypedDict,
|
||||
OutputBrowserUseServerToolItemTypedDict,
|
||||
McpApprovalResponseItemTypedDict,
|
||||
OutputTextEditorServerToolItemTypedDict,
|
||||
ApplyPatchCallItemTypedDict,
|
||||
McpApprovalRequestItemTypedDict,
|
||||
OutputCodeInterpreterCallItemTypedDict,
|
||||
OutputMemoryServerToolItemTypedDict,
|
||||
CustomToolCallItemTypedDict,
|
||||
InputsMessageTypedDict,
|
||||
OutputMemoryServerToolItemTypedDict,
|
||||
OutputCustomToolCallItemTypedDict,
|
||||
OutputComputerCallItemTypedDict,
|
||||
ShellCallOutputItemTypedDict,
|
||||
ShellCallItemTypedDict,
|
||||
OutputCodeInterpreterCallItemTypedDict,
|
||||
OutputComputerCallItemTypedDict,
|
||||
OutputBashServerToolItemTypedDict,
|
||||
OutputImageGenerationServerToolItemTypedDict,
|
||||
McpCallItemTypedDict,
|
||||
OutputImageGenerationServerToolItemTypedDict,
|
||||
OutputFunctionCallItemTypedDict,
|
||||
FunctionCallItemTypedDict,
|
||||
OutputFilesServerToolItemTypedDict,
|
||||
@@ -428,40 +430,41 @@ InputsUnion1 = TypeAliasType(
|
||||
Union[
|
||||
ItemReferenceItem,
|
||||
CompactionItem,
|
||||
OutputFileSearchCallItem,
|
||||
EasyInputMessage,
|
||||
InputMessageItem,
|
||||
AdditionalToolsItem,
|
||||
OutputImageGenerationCallItem,
|
||||
LocalShellCallOutputItem,
|
||||
OutputToolSearchServerToolItem,
|
||||
OutputFileSearchServerToolItem,
|
||||
OutputWebSearchServerToolItem,
|
||||
CustomToolCallOutputItem,
|
||||
OutputImageGenerationCallItem,
|
||||
InputMessageItem,
|
||||
EasyInputMessage,
|
||||
OutputWebSearchServerToolItem,
|
||||
OutputWebSearchCallItem,
|
||||
OutputFileSearchCallItem,
|
||||
OutputDatetimeItem,
|
||||
OutputMcpServerToolItem,
|
||||
FunctionCallOutputItem,
|
||||
OutputSearchModelsServerToolItem,
|
||||
LocalShellCallItem,
|
||||
ApplyPatchCallItem,
|
||||
McpListToolsItem,
|
||||
ApplyPatchCallOutputItem,
|
||||
McpApprovalResponseItem,
|
||||
OutputBrowserUseServerToolItem,
|
||||
McpApprovalRequestItem,
|
||||
OutputTextEditorServerToolItem,
|
||||
OutputApplyPatchServerToolItem,
|
||||
FunctionCallOutputItem,
|
||||
LocalShellCallItem,
|
||||
McpListToolsItem,
|
||||
OutputSearchModelsServerToolItem,
|
||||
ApplyPatchCallOutputItem,
|
||||
OutputMcpServerToolItem,
|
||||
OutputBrowserUseServerToolItem,
|
||||
McpApprovalResponseItem,
|
||||
OutputTextEditorServerToolItem,
|
||||
ApplyPatchCallItem,
|
||||
McpApprovalRequestItem,
|
||||
OutputCodeInterpreterCallItem,
|
||||
OutputMemoryServerToolItem,
|
||||
CustomToolCallItem,
|
||||
InputsMessage,
|
||||
OutputMemoryServerToolItem,
|
||||
OutputCustomToolCallItem,
|
||||
OutputComputerCallItem,
|
||||
ShellCallOutputItem,
|
||||
ShellCallItem,
|
||||
OutputCodeInterpreterCallItem,
|
||||
OutputComputerCallItem,
|
||||
OutputBashServerToolItem,
|
||||
OutputImageGenerationServerToolItem,
|
||||
McpCallItem,
|
||||
OutputImageGenerationServerToolItem,
|
||||
OutputFunctionCallItem,
|
||||
FunctionCallItem,
|
||||
OutputFilesServerToolItem,
|
||||
|
||||
Reference in New Issue
Block a user