naman1102 commited on
Commit
4ad5e89
·
1 Parent(s): c30265f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -201,12 +201,12 @@ def inspect_node(state: AgentState) -> AgentState:
201
 
202
  # Now ask for JSON ONLY (no reasoning, no extra text)
203
  final_prompt = (
204
- "You are a general AI assistant. I will ask you a question. Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string."
205
  "Using only the information above—including the USER_QUESTION, "
206
  "any TOOL_RESULT, and the INTERIM_ANSWER—produce a concise final answer. "
207
  "Return exactly one JSON object and nothing else, in this format:\n\n"
208
  "{\"final_answer\":\"<your final answer>\"}\n"
209
- "Do not include any other words or punctuation outside that JSON."
210
  )
211
  messages_for_llm.append(SystemMessage(content=final_prompt))
212
 
@@ -368,6 +368,7 @@ def respond_to_input(user_input: str, task_id) -> str:
368
  system_msg = SystemMessage(
369
  content=(
370
  "You are an agent orchestrator. Decide whether to use a tool or answer directly.\n"
 
371
  "Tools available:\n"
372
  " • Wikipedia: set {\"wiki_query\":\"<search terms>\"}\n"
373
  " • OCR: set {\"ocr_path\":\"<image path or task_id>\"}\n"
 
201
 
202
  # Now ask for JSON ONLY (no reasoning, no extra text)
203
  final_prompt = (
204
+ "Finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string."
205
  "Using only the information above—including the USER_QUESTION, "
206
  "any TOOL_RESULT, and the INTERIM_ANSWER—produce a concise final answer. "
207
  "Return exactly one JSON object and nothing else, in this format:\n\n"
208
  "{\"final_answer\":\"<your final answer>\"}\n"
209
+ "Do not include any other words or punctuation outside that JSON. if its numbers, dont show the units"
210
  )
211
  messages_for_llm.append(SystemMessage(content=final_prompt))
212
 
 
368
  system_msg = SystemMessage(
369
  content=(
370
  "You are an agent orchestrator. Decide whether to use a tool or answer directly.\n"
371
+ "Try not to use tools so many times. If you think you can answer the question without using a tool, do it Please.\n"
372
  "Tools available:\n"
373
  " • Wikipedia: set {\"wiki_query\":\"<search terms>\"}\n"
374
  " • OCR: set {\"ocr_path\":\"<image path or task_id>\"}\n"