mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
fixes
This commit is contained in:
+19
-19
@@ -1,7 +1,7 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from .basesdk import BaseSDK
|
||||
from openrouter import errors, models, utils
|
||||
from openrouter import components, errors, operations, utils
|
||||
from openrouter._hooks import HookContext
|
||||
from openrouter.types import OptionalNullable, UNSET
|
||||
from openrouter.utils import get_security_from_env
|
||||
@@ -21,7 +21,7 @@ class Endpoints(BaseSDK):
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> models.ListEndpointsResponse:
|
||||
) -> components.ListEndpointsResponse:
|
||||
r"""List all endpoints for a model
|
||||
|
||||
:param author:
|
||||
@@ -41,7 +41,7 @@ class Endpoints(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = models.ListEndpointsRequest(
|
||||
request = operations.ListEndpointsRequest(
|
||||
author=author,
|
||||
slug=slug,
|
||||
)
|
||||
@@ -77,7 +77,7 @@ class Endpoints(BaseSDK):
|
||||
operation_id="listEndpoints",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(
|
||||
self.sdk_configuration.security, models.Security
|
||||
self.sdk_configuration.security, components.Security
|
||||
),
|
||||
),
|
||||
request=req,
|
||||
@@ -87,9 +87,7 @@ class Endpoints(BaseSDK):
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(
|
||||
models.EndpointsListEndpointsResponse, http_res
|
||||
)
|
||||
return unmarshal_json_response(operations.ListEndpointsResponse, http_res)
|
||||
if utils.match_response(http_res, "404", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.NotFoundResponseErrorData, http_res
|
||||
@@ -122,7 +120,7 @@ class Endpoints(BaseSDK):
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> models.ListEndpointsResponse:
|
||||
) -> components.ListEndpointsResponse:
|
||||
r"""List all endpoints for a model
|
||||
|
||||
:param author:
|
||||
@@ -142,7 +140,7 @@ class Endpoints(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = models.ListEndpointsRequest(
|
||||
request = operations.ListEndpointsRequest(
|
||||
author=author,
|
||||
slug=slug,
|
||||
)
|
||||
@@ -178,7 +176,7 @@ class Endpoints(BaseSDK):
|
||||
operation_id="listEndpoints",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(
|
||||
self.sdk_configuration.security, models.Security
|
||||
self.sdk_configuration.security, components.Security
|
||||
),
|
||||
),
|
||||
request=req,
|
||||
@@ -188,9 +186,7 @@ class Endpoints(BaseSDK):
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(
|
||||
models.EndpointsListEndpointsResponse, http_res
|
||||
)
|
||||
return unmarshal_json_response(operations.ListEndpointsResponse, http_res)
|
||||
if utils.match_response(http_res, "404", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.NotFoundResponseErrorData, http_res
|
||||
@@ -221,7 +217,7 @@ class Endpoints(BaseSDK):
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> List[models.PublicEndpoint]:
|
||||
) -> List[components.PublicEndpoint]:
|
||||
r"""Preview the impact of ZDR on the available endpoints
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -269,7 +265,7 @@ class Endpoints(BaseSDK):
|
||||
operation_id="listEndpointsZdr",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(
|
||||
self.sdk_configuration.security, models.Security
|
||||
self.sdk_configuration.security, components.Security
|
||||
),
|
||||
),
|
||||
request=req,
|
||||
@@ -279,7 +275,9 @@ class Endpoints(BaseSDK):
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(models.ListEndpointsZdrResponse, http_res)
|
||||
return unmarshal_json_response(
|
||||
operations.ListEndpointsZdrResponse, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "500", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.InternalServerResponseErrorData, http_res
|
||||
@@ -305,7 +303,7 @@ class Endpoints(BaseSDK):
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> List[models.PublicEndpoint]:
|
||||
) -> List[components.PublicEndpoint]:
|
||||
r"""Preview the impact of ZDR on the available endpoints
|
||||
|
||||
:param retries: Override the default retry configuration for this method
|
||||
@@ -353,7 +351,7 @@ class Endpoints(BaseSDK):
|
||||
operation_id="listEndpointsZdr",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(
|
||||
self.sdk_configuration.security, models.Security
|
||||
self.sdk_configuration.security, components.Security
|
||||
),
|
||||
),
|
||||
request=req,
|
||||
@@ -363,7 +361,9 @@ class Endpoints(BaseSDK):
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(models.ListEndpointsZdrResponse, http_res)
|
||||
return unmarshal_json_response(
|
||||
operations.ListEndpointsZdrResponse, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "500", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.InternalServerResponseErrorData, http_res
|
||||
|
||||
Reference in New Issue
Block a user