naman1102 commited on
Commit
60617d9
·
1 Parent(s): 44b027e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -201,12 +201,13 @@ def inspect_node(state: AgentState) -> AgentState:
201
  # (3) Always show the interim answer
202
  interim = state.get("interim_answer", "")
203
  messages_for_llm.append(SystemMessage(content=f"INTERIM_ANSWER: {interim}"))
204
- messages_for_llm.append(HumanMessage(content="Please write a polished final answer, with no explanation at all."))
205
  # (4) Prompt GPT to produce a polished final answer
206
  prompt = (
207
  "You have the user’s question, any relevant tool results above,"
208
  " and a draft answer (INTERIM_ANSWER).\n"
209
  "Using all of that, write a concise, polished final answer. "
 
210
  "Return exactly:\n"
211
  " {\"final_answer\":\"<your final answer>\"}\n"
212
  "and nothing else.\n"
 
201
  # (3) Always show the interim answer
202
  interim = state.get("interim_answer", "")
203
  messages_for_llm.append(SystemMessage(content=f"INTERIM_ANSWER: {interim}"))
204
+ messages_for_llm.append(SystemMessage(content="Please write a polished final answer, with no explanation at all."))
205
  # (4) Prompt GPT to produce a polished final answer
206
  prompt = (
207
  "You have the user’s question, any relevant tool results above,"
208
  " and a draft answer (INTERIM_ANSWER).\n"
209
  "Using all of that, write a concise, polished final answer. "
210
+ "Do not include any explanation or commentary, just the answer."
211
  "Return exactly:\n"
212
  " {\"final_answer\":\"<your final answer>\"}\n"
213
  "and nothing else.\n"