mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
feat: regenerate SDK with updated OpenAPI spec
Speakeasy regeneration with latest schema changes including type renames and new server tool models.
This commit is contained in:
@@ -15,6 +15,7 @@ if TYPE_CHECKING:
|
||||
BadRequestResponseError,
|
||||
BadRequestResponseErrorData,
|
||||
)
|
||||
from .conflictresponse_error import ConflictResponseError, ConflictResponseErrorData
|
||||
from .edgenetworktimeoutresponse_error import (
|
||||
EdgeNetworkTimeoutResponseError,
|
||||
EdgeNetworkTimeoutResponseErrorData,
|
||||
@@ -69,6 +70,8 @@ __all__ = [
|
||||
"BadGatewayResponseErrorData",
|
||||
"BadRequestResponseError",
|
||||
"BadRequestResponseErrorData",
|
||||
"ConflictResponseError",
|
||||
"ConflictResponseErrorData",
|
||||
"EdgeNetworkTimeoutResponseError",
|
||||
"EdgeNetworkTimeoutResponseErrorData",
|
||||
"ForbiddenResponseError",
|
||||
@@ -104,6 +107,8 @@ _dynamic_imports: dict[str, str] = {
|
||||
"BadGatewayResponseErrorData": ".badgatewayresponse_error",
|
||||
"BadRequestResponseError": ".badrequestresponse_error",
|
||||
"BadRequestResponseErrorData": ".badrequestresponse_error",
|
||||
"ConflictResponseError": ".conflictresponse_error",
|
||||
"ConflictResponseErrorData": ".conflictresponse_error",
|
||||
"EdgeNetworkTimeoutResponseError": ".edgenetworktimeoutresponse_error",
|
||||
"EdgeNetworkTimeoutResponseErrorData": ".edgenetworktimeoutresponse_error",
|
||||
"ForbiddenResponseError": ".forbiddenresponse_error",
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class BadGatewayResponseErrorData(BaseModel):
|
||||
error: components_badgatewayresponseerrordata.BadGatewayResponseErrorData
|
||||
r"""Error data for BadGatewayResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class BadRequestResponseErrorData(BaseModel):
|
||||
error: components_badrequestresponseerrordata.BadRequestResponseErrorData
|
||||
r"""Error data for BadRequestResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from dataclasses import dataclass, field
|
||||
import httpx
|
||||
from openrouter.components import (
|
||||
conflictresponseerrordata as components_conflictresponseerrordata,
|
||||
)
|
||||
from openrouter.errors import OpenRouterError
|
||||
from openrouter.types import BaseModel, OptionalNullable, UNSET
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class ConflictResponseErrorData(BaseModel):
|
||||
error: components_conflictresponseerrordata.ConflictResponseErrorData
|
||||
r"""Error data for ConflictResponse"""
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
@dataclass(unsafe_hash=True)
|
||||
class ConflictResponseError(OpenRouterError):
|
||||
r"""Conflict - Resource conflict or concurrent modification"""
|
||||
|
||||
data: ConflictResponseErrorData = field(hash=False)
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
data: ConflictResponseErrorData,
|
||||
raw_response: httpx.Response,
|
||||
body: Optional[str] = None,
|
||||
):
|
||||
fallback = body or raw_response.text
|
||||
message = str(data.error.message) or fallback
|
||||
super().__init__(message, raw_response, body)
|
||||
object.__setattr__(self, "data", data)
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class EdgeNetworkTimeoutResponseErrorData(BaseModel):
|
||||
error: components_edgenetworktimeoutresponseerrordata.EdgeNetworkTimeoutResponseErrorData
|
||||
r"""Error data for EdgeNetworkTimeoutResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class ForbiddenResponseErrorData(BaseModel):
|
||||
error: components_forbiddenresponseerrordata.ForbiddenResponseErrorData
|
||||
r"""Error data for ForbiddenResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class InternalServerResponseErrorData(BaseModel):
|
||||
error: components_internalserverresponseerrordata.InternalServerResponseErrorData
|
||||
r"""Error data for InternalServerResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class NotFoundResponseErrorData(BaseModel):
|
||||
error: components_notfoundresponseerrordata.NotFoundResponseErrorData
|
||||
r"""Error data for NotFoundResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class PayloadTooLargeResponseErrorData(BaseModel):
|
||||
error: components_payloadtoolargeresponseerrordata.PayloadTooLargeResponseErrorData
|
||||
r"""Error data for PayloadTooLargeResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class PaymentRequiredResponseErrorData(BaseModel):
|
||||
error: components_paymentrequiredresponseerrordata.PaymentRequiredResponseErrorData
|
||||
r"""Error data for PaymentRequiredResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class ProviderOverloadedResponseErrorData(BaseModel):
|
||||
error: components_provideroverloadedresponseerrordata.ProviderOverloadedResponseErrorData
|
||||
r"""Error data for ProviderOverloadedResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class RequestTimeoutResponseErrorData(BaseModel):
|
||||
error: components_requesttimeoutresponseerrordata.RequestTimeoutResponseErrorData
|
||||
r"""Error data for RequestTimeoutResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class ServiceUnavailableResponseErrorData(BaseModel):
|
||||
error: components_serviceunavailableresponseerrordata.ServiceUnavailableResponseErrorData
|
||||
r"""Error data for ServiceUnavailableResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class TooManyRequestsResponseErrorData(BaseModel):
|
||||
error: components_toomanyrequestsresponseerrordata.TooManyRequestsResponseErrorData
|
||||
r"""Error data for TooManyRequestsResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class UnauthorizedResponseErrorData(BaseModel):
|
||||
error: components_unauthorizedresponseerrordata.UnauthorizedResponseErrorData
|
||||
r"""Error data for UnauthorizedResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import Optional
|
||||
class UnprocessableEntityResponseErrorData(BaseModel):
|
||||
error: components_unprocessableentityresponseerrordata.UnprocessableEntityResponseErrorData
|
||||
r"""Error data for UnprocessableEntityResponse"""
|
||||
|
||||
user_id: OptionalNullable[str] = UNSET
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user