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 0.10.1 (#366)
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
667941aaa8
commit
5e0b1a2b69
@@ -81,6 +81,8 @@ if TYPE_CHECKING:
|
||||
ContentText,
|
||||
ContentTextTypedDict,
|
||||
ContentTypedDict,
|
||||
CostDetails,
|
||||
CostDetailsTypedDict,
|
||||
CreateEmbeddingsData,
|
||||
CreateEmbeddingsDataTypedDict,
|
||||
CreateEmbeddingsGlobals,
|
||||
@@ -117,6 +119,14 @@ if TYPE_CHECKING:
|
||||
CreateGuardrailRequest,
|
||||
CreateGuardrailRequestTypedDict,
|
||||
)
|
||||
from .createimages import (
|
||||
CreateImagesGlobals,
|
||||
CreateImagesGlobalsTypedDict,
|
||||
CreateImagesRequest,
|
||||
CreateImagesRequestTypedDict,
|
||||
CreateImagesResponse,
|
||||
CreateImagesResponseTypedDict,
|
||||
)
|
||||
from .createkeys import (
|
||||
CreateKeysData,
|
||||
CreateKeysDataTypedDict,
|
||||
@@ -290,18 +300,14 @@ if TYPE_CHECKING:
|
||||
GetAppRankingsSort,
|
||||
Subcategory,
|
||||
)
|
||||
from .getbenchmarksartificialanalysis import (
|
||||
GetBenchmarksArtificialAnalysisGlobals,
|
||||
GetBenchmarksArtificialAnalysisGlobalsTypedDict,
|
||||
GetBenchmarksArtificialAnalysisRequest,
|
||||
GetBenchmarksArtificialAnalysisRequestTypedDict,
|
||||
)
|
||||
from .getbenchmarksdesignarena import (
|
||||
from .getbenchmarks import (
|
||||
Arena,
|
||||
GetBenchmarksDesignArenaGlobals,
|
||||
GetBenchmarksDesignArenaGlobalsTypedDict,
|
||||
GetBenchmarksDesignArenaRequest,
|
||||
GetBenchmarksDesignArenaRequestTypedDict,
|
||||
GetBenchmarksGlobals,
|
||||
GetBenchmarksGlobalsTypedDict,
|
||||
GetBenchmarksRequest,
|
||||
GetBenchmarksRequestTypedDict,
|
||||
Source,
|
||||
TaskType,
|
||||
)
|
||||
from .getbyokkey import (
|
||||
GetBYOKKeyGlobals,
|
||||
@@ -400,6 +406,13 @@ if TYPE_CHECKING:
|
||||
GetRankingsDailyRequest,
|
||||
GetRankingsDailyRequestTypedDict,
|
||||
)
|
||||
from .gettaskclassifications import (
|
||||
GetTaskClassificationsGlobals,
|
||||
GetTaskClassificationsGlobalsTypedDict,
|
||||
GetTaskClassificationsRequest,
|
||||
GetTaskClassificationsRequestTypedDict,
|
||||
Window,
|
||||
)
|
||||
from .getuseractivity import (
|
||||
GetUserActivityGlobals,
|
||||
GetUserActivityGlobalsTypedDict,
|
||||
@@ -497,6 +510,18 @@ if TYPE_CHECKING:
|
||||
ListGuardrailsResponse,
|
||||
ListGuardrailsResponseTypedDict,
|
||||
)
|
||||
from .listimagemodelendpoints import (
|
||||
ListImageModelEndpointsGlobals,
|
||||
ListImageModelEndpointsGlobalsTypedDict,
|
||||
ListImageModelEndpointsRequest,
|
||||
ListImageModelEndpointsRequestTypedDict,
|
||||
)
|
||||
from .listimagemodels import (
|
||||
ListImageModelsGlobals,
|
||||
ListImageModelsGlobalsTypedDict,
|
||||
ListImageModelsRequest,
|
||||
ListImageModelsRequestTypedDict,
|
||||
)
|
||||
from .listkeyassignments import (
|
||||
ListKeyAssignmentsGlobals,
|
||||
ListKeyAssignmentsGlobalsTypedDict,
|
||||
@@ -723,6 +748,8 @@ __all__ = [
|
||||
"ContentText",
|
||||
"ContentTextTypedDict",
|
||||
"ContentTypedDict",
|
||||
"CostDetails",
|
||||
"CostDetailsTypedDict",
|
||||
"CreateAudioSpeechGlobals",
|
||||
"CreateAudioSpeechGlobalsTypedDict",
|
||||
"CreateAudioSpeechRequest",
|
||||
@@ -764,6 +791,12 @@ __all__ = [
|
||||
"CreateGuardrailGlobalsTypedDict",
|
||||
"CreateGuardrailRequest",
|
||||
"CreateGuardrailRequestTypedDict",
|
||||
"CreateImagesGlobals",
|
||||
"CreateImagesGlobalsTypedDict",
|
||||
"CreateImagesRequest",
|
||||
"CreateImagesRequestTypedDict",
|
||||
"CreateImagesResponse",
|
||||
"CreateImagesResponseTypedDict",
|
||||
"CreateKeysData",
|
||||
"CreateKeysDataTypedDict",
|
||||
"CreateKeysGlobals",
|
||||
@@ -899,14 +932,10 @@ __all__ = [
|
||||
"GetBYOKKeyGlobalsTypedDict",
|
||||
"GetBYOKKeyRequest",
|
||||
"GetBYOKKeyRequestTypedDict",
|
||||
"GetBenchmarksArtificialAnalysisGlobals",
|
||||
"GetBenchmarksArtificialAnalysisGlobalsTypedDict",
|
||||
"GetBenchmarksArtificialAnalysisRequest",
|
||||
"GetBenchmarksArtificialAnalysisRequestTypedDict",
|
||||
"GetBenchmarksDesignArenaGlobals",
|
||||
"GetBenchmarksDesignArenaGlobalsTypedDict",
|
||||
"GetBenchmarksDesignArenaRequest",
|
||||
"GetBenchmarksDesignArenaRequestTypedDict",
|
||||
"GetBenchmarksGlobals",
|
||||
"GetBenchmarksGlobalsTypedDict",
|
||||
"GetBenchmarksRequest",
|
||||
"GetBenchmarksRequestTypedDict",
|
||||
"GetCreditsData",
|
||||
"GetCreditsDataTypedDict",
|
||||
"GetCreditsGlobals",
|
||||
@@ -969,6 +998,10 @@ __all__ = [
|
||||
"GetRankingsDailyGlobalsTypedDict",
|
||||
"GetRankingsDailyRequest",
|
||||
"GetRankingsDailyRequestTypedDict",
|
||||
"GetTaskClassificationsGlobals",
|
||||
"GetTaskClassificationsGlobalsTypedDict",
|
||||
"GetTaskClassificationsRequest",
|
||||
"GetTaskClassificationsRequestTypedDict",
|
||||
"GetUserActivityGlobals",
|
||||
"GetUserActivityGlobalsTypedDict",
|
||||
"GetUserActivityRequest",
|
||||
@@ -1045,6 +1078,14 @@ __all__ = [
|
||||
"ListGuardrailsRequestTypedDict",
|
||||
"ListGuardrailsResponse",
|
||||
"ListGuardrailsResponseTypedDict",
|
||||
"ListImageModelEndpointsGlobals",
|
||||
"ListImageModelEndpointsGlobalsTypedDict",
|
||||
"ListImageModelEndpointsRequest",
|
||||
"ListImageModelEndpointsRequestTypedDict",
|
||||
"ListImageModelsGlobals",
|
||||
"ListImageModelsGlobalsTypedDict",
|
||||
"ListImageModelsRequest",
|
||||
"ListImageModelsRequestTypedDict",
|
||||
"ListKeyAssignmentsGlobals",
|
||||
"ListKeyAssignmentsGlobalsTypedDict",
|
||||
"ListKeyAssignmentsRequest",
|
||||
@@ -1163,7 +1204,9 @@ __all__ = [
|
||||
"SendChatCompletionRequestRequestTypedDict",
|
||||
"SendChatCompletionRequestResponse",
|
||||
"SendChatCompletionRequestResponseTypedDict",
|
||||
"Source",
|
||||
"Subcategory",
|
||||
"TaskType",
|
||||
"TimeRange",
|
||||
"TimeRangeTypedDict",
|
||||
"TypeImageURL",
|
||||
@@ -1211,6 +1254,7 @@ __all__ = [
|
||||
"Value2",
|
||||
"Value2TypedDict",
|
||||
"ValueType",
|
||||
"Window",
|
||||
"Zdr",
|
||||
]
|
||||
|
||||
@@ -1269,6 +1313,8 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ContentText": ".createembeddings",
|
||||
"ContentTextTypedDict": ".createembeddings",
|
||||
"ContentTypedDict": ".createembeddings",
|
||||
"CostDetails": ".createembeddings",
|
||||
"CostDetailsTypedDict": ".createembeddings",
|
||||
"CreateEmbeddingsData": ".createembeddings",
|
||||
"CreateEmbeddingsDataTypedDict": ".createembeddings",
|
||||
"CreateEmbeddingsGlobals": ".createembeddings",
|
||||
@@ -1302,6 +1348,12 @@ _dynamic_imports: dict[str, str] = {
|
||||
"CreateGuardrailGlobalsTypedDict": ".createguardrail",
|
||||
"CreateGuardrailRequest": ".createguardrail",
|
||||
"CreateGuardrailRequestTypedDict": ".createguardrail",
|
||||
"CreateImagesGlobals": ".createimages",
|
||||
"CreateImagesGlobalsTypedDict": ".createimages",
|
||||
"CreateImagesRequest": ".createimages",
|
||||
"CreateImagesRequestTypedDict": ".createimages",
|
||||
"CreateImagesResponse": ".createimages",
|
||||
"CreateImagesResponseTypedDict": ".createimages",
|
||||
"CreateKeysData": ".createkeys",
|
||||
"CreateKeysDataTypedDict": ".createkeys",
|
||||
"CreateKeysGlobals": ".createkeys",
|
||||
@@ -1435,15 +1487,13 @@ _dynamic_imports: dict[str, str] = {
|
||||
"GetAppRankingsResponseTypedDict": ".getapprankings",
|
||||
"GetAppRankingsSort": ".getapprankings",
|
||||
"Subcategory": ".getapprankings",
|
||||
"GetBenchmarksArtificialAnalysisGlobals": ".getbenchmarksartificialanalysis",
|
||||
"GetBenchmarksArtificialAnalysisGlobalsTypedDict": ".getbenchmarksartificialanalysis",
|
||||
"GetBenchmarksArtificialAnalysisRequest": ".getbenchmarksartificialanalysis",
|
||||
"GetBenchmarksArtificialAnalysisRequestTypedDict": ".getbenchmarksartificialanalysis",
|
||||
"Arena": ".getbenchmarksdesignarena",
|
||||
"GetBenchmarksDesignArenaGlobals": ".getbenchmarksdesignarena",
|
||||
"GetBenchmarksDesignArenaGlobalsTypedDict": ".getbenchmarksdesignarena",
|
||||
"GetBenchmarksDesignArenaRequest": ".getbenchmarksdesignarena",
|
||||
"GetBenchmarksDesignArenaRequestTypedDict": ".getbenchmarksdesignarena",
|
||||
"Arena": ".getbenchmarks",
|
||||
"GetBenchmarksGlobals": ".getbenchmarks",
|
||||
"GetBenchmarksGlobalsTypedDict": ".getbenchmarks",
|
||||
"GetBenchmarksRequest": ".getbenchmarks",
|
||||
"GetBenchmarksRequestTypedDict": ".getbenchmarks",
|
||||
"Source": ".getbenchmarks",
|
||||
"TaskType": ".getbenchmarks",
|
||||
"GetBYOKKeyGlobals": ".getbyokkey",
|
||||
"GetBYOKKeyGlobalsTypedDict": ".getbyokkey",
|
||||
"GetBYOKKeyRequest": ".getbyokkey",
|
||||
@@ -1515,6 +1565,11 @@ _dynamic_imports: dict[str, str] = {
|
||||
"GetRankingsDailyGlobalsTypedDict": ".getrankingsdaily",
|
||||
"GetRankingsDailyRequest": ".getrankingsdaily",
|
||||
"GetRankingsDailyRequestTypedDict": ".getrankingsdaily",
|
||||
"GetTaskClassificationsGlobals": ".gettaskclassifications",
|
||||
"GetTaskClassificationsGlobalsTypedDict": ".gettaskclassifications",
|
||||
"GetTaskClassificationsRequest": ".gettaskclassifications",
|
||||
"GetTaskClassificationsRequestTypedDict": ".gettaskclassifications",
|
||||
"Window": ".gettaskclassifications",
|
||||
"GetUserActivityGlobals": ".getuseractivity",
|
||||
"GetUserActivityGlobalsTypedDict": ".getuseractivity",
|
||||
"GetUserActivityRequest": ".getuseractivity",
|
||||
@@ -1586,6 +1641,14 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ListGuardrailsRequestTypedDict": ".listguardrails",
|
||||
"ListGuardrailsResponse": ".listguardrails",
|
||||
"ListGuardrailsResponseTypedDict": ".listguardrails",
|
||||
"ListImageModelEndpointsGlobals": ".listimagemodelendpoints",
|
||||
"ListImageModelEndpointsGlobalsTypedDict": ".listimagemodelendpoints",
|
||||
"ListImageModelEndpointsRequest": ".listimagemodelendpoints",
|
||||
"ListImageModelEndpointsRequestTypedDict": ".listimagemodelendpoints",
|
||||
"ListImageModelsGlobals": ".listimagemodels",
|
||||
"ListImageModelsGlobalsTypedDict": ".listimagemodels",
|
||||
"ListImageModelsRequest": ".listimagemodels",
|
||||
"ListImageModelsRequestTypedDict": ".listimagemodels",
|
||||
"ListKeyAssignmentsGlobals": ".listkeyassignments",
|
||||
"ListKeyAssignmentsGlobalsTypedDict": ".listkeyassignments",
|
||||
"ListKeyAssignmentsRequest": ".listkeyassignments",
|
||||
|
||||
@@ -344,6 +344,54 @@ class CreateEmbeddingsData(BaseModel):
|
||||
Object = Literal["list",]
|
||||
|
||||
|
||||
class CostDetailsTypedDict(TypedDict):
|
||||
r"""Breakdown of upstream inference costs"""
|
||||
|
||||
upstream_inference_completions_cost: float
|
||||
upstream_inference_prompt_cost: float
|
||||
upstream_inference_cost: NotRequired[Nullable[float]]
|
||||
|
||||
|
||||
class CostDetails(BaseModel):
|
||||
r"""Breakdown of upstream inference costs"""
|
||||
|
||||
upstream_inference_completions_cost: float
|
||||
|
||||
upstream_inference_prompt_cost: float
|
||||
|
||||
upstream_inference_cost: OptionalNullable[float] = UNSET
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["upstream_inference_cost"]
|
||||
nullable_fields = ["upstream_inference_cost"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class PromptTokensDetailsTypedDict(TypedDict):
|
||||
r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."""
|
||||
|
||||
@@ -387,6 +435,10 @@ class CreateEmbeddingsUsageTypedDict(TypedDict):
|
||||
r"""Total number of tokens used"""
|
||||
cost: NotRequired[float]
|
||||
r"""Cost of the request in credits"""
|
||||
cost_details: NotRequired[Nullable[CostDetailsTypedDict]]
|
||||
r"""Breakdown of upstream inference costs"""
|
||||
is_byok: NotRequired[bool]
|
||||
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
||||
prompt_tokens_details: NotRequired[PromptTokensDetailsTypedDict]
|
||||
r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."""
|
||||
|
||||
@@ -403,9 +455,45 @@ class CreateEmbeddingsUsage(BaseModel):
|
||||
cost: Optional[float] = None
|
||||
r"""Cost of the request in credits"""
|
||||
|
||||
cost_details: OptionalNullable[CostDetails] = UNSET
|
||||
r"""Breakdown of upstream inference costs"""
|
||||
|
||||
is_byok: Optional[bool] = None
|
||||
r"""Whether a request was made using a Bring Your Own Key configuration"""
|
||||
|
||||
prompt_tokens_details: Optional[PromptTokensDetails] = None
|
||||
r"""Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included."""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["cost", "cost_details", "is_byok", "prompt_tokens_details"]
|
||||
nullable_fields = ["cost_details"]
|
||||
null_default_fields = []
|
||||
|
||||
serialized = handler(self)
|
||||
|
||||
m = {}
|
||||
|
||||
for n, f in type(self).model_fields.items():
|
||||
k = f.alias or n
|
||||
val = serialized.get(k)
|
||||
serialized.pop(k, None)
|
||||
|
||||
optional_nullable = k in optional_fields and k in nullable_fields
|
||||
is_set = (
|
||||
self.__pydantic_fields_set__.intersection({n})
|
||||
or k in null_default_fields
|
||||
) # pylint: disable=no-member
|
||||
|
||||
if val is not None and val != UNSET_SENTINEL:
|
||||
m[k] = val
|
||||
elif val != UNSET_SENTINEL and (
|
||||
not k in optional_fields or (optional_nullable and is_set)
|
||||
):
|
||||
m[k] = val
|
||||
|
||||
return m
|
||||
|
||||
|
||||
class CreateEmbeddingsResponseBodyTypedDict(TypedDict):
|
||||
r"""Embeddings response containing embedding vectors"""
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.components import (
|
||||
imagegenerationrequest as components_imagegenerationrequest,
|
||||
imagegenerationresponse as components_imagegenerationresponse,
|
||||
imagestreamingresponse as components_imagestreamingresponse,
|
||||
)
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
RequestMetadata,
|
||||
eventstreaming,
|
||||
)
|
||||
import pydantic
|
||||
from typing import Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
class CreateImagesGlobalsTypedDict(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 CreateImagesGlobals(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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class CreateImagesRequestTypedDict(TypedDict):
|
||||
image_generation_request: (
|
||||
components_imagegenerationrequest.ImageGenerationRequestTypedDict
|
||||
)
|
||||
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 CreateImagesRequest(BaseModel):
|
||||
image_generation_request: Annotated[
|
||||
components_imagegenerationrequest.ImageGenerationRequest,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
CreateImagesResponseTypedDict = TypeAliasType(
|
||||
"CreateImagesResponseTypedDict",
|
||||
Union[
|
||||
components_imagegenerationresponse.ImageGenerationResponseTypedDict,
|
||||
Union[
|
||||
eventstreaming.EventStream[
|
||||
components_imagestreamingresponse.ImageStreamingResponseDataTypedDict
|
||||
],
|
||||
eventstreaming.EventStreamAsync[
|
||||
components_imagestreamingresponse.ImageStreamingResponseDataTypedDict
|
||||
],
|
||||
],
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
CreateImagesResponse = TypeAliasType(
|
||||
"CreateImagesResponse",
|
||||
Union[
|
||||
components_imagegenerationresponse.ImageGenerationResponse,
|
||||
Union[
|
||||
eventstreaming.EventStream[
|
||||
components_imagestreamingresponse.ImageStreamingResponseData
|
||||
],
|
||||
eventstreaming.EventStreamAsync[
|
||||
components_imagestreamingresponse.ImageStreamingResponseData
|
||||
],
|
||||
],
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,178 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, UnrecognizedStr
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
QueryParamMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
import pydantic
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetBenchmarksGlobalsTypedDict(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 GetBenchmarksGlobals(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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
Source = Union[
|
||||
Literal[
|
||||
"artificial-analysis",
|
||||
"design-arena",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources."""
|
||||
|
||||
|
||||
TaskType = Union[
|
||||
Literal[
|
||||
"coding",
|
||||
"intelligence",
|
||||
"agentic",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category."""
|
||||
|
||||
|
||||
Arena = Union[
|
||||
Literal[
|
||||
"models",
|
||||
"builders",
|
||||
"agents",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Design Arena only: arena to query. Defaults to `models` when source is `design-arena`."""
|
||||
|
||||
|
||||
class GetBenchmarksRequestTypedDict(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.
|
||||
|
||||
"""
|
||||
source: NotRequired[Source]
|
||||
r"""Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources."""
|
||||
task_type: NotRequired[TaskType]
|
||||
r"""Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category."""
|
||||
arena: NotRequired[Arena]
|
||||
r"""Design Arena only: arena to query. Defaults to `models` when source is `design-arena`."""
|
||||
category: NotRequired[str]
|
||||
r"""Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories."""
|
||||
max_results: NotRequired[int]
|
||||
r"""Maximum number of items to return. When omitted, all matching results are returned."""
|
||||
|
||||
|
||||
class GetBenchmarksRequest(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.
|
||||
|
||||
"""
|
||||
|
||||
source: Annotated[
|
||||
Annotated[Optional[Source], PlainValidator(validate_open_enum(False))],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources."""
|
||||
|
||||
task_type: Annotated[
|
||||
Annotated[Optional[TaskType], PlainValidator(validate_open_enum(False))],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category."""
|
||||
|
||||
arena: Annotated[
|
||||
Annotated[Optional[Arena], PlainValidator(validate_open_enum(False))],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Design Arena only: arena to query. Defaults to `models` when source is `design-arena`."""
|
||||
|
||||
category: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories."""
|
||||
|
||||
max_results: Annotated[
|
||||
Optional[int],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Maximum number of items to return. When omitted, all matching results are returned."""
|
||||
@@ -98,10 +98,12 @@ GetModelsSort = Union[
|
||||
"context-high-to-low",
|
||||
"throughput-high-to-low",
|
||||
"latency-low-to-high",
|
||||
"intelligence-high-to-low",
|
||||
"design-arena-elo-high-to-low",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved."""
|
||||
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved."""
|
||||
|
||||
|
||||
Distillable = Union[
|
||||
@@ -143,7 +145,7 @@ class GetModelsRequestTypedDict(TypedDict):
|
||||
output_modalities: NotRequired[str]
|
||||
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
|
||||
sort: NotRequired[GetModelsSort]
|
||||
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved."""
|
||||
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved."""
|
||||
q: NotRequired[str]
|
||||
r"""Free-text search by model name or slug."""
|
||||
input_modalities: NotRequired[str]
|
||||
@@ -221,7 +223,7 @@ class GetModelsRequest(BaseModel):
|
||||
Annotated[Optional[GetModelsSort], PlainValidator(validate_open_enum(False))],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved."""
|
||||
r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low (Artificial Analysis intelligence index), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved."""
|
||||
|
||||
q: Annotated[
|
||||
Optional[str],
|
||||
|
||||
+15
-44
@@ -1,20 +1,14 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel, UnrecognizedStr
|
||||
from openrouter.utils import (
|
||||
FieldMetadata,
|
||||
HeaderMetadata,
|
||||
QueryParamMetadata,
|
||||
validate_open_enum,
|
||||
)
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||
import pydantic
|
||||
from pydantic.functional_validators import PlainValidator
|
||||
from typing import Literal, Optional, Union
|
||||
from typing import Literal, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetBenchmarksDesignArenaGlobalsTypedDict(TypedDict):
|
||||
class GetTaskClassificationsGlobalsTypedDict(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.
|
||||
@@ -30,7 +24,7 @@ class GetBenchmarksDesignArenaGlobalsTypedDict(TypedDict):
|
||||
"""
|
||||
|
||||
|
||||
class GetBenchmarksDesignArenaGlobals(BaseModel):
|
||||
class GetTaskClassificationsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
@@ -60,18 +54,11 @@ class GetBenchmarksDesignArenaGlobals(BaseModel):
|
||||
"""
|
||||
|
||||
|
||||
Arena = Union[
|
||||
Literal[
|
||||
"models",
|
||||
"builders",
|
||||
"agents",
|
||||
],
|
||||
UnrecognizedStr,
|
||||
]
|
||||
r"""Arena to query. Defaults to `models`."""
|
||||
Window = Literal["7d",]
|
||||
r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported."""
|
||||
|
||||
|
||||
class GetBenchmarksDesignArenaRequestTypedDict(TypedDict):
|
||||
class GetTaskClassificationsRequestTypedDict(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.
|
||||
@@ -85,15 +72,11 @@ class GetBenchmarksDesignArenaRequestTypedDict(TypedDict):
|
||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||
|
||||
"""
|
||||
arena: NotRequired[Arena]
|
||||
r"""Arena to query. Defaults to `models`."""
|
||||
category: NotRequired[str]
|
||||
r"""Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories."""
|
||||
max_results: NotRequired[int]
|
||||
r"""Max results to return: per category when no category filter is applied (1–100, default 50)."""
|
||||
window: NotRequired[Window]
|
||||
r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported."""
|
||||
|
||||
|
||||
class GetBenchmarksDesignArenaRequest(BaseModel):
|
||||
class GetTaskClassificationsRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
@@ -122,20 +105,8 @@ class GetBenchmarksDesignArenaRequest(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
arena: Annotated[
|
||||
Annotated[Optional[Arena], PlainValidator(validate_open_enum(False))],
|
||||
window: Annotated[
|
||||
Optional[Window],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = "models"
|
||||
r"""Arena to query. Defaults to `models`."""
|
||||
|
||||
category: Annotated[
|
||||
Optional[str],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = None
|
||||
r"""Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories."""
|
||||
|
||||
max_results: Annotated[
|
||||
Optional[int],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = 50
|
||||
r"""Max results to return: per category when no category filter is applied (1–100, default 50)."""
|
||||
] = "7d"
|
||||
r"""Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported."""
|
||||
@@ -101,8 +101,10 @@ Provider = Union[
|
||||
"google-ai-studio",
|
||||
"google-vertex",
|
||||
"groq",
|
||||
"heygen",
|
||||
"inception",
|
||||
"inceptron",
|
||||
"inferact-vllm",
|
||||
"inference-net",
|
||||
"infermatic",
|
||||
"inflection",
|
||||
@@ -133,6 +135,7 @@ Provider = Union[
|
||||
"recraft",
|
||||
"reka",
|
||||
"relace",
|
||||
"sakana-ai",
|
||||
"sambanova",
|
||||
"seed",
|
||||
"siliconflow",
|
||||
@@ -140,6 +143,7 @@ Provider = Union[
|
||||
"stepfun",
|
||||
"streamlake",
|
||||
"switchpoint",
|
||||
"tenstorrent",
|
||||
"together",
|
||||
"upstage",
|
||||
"venice",
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
|
||||
import pydantic
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class ListImageModelEndpointsGlobalsTypedDict(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 ListImageModelEndpointsGlobals(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.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class ListImageModelEndpointsRequestTypedDict(TypedDict):
|
||||
author: str
|
||||
r"""Model author/organization"""
|
||||
slug: str
|
||||
r"""Model slug"""
|
||||
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 ListImageModelEndpointsRequest(BaseModel):
|
||||
author: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""Model author/organization"""
|
||||
|
||||
slug: Annotated[
|
||||
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
||||
]
|
||||
r"""Model slug"""
|
||||
|
||||
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.
|
||||
|
||||
"""
|
||||
+5
-13
@@ -2,13 +2,13 @@
|
||||
|
||||
from __future__ import annotations
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata
|
||||
import pydantic
|
||||
from typing import Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
|
||||
class GetBenchmarksArtificialAnalysisGlobalsTypedDict(TypedDict):
|
||||
class ListImageModelsGlobalsTypedDict(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.
|
||||
@@ -24,7 +24,7 @@ class GetBenchmarksArtificialAnalysisGlobalsTypedDict(TypedDict):
|
||||
"""
|
||||
|
||||
|
||||
class GetBenchmarksArtificialAnalysisGlobals(BaseModel):
|
||||
class ListImageModelsGlobals(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
@@ -54,7 +54,7 @@ class GetBenchmarksArtificialAnalysisGlobals(BaseModel):
|
||||
"""
|
||||
|
||||
|
||||
class GetBenchmarksArtificialAnalysisRequestTypedDict(TypedDict):
|
||||
class ListImageModelsRequestTypedDict(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.
|
||||
@@ -68,11 +68,9 @@ class GetBenchmarksArtificialAnalysisRequestTypedDict(TypedDict):
|
||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||
|
||||
"""
|
||||
max_results: NotRequired[int]
|
||||
r"""Max results to return (1–100, default 50)."""
|
||||
|
||||
|
||||
class GetBenchmarksArtificialAnalysisRequest(BaseModel):
|
||||
class ListImageModelsRequest(BaseModel):
|
||||
http_referer: Annotated[
|
||||
Optional[str],
|
||||
pydantic.Field(alias="HTTP-Referer"),
|
||||
@@ -100,9 +98,3 @@ class GetBenchmarksArtificialAnalysisRequest(BaseModel):
|
||||
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
|
||||
|
||||
"""
|
||||
|
||||
max_results: Annotated[
|
||||
Optional[int],
|
||||
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
||||
] = 50
|
||||
r"""Max results to return (1–100, default 50)."""
|
||||
Reference in New Issue
Block a user