Ramja commited on
Commit
3aaa556
·
verified ·
1 Parent(s): 6f46da7

Update app.py

Browse files

Adding suggested prompt instructions

Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -8,7 +8,8 @@ from agents import agent_1, agent_1_instructions
8
  # (Keep Constants as is)
9
  # --- Constants ---
10
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
11
- general_instructions = "/nGive the final answer as concise as possible providing only the answer to the question."
 
12
  # --- Basic Agent Definition ---
13
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
14
  class BasicAgent:
@@ -16,7 +17,7 @@ class BasicAgent:
16
  print("BasicAgent initialized.")
17
  def __call__(self, question: str) -> str:
18
  print(f"Agent received question (first 50 chars): {question[:50]}...")
19
- final_question = model_1_instructions + question + general_instructions
20
  final_answer = agent_1.run(final_question)
21
  print(f"Agent returning fixed answer: {fixed_answer}")
22
  return fixed_answer
 
8
  # (Keep Constants as is)
9
  # --- Constants ---
10
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
11
+ initial_general_instructions "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."
12
+ basic_general_instructions = "/nGive the final answer as concise as possible providing only the answer to the question."
13
  # --- Basic Agent Definition ---
14
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
15
  class BasicAgent:
 
17
  print("BasicAgent initialized.")
18
  def __call__(self, question: str) -> str:
19
  print(f"Agent received question (first 50 chars): {question[:50]}...")
20
+ final_question = initial_general_instructions + model_1_instructions + question + basic_general_instructions
21
  final_answer = agent_1.run(final_question)
22
  print(f"Agent returning fixed answer: {fixed_answer}")
23
  return fixed_answer