mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-05 13:10:31 +08:00
chore: 🐝 Update SDK - Generate (spec change merged) 0.11.4 (#396)
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
34403bd422
commit
1e88de8988
@@ -53,6 +53,17 @@ if TYPE_CHECKING:
|
||||
CreateAudioTranscriptionsRequest,
|
||||
CreateAudioTranscriptionsRequestTypedDict,
|
||||
)
|
||||
from .createaudiotranscriptions_multipart import (
|
||||
CreateAudioTranscriptionsMultipartFile,
|
||||
CreateAudioTranscriptionsMultipartFileTypedDict,
|
||||
CreateAudioTranscriptionsMultipartGlobals,
|
||||
CreateAudioTranscriptionsMultipartGlobalsTypedDict,
|
||||
CreateAudioTranscriptionsMultipartRequest,
|
||||
CreateAudioTranscriptionsMultipartRequestBody,
|
||||
CreateAudioTranscriptionsMultipartRequestBodyTypedDict,
|
||||
CreateAudioTranscriptionsMultipartRequestTypedDict,
|
||||
ResponseFormat,
|
||||
)
|
||||
from .createauthkeyscode import (
|
||||
CreateAuthKeysCodeCodeChallengeMethod,
|
||||
CreateAuthKeysCodeData,
|
||||
@@ -707,8 +718,8 @@ if TYPE_CHECKING:
|
||||
UpdateWorkspaceRequestTypedDict,
|
||||
)
|
||||
from .uploadfile import (
|
||||
File,
|
||||
FileTypedDict,
|
||||
UploadFileFile,
|
||||
UploadFileFileTypedDict,
|
||||
UploadFileGlobals,
|
||||
UploadFileGlobalsTypedDict,
|
||||
UploadFileRequest,
|
||||
@@ -763,6 +774,14 @@ __all__ = [
|
||||
"CreateAudioSpeechRequestTypedDict",
|
||||
"CreateAudioTranscriptionsGlobals",
|
||||
"CreateAudioTranscriptionsGlobalsTypedDict",
|
||||
"CreateAudioTranscriptionsMultipartFile",
|
||||
"CreateAudioTranscriptionsMultipartFileTypedDict",
|
||||
"CreateAudioTranscriptionsMultipartGlobals",
|
||||
"CreateAudioTranscriptionsMultipartGlobalsTypedDict",
|
||||
"CreateAudioTranscriptionsMultipartRequest",
|
||||
"CreateAudioTranscriptionsMultipartRequestBody",
|
||||
"CreateAudioTranscriptionsMultipartRequestBodyTypedDict",
|
||||
"CreateAudioTranscriptionsMultipartRequestTypedDict",
|
||||
"CreateAudioTranscriptionsRequest",
|
||||
"CreateAudioTranscriptionsRequestTypedDict",
|
||||
"CreateAuthKeysCodeCodeChallengeMethod",
|
||||
@@ -915,8 +934,6 @@ __all__ = [
|
||||
"ExchangeAuthCodeForAPIKeyRequestTypedDict",
|
||||
"ExchangeAuthCodeForAPIKeyResponse",
|
||||
"ExchangeAuthCodeForAPIKeyResponseTypedDict",
|
||||
"File",
|
||||
"FileTypedDict",
|
||||
"Filter",
|
||||
"FilterTypedDict",
|
||||
"GetAnalyticsMetaData",
|
||||
@@ -1208,6 +1225,7 @@ __all__ = [
|
||||
"RateLimit",
|
||||
"RateLimitTypedDict",
|
||||
"Region",
|
||||
"ResponseFormat",
|
||||
"Result",
|
||||
"ResultTypedDict",
|
||||
"Role",
|
||||
@@ -1251,6 +1269,8 @@ __all__ = [
|
||||
"UpdateWorkspaceGlobalsTypedDict",
|
||||
"UpdateWorkspaceRequest",
|
||||
"UpdateWorkspaceRequestTypedDict",
|
||||
"UploadFileFile",
|
||||
"UploadFileFileTypedDict",
|
||||
"UploadFileGlobals",
|
||||
"UploadFileGlobalsTypedDict",
|
||||
"UploadFileRequest",
|
||||
@@ -1304,6 +1324,15 @@ _dynamic_imports: dict[str, str] = {
|
||||
"CreateAudioTranscriptionsGlobalsTypedDict": ".createaudiotranscriptions",
|
||||
"CreateAudioTranscriptionsRequest": ".createaudiotranscriptions",
|
||||
"CreateAudioTranscriptionsRequestTypedDict": ".createaudiotranscriptions",
|
||||
"CreateAudioTranscriptionsMultipartFile": ".createaudiotranscriptions_multipart",
|
||||
"CreateAudioTranscriptionsMultipartFileTypedDict": ".createaudiotranscriptions_multipart",
|
||||
"CreateAudioTranscriptionsMultipartGlobals": ".createaudiotranscriptions_multipart",
|
||||
"CreateAudioTranscriptionsMultipartGlobalsTypedDict": ".createaudiotranscriptions_multipart",
|
||||
"CreateAudioTranscriptionsMultipartRequest": ".createaudiotranscriptions_multipart",
|
||||
"CreateAudioTranscriptionsMultipartRequestBody": ".createaudiotranscriptions_multipart",
|
||||
"CreateAudioTranscriptionsMultipartRequestBodyTypedDict": ".createaudiotranscriptions_multipart",
|
||||
"CreateAudioTranscriptionsMultipartRequestTypedDict": ".createaudiotranscriptions_multipart",
|
||||
"ResponseFormat": ".createaudiotranscriptions_multipart",
|
||||
"CreateAuthKeysCodeCodeChallengeMethod": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeData": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeDataTypedDict": ".createauthkeyscode",
|
||||
@@ -1805,8 +1834,8 @@ _dynamic_imports: dict[str, str] = {
|
||||
"UpdateWorkspaceGlobalsTypedDict": ".updateworkspace",
|
||||
"UpdateWorkspaceRequest": ".updateworkspace",
|
||||
"UpdateWorkspaceRequestTypedDict": ".updateworkspace",
|
||||
"File": ".uploadfile",
|
||||
"FileTypedDict": ".uploadfile",
|
||||
"UploadFileFile": ".uploadfile",
|
||||
"UploadFileFileTypedDict": ".uploadfile",
|
||||
"UploadFileGlobals": ".uploadfile",
|
||||
"UploadFileGlobalsTypedDict": ".uploadfile",
|
||||
"UploadFileRequest": ".uploadfile",
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
import io
|
||||
from openrouter.types import BaseModel, UNSET_SENTINEL
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
MultipartFormMetadata,
|
||||
RequestMetadata,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import IO, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartGlobalsTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_open_router_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
x_open_router_categories: NotRequired[str]
|
||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
x_open_router_categories: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||
|
||||
"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(
|
||||
["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"]
|
||||
)
|
||||
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
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartFileTypedDict(TypedDict):
|
||||
file_name: str
|
||||
content: Union[bytes, IO[bytes], io.IOBase]
|
||||
content_type: NotRequired[str]
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartFile(BaseModel):
|
||||
file_name: Annotated[
|
||||
str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
|
||||
]
|
||||
|
||||
content: Annotated[
|
||||
Union[bytes, IO[bytes], io.IOBase],
|
||||
pydantic.Field(alias=""),
|
||||
FieldMetadata(multipart=MultipartFormMetadata(content=True)),
|
||||
]
|
||||
|
||||
content_type: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="Content-Type"),
|
||||
FieldMetadata(multipart=True),
|
||||
] = None
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(["contentType"])
|
||||
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
|
||||
|
||||
|
||||
ResponseFormat = Literal["json",]
|
||||
r"""The response format. Only \"json\" is supported."""
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartRequestBodyTypedDict(TypedDict):
|
||||
file: CreateAudioTranscriptionsMultipartFileTypedDict
|
||||
r"""The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio."""
|
||||
model: str
|
||||
r"""The model to use for transcription."""
|
||||
language: NotRequired[str]
|
||||
r"""The language of the input audio (ISO-639-1)."""
|
||||
response_format: NotRequired[ResponseFormat]
|
||||
r"""The response format. Only \"json\" is supported."""
|
||||
temperature: NotRequired[float]
|
||||
r"""The sampling temperature."""
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartRequestBody(BaseModel):
|
||||
file: Annotated[
|
||||
CreateAudioTranscriptionsMultipartFile,
|
||||
FieldMetadata(multipart=MultipartFormMetadata(file=True)),
|
||||
]
|
||||
r"""The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio."""
|
||||
|
||||
model: Annotated[str, FieldMetadata(multipart=True)]
|
||||
r"""The model to use for transcription."""
|
||||
|
||||
language: Annotated[Optional[str], FieldMetadata(multipart=True)] = None
|
||||
r"""The language of the input audio (ISO-639-1)."""
|
||||
|
||||
response_format: Annotated[
|
||||
Optional[ResponseFormat], FieldMetadata(multipart=True)
|
||||
] = None
|
||||
r"""The response format. Only \"json\" is supported."""
|
||||
|
||||
temperature: Annotated[Optional[float], FieldMetadata(multipart=True)] = None
|
||||
r"""The sampling temperature."""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(["language", "response_format", "temperature"])
|
||||
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
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartRequestTypedDict(TypedDict):
|
||||
request_body: CreateAudioTranscriptionsMultipartRequestBodyTypedDict
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
x_open_router_title: NotRequired[str]
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
x_open_router_categories: NotRequired[str]
|
||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartRequest(BaseModel):
|
||||
request_body: Annotated[
|
||||
CreateAudioTranscriptionsMultipartRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")),
|
||||
]
|
||||
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
"""
|
||||
|
||||
x_open_router_title: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-OpenRouter-Title"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
"""
|
||||
|
||||
x_open_router_categories: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="X-OpenRouter-Categories"),
|
||||
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
||||
] = None
|
||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||
|
||||
"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(
|
||||
["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"]
|
||||
)
|
||||
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
|
||||
@@ -80,13 +80,13 @@ class UploadFileGlobals(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
class FileTypedDict(TypedDict):
|
||||
class UploadFileFileTypedDict(TypedDict):
|
||||
file_name: str
|
||||
content: Union[bytes, IO[bytes], io.IOBase]
|
||||
content_type: NotRequired[str]
|
||||
|
||||
|
||||
class File(BaseModel):
|
||||
class UploadFileFile(BaseModel):
|
||||
file_name: Annotated[
|
||||
str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True)
|
||||
]
|
||||
@@ -121,11 +121,13 @@ class File(BaseModel):
|
||||
|
||||
|
||||
class UploadFileRequestBodyTypedDict(TypedDict):
|
||||
file: FileTypedDict
|
||||
file: UploadFileFileTypedDict
|
||||
|
||||
|
||||
class UploadFileRequestBody(BaseModel):
|
||||
file: Annotated[File, FieldMetadata(multipart=MultipartFormMetadata(file=True))]
|
||||
file: Annotated[
|
||||
UploadFileFile, FieldMetadata(multipart=MultipartFormMetadata(file=True))
|
||||
]
|
||||
|
||||
|
||||
class UploadFileRequestTypedDict(TypedDict):
|
||||
|
||||
Reference in New Issue
Block a user