lakshmivairamani commited on
Commit
69d5ddf
1 Parent(s): 1236a43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -11
app.py CHANGED
@@ -154,7 +154,7 @@ tools = [
154
  Tool(name="DatabaseQuery", func=database_tool, description="Tool to query the database based on the user's question. Only handles questions related to the collegedb schema, including tables such as buildings, classrooms, college, course, faculty, interns, person, section, student, and textbook. Ensure to use only the available fields in these tables.Provide responses with the maximum of 150 words.", tool_choice="required"),
155
  ]
156
 
157
- prompt_template = f"""You are an assistant that helps with database queries, weather information, and document retrieval.
158
 
159
  For ASN-related questions, if the user specifies ASN id. Provide the information like ASN status, expected Receiving Date etc.
160
  For document-related questions, search and retrieve information from the uploaded document.
@@ -179,17 +179,7 @@ max_iterations = 5
179
  iterations = 0
180
 
181
  def answer_question(user_question):
182
- """
183
- This function takes a user question as input and generates a response using an agent executor.
184
- It iterates until a valid response is generated or the maximum number of iterations is reached.
185
-
186
- Parameters:
187
- - user_question (str): The question asked by the user.
188
 
189
-
190
- Returns:
191
- - str: The generated response or an error message if no valid response is generated within the iteration limit.
192
- """
193
  global iterations
194
  iterations = 0
195
 
 
154
  Tool(name="DatabaseQuery", func=database_tool, description="Tool to query the database based on the user's question. Only handles questions related to the collegedb schema, including tables such as buildings, classrooms, college, course, faculty, interns, person, section, student, and textbook. Ensure to use only the available fields in these tables.Provide responses with the maximum of 150 words.", tool_choice="required"),
155
  ]
156
 
157
+ prompt_template = f"""You are an assistant that helps with database queries, ASN API information, and document retrieval.
158
 
159
  For ASN-related questions, if the user specifies ASN id. Provide the information like ASN status, expected Receiving Date etc.
160
  For document-related questions, search and retrieve information from the uploaded document.
 
179
  iterations = 0
180
 
181
  def answer_question(user_question):
 
 
 
 
 
 
182
 
 
 
 
 
183
  global iterations
184
  iterations = 0
185