mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-02 12:50:48 +08:00
first commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from .serializers import unmarshal_json
|
||||
from openrouter import errors
|
||||
|
||||
|
||||
def unmarshal_json_response(
|
||||
typ: Any, http_res: httpx.Response, body: Optional[str] = None
|
||||
) -> Any:
|
||||
if body is None:
|
||||
body = http_res.text
|
||||
try:
|
||||
return unmarshal_json(body, typ)
|
||||
except Exception as e:
|
||||
raise errors.ResponseValidationError(
|
||||
"Response validation failed",
|
||||
http_res,
|
||||
e,
|
||||
body,
|
||||
) from e
|
||||
Reference in New Issue
Block a user