Spaces:
Runtime error
Runtime error
lakshmivairamani
commited on
Commit
•
daaea3e
1
Parent(s):
6fbca62
Update app.py
Browse files
app.py
CHANGED
@@ -126,20 +126,20 @@ tools = [
|
|
126 |
|
127 |
Tool(name="WeatherData", func=get_weather_data, description="Tool to get current weather data for a city or country. Handles questions related to current weather conditions in specific cities or countries.", tool_choice="required"),
|
128 |
Tool(name="DocumentData", func=document_data_tool, description="Tool to search and retrieve information from the uploaded document. Provide responses with the maximum of 150 words.", tool_choice="required"),
|
129 |
-
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"),
|
130 |
]
|
131 |
|
132 |
prompt_template = f"""You are an assistant that helps with database queries, weather information, and document retrieval.
|
133 |
|
134 |
For weather-related questions, if the user specifies a city, provide the weather information for that city. If the user specifies a country or does not specify a city, provide the weather information for the specified country or the default location of 'United Arab Emirates'.
|
135 |
For document-related questions, search and retrieve information from the uploaded document.
|
136 |
-
|
137 |
{{agent_scratchpad}}
|
138 |
Question: {{input}}
|
139 |
|
140 |
"""
|
141 |
#{memory.buffer}
|
142 |
-
|
143 |
prompt = ChatPromptTemplate.from_template(prompt_template)
|
144 |
|
145 |
# Initialize the agent with memory
|
|
|
126 |
|
127 |
Tool(name="WeatherData", func=get_weather_data, description="Tool to get current weather data for a city or country. Handles questions related to current weather conditions in specific cities or countries.", tool_choice="required"),
|
128 |
Tool(name="DocumentData", func=document_data_tool, description="Tool to search and retrieve information from the uploaded document. Provide responses with the maximum of 150 words.", tool_choice="required"),
|
129 |
+
#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"),
|
130 |
]
|
131 |
|
132 |
prompt_template = f"""You are an assistant that helps with database queries, weather information, and document retrieval.
|
133 |
|
134 |
For weather-related questions, if the user specifies a city, provide the weather information for that city. If the user specifies a country or does not specify a city, provide the weather information for the specified country or the default location of 'United Arab Emirates'.
|
135 |
For document-related questions, search and retrieve information from the uploaded document.
|
136 |
+
|
137 |
{{agent_scratchpad}}
|
138 |
Question: {{input}}
|
139 |
|
140 |
"""
|
141 |
#{memory.buffer}
|
142 |
+
#For SQL database-related questions, only use the fields available in the collegedb schema, which includes tables such as buildings, classrooms, college, course, faculty, interns, person, section, student, and textbook.
|
143 |
prompt = ChatPromptTemplate.from_template(prompt_template)
|
144 |
|
145 |
# Initialize the agent with memory
|