Hari-Prasath-M91 commited on
Commit
472635d
·
1 Parent(s): 5ce5400
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -701,6 +701,7 @@ def generate_sql_from_nl(prompt):
701
  find the one with the closest match to the users query and use only those exact names of Chapers
702
  and Subtopics present in this file to create SQL the query.
703
  - For date related queries, refer today's date {datetime.now().date()}
 
704
 
705
  You will also make sure multiple times that you give an SQL
706
  Query that adheres to the given table structure, and you Output just the SQL query.
@@ -855,9 +856,9 @@ def agent3(query: str = Query(..., description="User's message to the chatbot"))
855
  try:
856
  response = answer_user_query(query)
857
  return {
858
- "chat_response": {
859
- "role": "assistant",
860
- "message": response
861
  }
862
  }
863
  except Exception as e:
 
701
  find the one with the closest match to the users query and use only those exact names of Chapers
702
  and Subtopics present in this file to create SQL the query.
703
  - For date related queries, refer today's date {datetime.now().date()}
704
+ - If the user ask's you general questions, Return a Dummy query like {"SELECT * FROM your_table WHERE FALSE;"}
705
 
706
  You will also make sure multiple times that you give an SQL
707
  Query that adheres to the given table structure, and you Output just the SQL query.
 
856
  try:
857
  response = answer_user_query(query)
858
  return {
859
+ "Chat_History": {
860
+ "User": query,
861
+ "Assistant": response
862
  }
863
  }
864
  except Exception as e: