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.7 (#402)
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
2c673c0ca3
commit
d81cd563db
@@ -63,6 +63,7 @@ if TYPE_CHECKING:
|
||||
CreateAudioTranscriptionsMultipartRequestBodyTypedDict,
|
||||
CreateAudioTranscriptionsMultipartRequestTypedDict,
|
||||
ResponseFormat,
|
||||
TimestampGranularities,
|
||||
)
|
||||
from .createauthkeyscode import (
|
||||
CreateAuthKeysCodeCodeChallengeMethod,
|
||||
@@ -411,10 +412,15 @@ if TYPE_CHECKING:
|
||||
GetPresetVersionRequestTypedDict,
|
||||
)
|
||||
from .getrankingsdaily import (
|
||||
ContextBucket,
|
||||
GetRankingsDailyCategory,
|
||||
GetRankingsDailyGlobals,
|
||||
GetRankingsDailyGlobalsTypedDict,
|
||||
GetRankingsDailyRequest,
|
||||
GetRankingsDailyRequestTypedDict,
|
||||
LanguageType,
|
||||
Modality,
|
||||
Period,
|
||||
)
|
||||
from .gettaskclassifications import (
|
||||
GetTaskClassificationsGlobals,
|
||||
@@ -766,6 +772,7 @@ __all__ = [
|
||||
"ContentText",
|
||||
"ContentTextTypedDict",
|
||||
"ContentTypedDict",
|
||||
"ContextBucket",
|
||||
"CostDetails",
|
||||
"CostDetailsTypedDict",
|
||||
"CreateAudioSpeechGlobals",
|
||||
@@ -1018,6 +1025,7 @@ __all__ = [
|
||||
"GetPresetVersionGlobalsTypedDict",
|
||||
"GetPresetVersionRequest",
|
||||
"GetPresetVersionRequestTypedDict",
|
||||
"GetRankingsDailyCategory",
|
||||
"GetRankingsDailyGlobals",
|
||||
"GetRankingsDailyGlobalsTypedDict",
|
||||
"GetRankingsDailyRequest",
|
||||
@@ -1048,6 +1056,7 @@ __all__ = [
|
||||
"InputTypedDict",
|
||||
"InputUnion",
|
||||
"InputUnionTypedDict",
|
||||
"LanguageType",
|
||||
"ListBYOKKeysGlobals",
|
||||
"ListBYOKKeysGlobalsTypedDict",
|
||||
"ListBYOKKeysRequest",
|
||||
@@ -1200,6 +1209,7 @@ __all__ = [
|
||||
"MetadataTypedDict",
|
||||
"Metric",
|
||||
"MetricTypedDict",
|
||||
"Modality",
|
||||
"Object",
|
||||
"ObjectEmbedding",
|
||||
"Operator",
|
||||
@@ -1207,6 +1217,7 @@ __all__ = [
|
||||
"OperatorTypedDict",
|
||||
"OrderBy",
|
||||
"OrderByTypedDict",
|
||||
"Period",
|
||||
"PromptTokensDetails",
|
||||
"PromptTokensDetailsTypedDict",
|
||||
"Provider",
|
||||
@@ -1240,6 +1251,7 @@ __all__ = [
|
||||
"TaskType",
|
||||
"TimeRange",
|
||||
"TimeRangeTypedDict",
|
||||
"TimestampGranularities",
|
||||
"TypeImageURL",
|
||||
"TypeText",
|
||||
"UpdateBYOKKeyGlobals",
|
||||
@@ -1333,6 +1345,7 @@ _dynamic_imports: dict[str, str] = {
|
||||
"CreateAudioTranscriptionsMultipartRequestBodyTypedDict": ".createaudiotranscriptions_multipart",
|
||||
"CreateAudioTranscriptionsMultipartRequestTypedDict": ".createaudiotranscriptions_multipart",
|
||||
"ResponseFormat": ".createaudiotranscriptions_multipart",
|
||||
"TimestampGranularities": ".createaudiotranscriptions_multipart",
|
||||
"CreateAuthKeysCodeCodeChallengeMethod": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeData": ".createauthkeyscode",
|
||||
"CreateAuthKeysCodeDataTypedDict": ".createauthkeyscode",
|
||||
@@ -1603,10 +1616,15 @@ _dynamic_imports: dict[str, str] = {
|
||||
"GetPresetVersionGlobalsTypedDict": ".getpresetversion",
|
||||
"GetPresetVersionRequest": ".getpresetversion",
|
||||
"GetPresetVersionRequestTypedDict": ".getpresetversion",
|
||||
"ContextBucket": ".getrankingsdaily",
|
||||
"GetRankingsDailyCategory": ".getrankingsdaily",
|
||||
"GetRankingsDailyGlobals": ".getrankingsdaily",
|
||||
"GetRankingsDailyGlobalsTypedDict": ".getrankingsdaily",
|
||||
"GetRankingsDailyRequest": ".getrankingsdaily",
|
||||
"GetRankingsDailyRequestTypedDict": ".getrankingsdaily",
|
||||
"LanguageType": ".getrankingsdaily",
|
||||
"Modality": ".getrankingsdaily",
|
||||
"Period": ".getrankingsdaily",
|
||||
"GetTaskClassificationsGlobals": ".gettaskclassifications",
|
||||
"GetTaskClassificationsGlobalsTypedDict": ".gettaskclassifications",
|
||||
"GetTaskClassificationsRequest": ".gettaskclassifications",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
import io
|
||||
from openrouter.types import BaseModel, UNSET_SENTINEL
|
||||
from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
@@ -11,7 +11,7 @@ from openrouter.utils import (
|
||||
)
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import IO, Literal, Optional, Union
|
||||
from typing import IO, List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
@@ -119,8 +119,23 @@ class CreateAudioTranscriptionsMultipartFile(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
ResponseFormat = Literal["json",]
|
||||
r"""The response format. Only \"json\" is supported."""
|
||||
ResponseFormat = Union[
|
||||
Literal[
|
||||
"json",
|
||||
"verbose_json",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only)."""
|
||||
|
||||
|
||||
TimestampGranularities = Union[
|
||||
Literal[
|
||||
"word",
|
||||
"segment",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartRequestBodyTypedDict(TypedDict):
|
||||
@@ -131,9 +146,11 @@ class CreateAudioTranscriptionsMultipartRequestBodyTypedDict(TypedDict):
|
||||
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."""
|
||||
r"""The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only)."""
|
||||
temperature: NotRequired[float]
|
||||
r"""The sampling temperature."""
|
||||
timestamp_granularities: NotRequired[List[TimestampGranularities]]
|
||||
r"""Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array."""
|
||||
|
||||
|
||||
class CreateAudioTranscriptionsMultipartRequestBody(BaseModel):
|
||||
@@ -152,14 +169,23 @@ class CreateAudioTranscriptionsMultipartRequestBody(BaseModel):
|
||||
response_format: Annotated[
|
||||
Optional[ResponseFormat], FieldMetadata(multipart=True)
|
||||
] = None
|
||||
r"""The response format. Only \"json\" is supported."""
|
||||
r"""The response format. \"json\" (default) returns { text, usage }; \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only)."""
|
||||
|
||||
temperature: Annotated[Optional[float], FieldMetadata(multipart=True)] = None
|
||||
r"""The sampling temperature."""
|
||||
|
||||
timestamp_granularities: Annotated[
|
||||
Optional[List[TimestampGranularities]],
|
||||
pydantic.Field(alias="timestamp_granularities[]"),
|
||||
FieldMetadata(multipart=True),
|
||||
] = None
|
||||
r"""Timestamp detail levels to include when response_format is \"verbose_json\". \"word\" additionally returns word-level timestamps in the words array."""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(["language", "response_format", "temperature"])
|
||||
optional_fields = set(
|
||||
["language", "response_format", "temperature", "timestamp_granularities[]"]
|
||||
)
|
||||
serialized = handler(self)
|
||||
m = {}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, UNSET_SENTINEL
|
||||
from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import Optional
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
@@ -73,6 +73,73 @@ class GetRankingsDailyGlobals(BaseModel):
|
||||
return m
|
||||
|
||||
|
||||
Period = Union[
|
||||
Literal[
|
||||
"day",
|
||||
"week",
|
||||
"month",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries."""
|
||||
|
||||
|
||||
Modality = Union[
|
||||
Literal[
|
||||
"text",
|
||||
"image",
|
||||
"image_output",
|
||||
"audio",
|
||||
"tool_calling",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`."""
|
||||
|
||||
|
||||
ContextBucket = Union[
|
||||
Literal[
|
||||
"1K",
|
||||
"10K",
|
||||
"100K",
|
||||
"1M",
|
||||
"10M",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`."""
|
||||
|
||||
|
||||
GetRankingsDailyCategory = Union[
|
||||
Literal[
|
||||
"programming",
|
||||
"roleplay",
|
||||
"marketing",
|
||||
"marketing/seo",
|
||||
"technology",
|
||||
"science",
|
||||
"translation",
|
||||
"legal",
|
||||
"finance",
|
||||
"health",
|
||||
"trivia",
|
||||
"academia",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`."""
|
||||
|
||||
|
||||
LanguageType = Union[
|
||||
Literal[
|
||||
"natural",
|
||||
"programming",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`."""
|
||||
|
||||
|
||||
class GetRankingsDailyRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
@@ -91,6 +158,16 @@ class GetRankingsDailyRequestTypedDict(TypedDict):
|
||||
r"""Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`."""
|
||||
end_date: NotRequired[str]
|
||||
r"""End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400."""
|
||||
period: NotRequired[Period]
|
||||
r"""Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries."""
|
||||
modality: NotRequired[Modality]
|
||||
r"""Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`."""
|
||||
context_bucket: NotRequired[ContextBucket]
|
||||
r"""Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`."""
|
||||
category: NotRequired[GetRankingsDailyCategory]
|
||||
r"""Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`."""
|
||||
language_type: NotRequired[LanguageType]
|
||||
r"""Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`."""
|
||||
|
||||
|
||||
class GetRankingsDailyRequest(BaseModel):
|
||||
@@ -134,6 +211,36 @@ class GetRankingsDailyRequest(BaseModel):
|
||||
] = None
|
||||
r"""End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400."""
|
||||
|
||||
period: Annotated[
|
||||
Optional[Period],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries."""
|
||||
|
||||
modality: Annotated[
|
||||
Optional[Modality],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`."""
|
||||
|
||||
context_bucket: Annotated[
|
||||
Optional[ContextBucket],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`."""
|
||||
|
||||
category: Annotated[
|
||||
Optional[GetRankingsDailyCategory],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`."""
|
||||
|
||||
language_type: Annotated[
|
||||
Optional[LanguageType],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`."""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(
|
||||
@@ -143,6 +250,11 @@ class GetRankingsDailyRequest(BaseModel):
|
||||
"X-OpenRouter-Categories",
|
||||
"start_date",
|
||||
"end_date",
|
||||
"period",
|
||||
"modality",
|
||||
"context_bucket",
|
||||
"category",
|
||||
"language_type",
|
||||
]
|
||||
)
|
||||
serialized = handler(self)
|
||||
|
||||
Reference in New Issue
Block a user