mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-01 12:40:23 +08:00
- 35d4e3137846cf3e0a5800e012692818f0dfe309 - b2f10545419cea6b8a12c509f41ec4bd3937af0c - 2dbb7d9612a6e699caa91f334ad105dbde6442ee - 50539a3577b5a7e925b756f6bb87744052701215 - 2cdbe64441ce4435ea0a1ff9127472e815fdaccf - f35bb49a8b788937fa61c0cf4591b14f2bc8b217 - 08a37babde9ad8df5e24e0cd865d3292b1627464 - 7ddc8e1ed230ca489bc11a5e14696c209ea76349 - ad31290f38f3f02627f3e1953f1d7cf3e06159a5 - fb7f764b500618e322f56d49997fbcfaebba7e39 - 4306c032b9b4f3cfefeacdd3d243b0336f3b2f15 GitOrigin-RevId: 35d4e3137846cf3e0a5800e012692818f0dfe309
149 lines
5.0 KiB
Python
149 lines
5.0 KiB
Python
"""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 GetModelsGlobalsTypedDict(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 GetModelsGlobals(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.
|
|
|
|
"""
|
|
|
|
|
|
Category = Union[
|
|
Literal[
|
|
"programming",
|
|
"roleplay",
|
|
"marketing",
|
|
"marketing/seo",
|
|
"technology",
|
|
"science",
|
|
"translation",
|
|
"legal",
|
|
"finance",
|
|
"health",
|
|
"trivia",
|
|
"academia",
|
|
],
|
|
UnrecognizedStr,
|
|
]
|
|
r"""Filter models by use case category"""
|
|
|
|
|
|
class GetModelsRequestTypedDict(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.
|
|
|
|
"""
|
|
category: NotRequired[Category]
|
|
r"""Filter models by use case category"""
|
|
supported_parameters: NotRequired[str]
|
|
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\"."""
|
|
|
|
|
|
class GetModelsRequest(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.
|
|
|
|
"""
|
|
|
|
category: Annotated[
|
|
Annotated[Optional[Category], PlainValidator(validate_open_enum(False))],
|
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
] = None
|
|
r"""Filter models by use case category"""
|
|
|
|
supported_parameters: Annotated[
|
|
Optional[str],
|
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
] = None
|
|
|
|
output_modalities: Annotated[
|
|
Optional[str],
|
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
] = None
|
|
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\"."""
|