albertCHY commited on
Commit
f580e59
·
verified ·
1 Parent(s): b3921a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -22,18 +22,21 @@ def gpu_check():
22
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
23
 
24
 
 
25
  class BasicAgent:
26
  def __init__(self):
27
  print("BasicAgent initialized.")
28
  def __call__(self, question: str) -> str:
29
  response = graph.invoke({
30
  "messages": [SystemMessage(content = """
31
- You are a general AI assistant. I will ask you a question.
32
- Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].
33
- YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
34
- 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.
35
- 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.
36
- 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.
 
 
37
  """), HumanMessage(content=question)],
38
  "file_path": None,
39
  "url": None,
@@ -216,4 +219,4 @@ if __name__ == "__main__":
216
  print("-"*(60 + len(" App Starting ")) + "\n")
217
 
218
  print("Launching Gradio Interface for Basic Agent Evaluation...")
219
- demo.launch(debug=True, share=False)
 
22
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
23
 
24
 
25
+
26
  class BasicAgent:
27
  def __init__(self):
28
  print("BasicAgent initialized.")
29
  def __call__(self, question: str) -> str:
30
  response = graph.invoke({
31
  "messages": [SystemMessage(content = """
32
+ You are a helpful assistant tasked with answering questions using a set of tools.
33
+ Now, I will ask you a question. Report your thoughts, and answer in the fewest words possible.
34
+ If the answer is only one word, format it as such, no extra punctuation.
35
+ If your answer is a list, use a comma delimited list. Ex "cornstarch, freshly squeezed lemon juice, granulated sugar" or "Myanmar, Indonesia"
36
+ If your answer is a number, only respond with the number, nothing else.
37
+ DO NOT USE SQUARE BRACKETS IN YOUR ANSWERS UNLESS DIRECTLY STATED.
38
+ DO NOT START YOUR ANSWER WITH "YOUR FINAL ANSWER".
39
+ YOUR ANSWER SHOULD ONLY BE THE ANSWER AND NOTHING ELSE.
40
  """), HumanMessage(content=question)],
41
  "file_path": None,
42
  "url": None,
 
219
  print("-"*(60 + len(" App Starting ")) + "\n")
220
 
221
  print("Launching Gradio Interface for Basic Agent Evaluation...")
222
+ demo.launch(debug=True, share=False)