diff --git a/pilot/utils/llm_connection.py b/pilot/utils/llm_connection.py index 8f3e19d..16255c2 100644 --- a/pilot/utils/llm_connection.py +++ b/pilot/utils/llm_connection.py @@ -158,10 +158,9 @@ def retry_on_exception(func): # If the specific error "context_length_exceeded" is present, simply return without retry if isinstance(e, json.JSONDecodeError): # codellama-34b-instruct seems to send incomplete JSON responses - if e.msg == 'Expecting value': - logger.info('Received incomplete JSON response from LLM. Asking for the rest...') - args[0]['function_buffer'] = e.doc - continue + logger.info('Received incomplete JSON response from LLM. Asking for the rest...') + args[0]['function_buffer'] = e.doc + continue elif isinstance(e, ValidationError): function_error_count = 1 if 'function_error' not in args[0] else args[0]['function_error_count'] + 1 args[0]['function_error_count'] = function_error_count