mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
fix(fal_ai): carry fal response into content errors
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
ffa1cceb11
commit
eaa6936f13
2 changed files with 8 additions and 0 deletions
|
|
@ -543,6 +543,8 @@ class FalAIVideoConfig(BaseVideoConfig):
|
|||
status_code=raw_response.status_code,
|
||||
message=error,
|
||||
headers=dict(raw_response.headers), # mutable-ok: exception headers require a mutable dictionary
|
||||
request=raw_response.request,
|
||||
response=raw_response,
|
||||
)
|
||||
video_url: Final[str] = self._extract_video_url(_response_data(raw_response))
|
||||
httpx_client: Final[HTTPHandler] = _get_httpx_client()
|
||||
|
|
@ -559,6 +561,8 @@ class FalAIVideoConfig(BaseVideoConfig):
|
|||
status_code=raw_response.status_code,
|
||||
message=error,
|
||||
headers=dict(raw_response.headers), # mutable-ok: exception headers require a mutable dictionary
|
||||
request=raw_response.request,
|
||||
response=raw_response,
|
||||
)
|
||||
video_url: Final[str] = self._extract_video_url(_response_data(raw_response))
|
||||
async_httpx_client: Final[AsyncHTTPHandler] = get_async_httpx_client(llm_provider=LlmProviders.FAL_AI)
|
||||
|
|
|
|||
|
|
@ -435,6 +435,7 @@ class TestFalAIVideoTransformation:
|
|||
|
||||
assert error.value.status_code == 422
|
||||
assert "input.reference_image_urls: Failed to download the file" in error.value.message
|
||||
assert "Failed to download the file" in error.value.response.text
|
||||
|
||||
def test_content_response_surfaces_string_detail_error(self):
|
||||
response: Final = httpx.Response(
|
||||
|
|
@ -448,6 +449,7 @@ class TestFalAIVideoTransformation:
|
|||
|
||||
assert error.value.status_code == 400
|
||||
assert error.value.message == "Request is still in progress"
|
||||
assert "Request is still in progress" in error.value.response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_content_response_surfaces_list_detail_error(self):
|
||||
|
|
@ -469,6 +471,7 @@ class TestFalAIVideoTransformation:
|
|||
|
||||
assert error.value.status_code == 422
|
||||
assert "input.reference_image_urls: Failed to download the file" in error.value.message
|
||||
assert "Failed to download the file" in error.value.response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_content_response_surfaces_string_detail_error(self):
|
||||
|
|
@ -483,6 +486,7 @@ class TestFalAIVideoTransformation:
|
|||
|
||||
assert error.value.status_code == 400
|
||||
assert error.value.message == "Request is still in progress"
|
||||
assert "Request is still in progress" in error.value.response.text
|
||||
|
||||
def test_extract_video_url_surfaces_list_detail_error(self):
|
||||
response: Final = Mock(spec=httpx.Response)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue