NitinBot001 commited on
Commit
723a9f5
·
verified ·
1 Parent(s): cca5f39

Update medicine.py

Browse files
Files changed (1) hide show
  1. medicine.py +2 -2
medicine.py CHANGED
@@ -91,10 +91,10 @@ def handle_query():
91
  # 1. Get and validate the request data
92
  form_data = request.form
93
  query = request.json.get('main_query')
94
- if not query:
95
  return jsonify({"error": "Missing 'query' in request"}), 400
96
 
97
- user_query = query
98
  medicine_topic = None
99
 
100
  # 2. Handle File Upload (if provided)
 
91
  # 1. Get and validate the request data
92
  form_data = request.form
93
  query = request.json.get('main_query')
94
+ if not query and not form_data:
95
  return jsonify({"error": "Missing 'query' in request"}), 400
96
 
97
+ user_query = query or form_data.get('query')
98
  medicine_topic = None
99
 
100
  # 2. Handle File Upload (if provided)