mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Fix serialization issue in OpenAILikeError class
This commit is contained in:
parent
d8d8a12b5d
commit
cdcf8ce9f6
2 changed files with 4 additions and 7 deletions
|
@ -4,14 +4,12 @@ import httpx
|
|||
|
||||
|
||||
class OpenAILikeError(Exception):
|
||||
def __init__(self, status_code, message):
|
||||
def __init__(self, status_code, message, request: Optional[httpx.Request] = None, response: Optional[httpx.Response] = None):
|
||||
self.status_code = status_code
|
||||
self.message = message
|
||||
self.request = httpx.Request(method="POST", url="https://www.litellm.ai")
|
||||
self.response = httpx.Response(status_code=status_code, request=self.request)
|
||||
super().__init__(
|
||||
self.message
|
||||
) # Call the base class constructor with the parameters it needs
|
||||
self.request = request
|
||||
self.response = response
|
||||
super().__init__(self.message) # Call the base class constructor with the parameters it needs
|
||||
|
||||
|
||||
class OpenAILikeBase:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue