Skip to content
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

"Updated error messages in chat history API to provide more user-frie… #7

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions code/backend/api/chat_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ async def list_conversations():

except Exception as e:
logger.exception("Exception in /list")
return (jsonify({"error": str(e)}), 500)
return (jsonify({"error": "Error While listing historical conversations"}), 500)



@bp_chat_history_response.route("/history/rename", methods=["POST"])
Expand Down Expand Up @@ -153,7 +154,7 @@ async def rename_conversation():

except Exception as e:
logger.exception("Exception in /rename")
return (jsonify({"error": str(e)}), 500)
return (jsonify({"error": "Error renaming is fail"}), 500)


@bp_chat_history_response.route("/history/read", methods=["POST"])
Expand Down Expand Up @@ -218,7 +219,7 @@ async def get_conversation():
)
except Exception as e:
logger.exception("Exception in /read")
return (jsonify({"error": str(e)}), 500)
return (jsonify({"error": "Error while fetching history conversation"}), 500)


@bp_chat_history_response.route("/history/delete", methods=["DELETE"])
Expand Down Expand Up @@ -267,7 +268,7 @@ async def delete_conversation():
)
except Exception as e:
logger.exception("Exception in /delete")
return (jsonify({"error": str(e)}), 500)
return (jsonify({"error": "Error while deleting history conversation"}), 500)


@bp_chat_history_response.route("/history/delete_all", methods=["DELETE"])
Expand Down Expand Up @@ -321,7 +322,7 @@ async def delete_all_conversations():

except Exception as e:
logger.exception("Exception in /delete")
return (jsonify({"error": str(e)}), 500)
return (jsonify({"error": "Error while deleting all history conversation"}), 500)


@bp_chat_history_response.route("/history/update", methods=["POST"])
Expand Down Expand Up @@ -413,7 +414,7 @@ async def update_conversation():

except Exception as e:
logger.exception("Exception in /update")
return (jsonify({"error": str(e)}), 500)
return (jsonify({"error": "Error while update the history conversation"}), 500)


@bp_chat_history_response.route("/history/frontend_settings", methods=["GET"])
Expand All @@ -429,7 +430,7 @@ def get_frontend_settings():
return jsonify({"CHAT_HISTORY_ENABLED": chat_history_enabled}), 200
except Exception as e:
logger.exception("Exception in /frontend_settings")
return (jsonify({"error": str(e)}), 500)
return (jsonify({"error": "Error while getting frontend settings"}), 500)


async def generate_title(conversation_messages):
Expand Down
Loading