mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-07 11:25:29 +08:00
- f35bb49a8b788937fa61c0cf4591b14f2bc8b217 - 08a37babde9ad8df5e24e0cd865d3292b1627464 - 7ddc8e1ed230ca489bc11a5e14696c209ea76349 - ad31290f38f3f02627f3e1953f1d7cf3e06159a5 - fb7f764b500618e322f56d49997fbcfaebba7e39 - 4306c032b9b4f3cfefeacdd3d243b0336f3b2f15 GitOrigin-RevId: f35bb49a8b788937fa61c0cf4591b14f2bc8b217
165 lines
5.5 KiB
Python
165 lines
5.5 KiB
Python
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
|
|
from __future__ import annotations
|
|
from openrouter.components import (
|
|
chatgenerationparams as components_chatgenerationparams,
|
|
chatresponse as components_chatresponse,
|
|
chatstreamingresponsechunk as components_chatstreamingresponsechunk,
|
|
)
|
|
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 SendChatCompletionRequestGlobalsTypedDict(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 SendChatCompletionRequestGlobals(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 SendChatCompletionRequestRequestTypedDict(TypedDict):
|
|
chat_generation_params: (
|
|
components_chatgenerationparams.ChatGenerationParamsTypedDict
|
|
)
|
|
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 SendChatCompletionRequestRequest(BaseModel):
|
|
chat_generation_params: Annotated[
|
|
components_chatgenerationparams.ChatGenerationParams,
|
|
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.
|
|
|
|
"""
|
|
|
|
|
|
class SendChatCompletionRequestResponseBodyTypedDict(TypedDict):
|
|
r"""Successful chat completion response"""
|
|
|
|
data: components_chatstreamingresponsechunk.ChatStreamingResponseChunkTypedDict
|
|
r"""Streaming chat completion chunk"""
|
|
|
|
|
|
class SendChatCompletionRequestResponseBody(BaseModel):
|
|
r"""Successful chat completion response"""
|
|
|
|
data: components_chatstreamingresponsechunk.ChatStreamingResponseChunk
|
|
r"""Streaming chat completion chunk"""
|
|
|
|
|
|
SendChatCompletionRequestResponseTypedDict = TypeAliasType(
|
|
"SendChatCompletionRequestResponseTypedDict",
|
|
Union[
|
|
components_chatresponse.ChatResponseTypedDict,
|
|
Union[
|
|
eventstreaming.EventStream[
|
|
components_chatstreamingresponsechunk.ChatStreamingResponseChunkTypedDict
|
|
],
|
|
eventstreaming.EventStreamAsync[
|
|
components_chatstreamingresponsechunk.ChatStreamingResponseChunkTypedDict
|
|
],
|
|
],
|
|
],
|
|
)
|
|
|
|
|
|
SendChatCompletionRequestResponse = TypeAliasType(
|
|
"SendChatCompletionRequestResponse",
|
|
Union[
|
|
components_chatresponse.ChatResponse,
|
|
Union[
|
|
eventstreaming.EventStream[
|
|
components_chatstreamingresponsechunk.ChatStreamingResponseChunk
|
|
],
|
|
eventstreaming.EventStreamAsync[
|
|
components_chatstreamingresponsechunk.ChatStreamingResponseChunk
|
|
],
|
|
],
|
|
],
|
|
)
|