Update agent.py
Browse files
agent.py
CHANGED
@@ -73,16 +73,16 @@ def build_agent():
|
|
73 |
# ))
|
74 |
|
75 |
system_template = (
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
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 |
|