File tree Expand file tree Collapse file tree
src/unstract/llmwhisperer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -353,19 +353,8 @@ def whisper_detail(self, whisper_hash: str) -> Any:
353353 prepared = req .prepare ()
354354 response = self ._send_request (prepared )
355355 if response .status_code != 200 :
356- if not (response .text or "" ).strip ():
357- raise LLMWhispererClientException (
358- "API error: empty response body" , response .status_code
359- )
360- try :
361- err = json .loads (response .text )
362- except json .JSONDecodeError as e :
363- response_preview = response .text [:500 ] + "..." if len (response .text ) > 500 else response .text
364- raise LLMWhispererClientException (
365- f"API error: non-JSON response - { response_preview } " , response .status_code
366- ) from e
367356 err ["status_code" ] = response .status_code
368- raise LLMWhispererClientException (err )
357+ raise LLMWhispererClientException (err , response . status_code )
369358 return json .loads (response .text )
370359
371360 def whisper (
You can’t perform that action at this time.
0 commit comments