@@ -169,7 +169,7 @@ def whisper(
169
169
ocr_provider : str = "advanced" ,
170
170
line_splitter_tolerance : float = 0.4 ,
171
171
horizontal_stretch_factor : float = 1.0 ,
172
- encoder = "ISO-8859-1 "
172
+ encoding : str = "utf-8 "
173
173
) -> dict :
174
174
"""
175
175
Sends a request to the LLMWhisperer API to process a document.
@@ -270,7 +270,7 @@ def generate():
270
270
prepared = req .prepare ()
271
271
s = requests .Session ()
272
272
response = s .send (prepared , timeout = self .api_timeout , stream = should_stream )
273
- response .encoding = encoder
273
+ response .encoding = encoding
274
274
if response .status_code != 200 and response .status_code != 202 :
275
275
message = json .loads (response .text )
276
276
message ["status_code" ] = response .status_code
@@ -285,7 +285,7 @@ def generate():
285
285
"whisper_hash" : response .headers ["whisper-hash" ],
286
286
}
287
287
288
- def whisper_status (self , whisper_hash : str ) -> dict :
288
+ def whisper_status (self , whisper_hash : str , encoding : str = "utf-8" ) -> dict :
289
289
"""Retrieves the status of the whisper operation from the LLMWhisperer
290
290
API.
291
291
@@ -313,6 +313,7 @@ def whisper_status(self, whisper_hash: str) -> dict:
313
313
prepared = req .prepare ()
314
314
s = requests .Session ()
315
315
response = s .send (prepared , timeout = self .api_timeout )
316
+ response .encoding = encoding
316
317
if response .status_code != 200 :
317
318
err = json .loads (response .text )
318
319
err ["status_code" ] = response .status_code
0 commit comments