Lulube commited on
Commit
8c0bbdd
·
verified ·
1 Parent(s): 98e264d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -22
app.py CHANGED
@@ -151,32 +151,28 @@ class BasicAgent():
151
  try:
152
  prompt = f"""
153
  You are Alfred, an intelligent assistant with access to multiple tools.
154
- To answer questions:
155
- 1. ANALYZE the question to identify the type of task.
156
- 2. USE the appropriate tool:
157
- - For mathematical calculations: use PythonCodeTool
158
- - To read Excel/CSV files: use PythonCodeTool with pandas
159
- - For information retrieval: use DuckDuckGoSearchTool, then VisitWebpageTool if needed or WikipediaSearchTool
160
- - For speech-to-text: use SpeechToTextTool
161
- - For data processing: use PythonCodeTool
162
- - RETURN only the final answer, clearly and concisely.
163
 
164
- If you cannot answer, simply say: "I cannot answer this question."
165
 
166
- Example answers:
167
- - For a calculation or number : "42"
168
- - For a date: "March 15, 2023"
169
- - For a name: "Albert Einstein"
170
- - For a list: "b, e"
171
 
172
- Formatting rules:
173
- - If it's a number, do not use commas or units unless explicitly required.
174
- - If it's a string, do not use articles or abbreviations unless they are part of the correct literal.
175
- - If it's a comma-separated list, return items in correct order like: a, b, c
176
- - Do not add any quotation marks, punctuation, or extra text.
177
- - Do not start your answer with any words. Just give the result.
 
178
 
179
- Here is the question to process: {question}"""
 
 
 
 
 
 
 
 
180
 
181
  # Utiliser Alfred pour traiter la question
182
  response = self.alfred.run(prompt)
 
151
  try:
152
  prompt = f"""
153
  You are Alfred, an intelligent assistant with access to multiple tools.
 
 
 
 
 
 
 
 
 
154
 
155
+ IMPORTANT: You MUST attempt to answer every question. Only say you cannot answer if you truly have no way to help.
156
 
157
+ For the question: "{question}"
 
 
 
 
158
 
159
+ 1. ANALYZE what type of information or calculation is needed
160
+ 2. USE the most appropriate tool:
161
+ - For math/calculations: use PythonInterpreterTool with code
162
+ - For Excel/CSV files: use ExcelToTextTool or PythonInterpreterTool with pandas
163
+ - For web search/facts: use DuckDuckGoSearchTool, then VisitWebpageTool if needed
164
+ - For Wikipedia info: use WikipediaSearchTool
165
+ - For data analysis: use PythonInterpreterTool
166
 
167
+ 3. PROVIDE a direct, concise answer based on your findings
168
+
169
+ Answer format rules:
170
+ - Numbers: just the number (e.g., "42", "3.14")
171
+ - Names: just the name (e.g., "Albert Einstein")
172
+ - Lists: comma-separated (e.g., "a, b, c")
173
+ - No extra text, quotes, or explanations
174
+
175
+ Think step by step and use your tools to find the answer."""
176
 
177
  # Utiliser Alfred pour traiter la question
178
  response = self.alfred.run(prompt)