AksharaSachin commited on
Commit
2434d18
·
verified ·
1 Parent(s): 277f4a7

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +6 -6
agent.py CHANGED
@@ -73,16 +73,16 @@ def build_agent():
73
  # ))
74
 
75
  system_template = (
76
- "You are a helpful, friendly, and respectful AI assistant. "
77
- "Always address the user politely and answer their questions in a positive manner.\n"
78
- "If you know the answer then respond with:\n"
79
- "Final Answer: [your answer here]\n"
80
- "Always ensure your responses are polite, accurate, and helpful."
81
  )
82
 
83
  def call_model(state: MessagesState):
84
  """Call the LLM with the given state."""
85
- messages = system_template + state["messages"]
86
  response = llm.invoke(messages)
87
  return {"messages" : response}
88
 
 
73
  # ))
74
 
75
  system_template = (
76
+ "You are a helpful assistant tasked with answering questions using a set of tools. "
77
+ """Now, I will ask you a question. Report your thoughts, and finish your answer with the following template:
78
+ FINAL ANSWER: [YOUR FINAL ANSWER].
79
+ 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.
80
+ Your answer should only start with "FINAL ANSWER: ", then follows with the answer. """
81
  )
82
 
83
  def call_model(state: MessagesState):
84
  """Call the LLM with the given state."""
85
+ messages = [SystemMessage(content=system_template)] + state["messages"]
86
  response = llm.invoke(messages)
87
  return {"messages" : response}
88