-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tools + agent #1473
base: main
Are you sure you want to change the base?
Tools + agent #1473
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
{"$set": {"tool_config": data["tool_config"]}}, | ||
) | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 days ago
To fix the problem, we need to ensure that detailed exception messages are not exposed to the user. Instead, we should log the detailed error message on the server and return a generic error message to the user. This can be achieved by modifying the exception handling code to log the error and return a generic message.
- Import the
logging
module to enable logging of error messages. - Replace the current exception handling code to log the error message and return a generic error message to the user.
-
Copy modified line R22 -
Copy modified lines R1827-R1828 -
Copy modified lines R1857-R1858 -
Copy modified lines R1887-R1888
@@ -21,2 +21,3 @@ | ||
from application.tts.google_tts import GoogleTTS | ||
import logging | ||
|
||
@@ -1825,3 +1826,4 @@ | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) | ||
logging.error(f"Error creating tool: {err}") | ||
return make_response(jsonify({"success": False, "error": "An internal error has occurred!"}), 400) | ||
|
||
@@ -1854,3 +1856,4 @@ | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) | ||
logging.error(f"Error updating tool config: {err}") | ||
return make_response(jsonify({"success": False, "error": "An internal error has occurred!"}), 400) | ||
|
||
@@ -1883,3 +1886,4 @@ | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) | ||
logging.error(f"Error updating tool actions: {err}") | ||
return make_response(jsonify({"success": False, "error": "An internal error has occurred!"}), 400) | ||
|
{"$set": {"tool_actions": data["tool_actions"]}}, | ||
) | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 days ago
To fix the problem, we need to ensure that detailed exception messages are not exposed to the end user. Instead, we should log the detailed error message on the server and return a generic error message to the user. This can be achieved by modifying the exception handling blocks to log the error and return a generic message.
- Import the
logging
module to enable logging of error messages. - Replace the return statements in the exception handling blocks to log the error and return a generic error message.
-
Copy modified line R22 -
Copy modified lines R1856-R1857 -
Copy modified lines R1886-R1887 -
Copy modified lines R1941-R1942
@@ -21,2 +21,3 @@ | ||
from application.tts.google_tts import GoogleTTS | ||
import logging | ||
|
||
@@ -1854,3 +1855,4 @@ | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) | ||
logging.error(f"Error updating tool config: {err}") | ||
return make_response(jsonify({"success": False, "error": "An internal error has occurred."}), 400) | ||
|
||
@@ -1883,3 +1885,4 @@ | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) | ||
logging.error(f"Error updating tool actions: {err}") | ||
return make_response(jsonify({"success": False, "error": "An internal error has occurred."}), 400) | ||
|
||
@@ -1937,3 +1940,4 @@ | ||
except Exception as err: | ||
return {"success": False, "error": str(err)}, 400 | ||
logging.error(f"Error deleting tool: {err}") | ||
return {"success": False, "error": "An internal error has occurred."}, 400 | ||
|
{"$set": {"status": data["status"]}}, | ||
) | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 days ago
To fix the problem, we need to ensure that detailed exception messages are not exposed to the user. Instead, we should log the detailed error message on the server and return a generic error message to the user. This can be achieved by modifying the exception handling code to log the error and return a generic message.
- Import the
logging
module to enable logging of error messages. - Replace the current exception handling code to log the error message and return a generic error message to the user.
-
Copy modified line R13 -
Copy modified lines R1884-R1885 -
Copy modified lines R1914-R1915 -
Copy modified lines R1940-R1941
@@ -12,3 +12,3 @@ | ||
from werkzeug.utils import secure_filename | ||
|
||
import logging | ||
from application.api.user.tasks import ingest, ingest_remote | ||
@@ -1883,3 +1883,4 @@ | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) | ||
logging.error(f"Error updating tool actions: {err}") | ||
return make_response(jsonify({"success": False, "error": "An internal error has occurred."}), 400) | ||
|
||
@@ -1912,3 +1913,4 @@ | ||
except Exception as err: | ||
return make_response(jsonify({"success": False, "error": str(err)}), 400) | ||
logging.error(f"Error updating tool status: {err}") | ||
return make_response(jsonify({"success": False, "error": "An internal error has occurred."}), 400) | ||
|
||
@@ -1937,3 +1939,4 @@ | ||
except Exception as err: | ||
return {"success": False, "error": str(err)}, 400 | ||
logging.error(f"Error deleting tool: {err}") | ||
return {"success": False, "error": "An internal error has occurred."}, 400 | ||
|
Tools
They are cool
n/a