mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
updates
This commit is contained in:
@@ -45,6 +45,8 @@ if TYPE_CHECKING:
|
||||
CreateEmbeddingsRequest,
|
||||
CreateEmbeddingsRequestTypedDict,
|
||||
CreateEmbeddingsResponse,
|
||||
CreateEmbeddingsResponseBody,
|
||||
CreateEmbeddingsResponseBodyTypedDict,
|
||||
CreateEmbeddingsResponseTypedDict,
|
||||
Embedding,
|
||||
EmbeddingTypedDict,
|
||||
@@ -98,12 +100,7 @@ if TYPE_CHECKING:
|
||||
ExchangeAuthCodeForAPIKeyResponse,
|
||||
ExchangeAuthCodeForAPIKeyResponseTypedDict,
|
||||
)
|
||||
from .getcredits import (
|
||||
GetCreditsData,
|
||||
GetCreditsDataTypedDict,
|
||||
GetCreditsResponse,
|
||||
GetCreditsResponseTypedDict,
|
||||
)
|
||||
from .getcredits import GetCreditsResponse, GetCreditsResponseTypedDict
|
||||
from .getcurrentkey import (
|
||||
GetCurrentKeyData,
|
||||
GetCurrentKeyDataTypedDict,
|
||||
@@ -219,6 +216,8 @@ __all__ = [
|
||||
"CreateEmbeddingsRequest",
|
||||
"CreateEmbeddingsRequestTypedDict",
|
||||
"CreateEmbeddingsResponse",
|
||||
"CreateEmbeddingsResponseBody",
|
||||
"CreateEmbeddingsResponseBodyTypedDict",
|
||||
"CreateEmbeddingsResponseTypedDict",
|
||||
"CreateKeysData",
|
||||
"CreateKeysDataTypedDict",
|
||||
@@ -243,8 +242,6 @@ __all__ = [
|
||||
"ExchangeAuthCodeForAPIKeyRequestTypedDict",
|
||||
"ExchangeAuthCodeForAPIKeyResponse",
|
||||
"ExchangeAuthCodeForAPIKeyResponseTypedDict",
|
||||
"GetCreditsData",
|
||||
"GetCreditsDataTypedDict",
|
||||
"GetCreditsResponse",
|
||||
"GetCreditsResponseTypedDict",
|
||||
"GetCurrentKeyData",
|
||||
@@ -373,6 +370,8 @@ _dynamic_imports: dict[str, str] = {
|
||||
"CreateEmbeddingsRequest": ".createembeddings",
|
||||
"CreateEmbeddingsRequestTypedDict": ".createembeddings",
|
||||
"CreateEmbeddingsResponse": ".createembeddings",
|
||||
"CreateEmbeddingsResponseBody": ".createembeddings",
|
||||
"CreateEmbeddingsResponseBodyTypedDict": ".createembeddings",
|
||||
"CreateEmbeddingsResponseTypedDict": ".createembeddings",
|
||||
"Embedding": ".createembeddings",
|
||||
"EmbeddingTypedDict": ".createembeddings",
|
||||
@@ -417,8 +416,6 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ExchangeAuthCodeForAPIKeyRequestTypedDict": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyResponse": ".exchangeauthcodeforapikey",
|
||||
"ExchangeAuthCodeForAPIKeyResponseTypedDict": ".exchangeauthcodeforapikey",
|
||||
"GetCreditsData": ".getcredits",
|
||||
"GetCreditsDataTypedDict": ".getcredits",
|
||||
"GetCreditsResponse": ".getcredits",
|
||||
"GetCreditsResponseTypedDict": ".getcredits",
|
||||
"GetCurrentKeyData": ".getcurrentkey",
|
||||
|
||||
@@ -395,7 +395,7 @@ class Usage(BaseModel):
|
||||
cost: Optional[float] = None
|
||||
|
||||
|
||||
class CreateEmbeddingsResponseTypedDict(TypedDict):
|
||||
class CreateEmbeddingsResponseBodyTypedDict(TypedDict):
|
||||
r"""Embedding response"""
|
||||
|
||||
object: Object
|
||||
@@ -405,7 +405,7 @@ class CreateEmbeddingsResponseTypedDict(TypedDict):
|
||||
usage: NotRequired[UsageTypedDict]
|
||||
|
||||
|
||||
class CreateEmbeddingsResponse(BaseModel):
|
||||
class CreateEmbeddingsResponseBody(BaseModel):
|
||||
r"""Embedding response"""
|
||||
|
||||
object: Object
|
||||
@@ -417,3 +417,14 @@ class CreateEmbeddingsResponse(BaseModel):
|
||||
id: Optional[str] = None
|
||||
|
||||
usage: Optional[Usage] = None
|
||||
|
||||
|
||||
CreateEmbeddingsResponseTypedDict = TypeAliasType(
|
||||
"CreateEmbeddingsResponseTypedDict",
|
||||
Union[CreateEmbeddingsResponseBodyTypedDict, str],
|
||||
)
|
||||
|
||||
|
||||
CreateEmbeddingsResponse = TypeAliasType(
|
||||
"CreateEmbeddingsResponse", Union[CreateEmbeddingsResponseBody, str]
|
||||
)
|
||||
|
||||
@@ -5,28 +5,9 @@ from openrouter.types import BaseModel
|
||||
from typing_extensions import TypedDict
|
||||
|
||||
|
||||
class GetCreditsDataTypedDict(TypedDict):
|
||||
total_credits: float
|
||||
r"""Total credits purchased"""
|
||||
total_usage: float
|
||||
r"""Total credits used"""
|
||||
|
||||
|
||||
class GetCreditsData(BaseModel):
|
||||
total_credits: float
|
||||
r"""Total credits purchased"""
|
||||
|
||||
total_usage: float
|
||||
r"""Total credits used"""
|
||||
|
||||
|
||||
class GetCreditsResponseTypedDict(TypedDict):
|
||||
r"""Total credits purchased and used"""
|
||||
|
||||
data: GetCreditsDataTypedDict
|
||||
|
||||
|
||||
class GetCreditsResponse(BaseModel):
|
||||
r"""Total credits purchased and used"""
|
||||
|
||||
data: GetCreditsData
|
||||
|
||||
@@ -38,14 +38,12 @@ GetParametersProvider = Union[
|
||||
"AionLabs",
|
||||
"Alibaba",
|
||||
"Amazon Bedrock",
|
||||
"Amazon Nova",
|
||||
"Anthropic",
|
||||
"Arcee AI",
|
||||
"Arcee",
|
||||
"AtlasCloud",
|
||||
"Avian",
|
||||
"Azure",
|
||||
"BaseTen",
|
||||
"BytePlus",
|
||||
"Black Forest Labs",
|
||||
"Cerebras",
|
||||
"Chutes",
|
||||
@@ -60,7 +58,6 @@ GetParametersProvider = Union[
|
||||
"Fireworks",
|
||||
"Friendli",
|
||||
"GMICloud",
|
||||
"GoPomelo",
|
||||
"Google",
|
||||
"Google AI Studio",
|
||||
"Groq",
|
||||
@@ -91,7 +88,6 @@ GetParametersProvider = Union[
|
||||
"SambaNova",
|
||||
"SiliconFlow",
|
||||
"Stealth",
|
||||
"StreamLake",
|
||||
"Switchpoint",
|
||||
"Targon",
|
||||
"Together",
|
||||
|
||||
@@ -105,7 +105,7 @@ class UpdateKeysRequestBody(BaseModel):
|
||||
class UpdateKeysRequestTypedDict(TypedDict):
|
||||
hash: str
|
||||
r"""The hash identifier of the API key to update"""
|
||||
body: UpdateKeysRequestBodyTypedDict
|
||||
request_body: UpdateKeysRequestBodyTypedDict
|
||||
|
||||
|
||||
class UpdateKeysRequest(BaseModel):
|
||||
@@ -114,7 +114,7 @@ class UpdateKeysRequest(BaseModel):
|
||||
]
|
||||
r"""The hash identifier of the API key to update"""
|
||||
|
||||
body: Annotated[
|
||||
request_body: Annotated[
|
||||
UpdateKeysRequestBody,
|
||||
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user