@@ -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 , encoding : str = "utf-8" ) -> dict :
288
+ def whisper_status (self , whisper_hash : str ) -> dict :
289
289
"""Retrieves the status of the whisper operation from the LLMWhisperer
290
290
API.
291
291
@@ -296,7 +296,6 @@ def whisper_status(self, whisper_hash: str, encoding: str = "utf-8") -> dict:
296
296
297
297
Args:
298
298
whisper_hash (str): The hash of the whisper (returned by whisper method)
299
- encoding (str): The character encoding to use for processing the text. Defaults to "utf-8".
300
299
301
300
Returns:
302
301
dict: A dictionary containing the status of the whisper operation. The keys in the
@@ -314,7 +313,6 @@ def whisper_status(self, whisper_hash: str, encoding: str = "utf-8") -> dict:
314
313
prepared = req .prepare ()
315
314
s = requests .Session ()
316
315
response = s .send (prepared , timeout = self .api_timeout )
317
- response .encoding = encoding
318
316
if response .status_code != 200 :
319
317
err = json .loads (response .text )
320
318
err ["status_code" ] = response .status_code
@@ -323,7 +321,7 @@ def whisper_status(self, whisper_hash: str, encoding: str = "utf-8") -> dict:
323
321
message ["status_code" ] = response .status_code
324
322
return message
325
323
326
- def whisper_retrieve (self , whisper_hash : str ) -> dict :
324
+ def whisper_retrieve (self , whisper_hash : str , encoding : str = "utf-8" ) -> dict :
327
325
"""Retrieves the result of the whisper operation from the LLMWhisperer
328
326
API.
329
327
@@ -334,6 +332,7 @@ def whisper_retrieve(self, whisper_hash: str) -> dict:
334
332
335
333
Args:
336
334
whisper_hash (str): The hash of the whisper operation.
335
+ encoding (str): The character encoding to use for processing the text. Defaults to "utf-8".
337
336
338
337
Returns:
339
338
dict: A dictionary containing the status code and the extracted text from the whisper operation.
@@ -350,6 +349,7 @@ def whisper_retrieve(self, whisper_hash: str) -> dict:
350
349
prepared = req .prepare ()
351
350
s = requests .Session ()
352
351
response = s .send (prepared , timeout = self .api_timeout )
352
+ response .encoding = encoding
353
353
if response .status_code != 200 :
354
354
err = json .loads (response .text )
355
355
err ["status_code" ] = response .status_code
0 commit comments