mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-28 04:04:31 +00:00
fix(predibase.py): add better error message
This commit is contained in:
parent
33532716ff
commit
9bd5c20803
1 changed files with 10 additions and 3 deletions
|
@ -487,9 +487,16 @@ class PredibaseChatCompletion(BaseLLM):
|
||||||
self.async_handler = AsyncHTTPHandler(
|
self.async_handler = AsyncHTTPHandler(
|
||||||
timeout=httpx.Timeout(timeout=600.0, connect=5.0)
|
timeout=httpx.Timeout(timeout=600.0, connect=5.0)
|
||||||
)
|
)
|
||||||
response = await self.async_handler.post(
|
try:
|
||||||
api_base, headers=headers, data=json.dumps(data)
|
response = await self.async_handler.post(
|
||||||
)
|
api_base, headers=headers, data=json.dumps(data)
|
||||||
|
)
|
||||||
|
except httpx.HTTPStatusError as e:
|
||||||
|
raise PredibaseError(
|
||||||
|
status_code=e.response.status_code, message=e.response.text
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
raise PredibaseError(status_code=500, message=str(e))
|
||||||
return self.process_response(
|
return self.process_response(
|
||||||
model=model,
|
model=model,
|
||||||
response=response,
|
response=response,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue