mirror of
https://github.com/arc53/DocsGPT.git
synced 2026-04-28 21:10:27 +00:00
fix: enhance error logging with exception info across multiple modules
This commit is contained in:
@@ -78,7 +78,7 @@ class GoogleLLM(BaseLLM):
|
||||
logging.info(f"GoogleLLM: Successfully uploaded file, got URI: {file_uri}")
|
||||
files.append({"file_uri": file_uri, "mime_type": mime_type})
|
||||
except Exception as e:
|
||||
logging.error(f"GoogleLLM: Error uploading file: {e}")
|
||||
logging.error(f"GoogleLLM: Error uploading file: {e}", exc_info=True)
|
||||
if 'content' in attachment:
|
||||
prepared_messages[user_message_index]["content"].append({
|
||||
"type": "text",
|
||||
@@ -131,7 +131,7 @@ class GoogleLLM(BaseLLM):
|
||||
|
||||
return file_uri
|
||||
except Exception as e:
|
||||
logging.error(f"Error uploading file to Google AI: {e}")
|
||||
logging.error(f"Error uploading file to Google AI: {e}", exc_info=True)
|
||||
raise
|
||||
|
||||
def _clean_messages_google(self, messages):
|
||||
|
||||
@@ -213,7 +213,7 @@ class OpenAILLM(BaseLLM):
|
||||
}
|
||||
})
|
||||
except Exception as e:
|
||||
logging.error(f"Error processing image attachment: {e}")
|
||||
logging.error(f"Error processing image attachment: {e}", exc_info=True)
|
||||
if 'content' in attachment:
|
||||
prepared_messages[user_message_index]["content"].append({
|
||||
"type": "text",
|
||||
@@ -228,7 +228,7 @@ class OpenAILLM(BaseLLM):
|
||||
"file": {"file_id": file_id}
|
||||
})
|
||||
except Exception as e:
|
||||
logging.error(f"Error uploading PDF to OpenAI: {e}")
|
||||
logging.error(f"Error uploading PDF to OpenAI: {e}", exc_info=True)
|
||||
if 'content' in attachment:
|
||||
prepared_messages[user_message_index]["content"].append({
|
||||
"type": "text",
|
||||
@@ -301,7 +301,7 @@ class OpenAILLM(BaseLLM):
|
||||
|
||||
return file_id
|
||||
except Exception as e:
|
||||
logging.error(f"Error uploading file to OpenAI: {e}")
|
||||
logging.error(f"Error uploading file to OpenAI: {e}", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user