a-ge commited on
Commit
1de4b32
·
verified ·
1 Parent(s): b734ddd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -45,7 +45,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
45
  class BasicAgent:
46
  def __init__(self):
47
  model = InferenceClientModel(model_id=model_id, provider="nebius", token=token)
48
- agent = CodeAgent(
49
  tools=[
50
  VisitWebpageTool(),
51
  WebSearchTool(),
@@ -81,7 +81,7 @@ class BasicAgent:
81
  def __call__(self, question: str) -> str:
82
  print(f"Agent received question (first 50 chars): {question[:50]}...")
83
 
84
- answer = agent.run(
85
  f"""You are a general AI assistant.You can use the provided tools and websearch for finding answers. I will ask you a question. Report your thoughts, and finish your 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.
86
  {question}""",
87
  )
 
45
  class BasicAgent:
46
  def __init__(self):
47
  model = InferenceClientModel(model_id=model_id, provider="nebius", token=token)
48
+ self.agent = CodeAgent(
49
  tools=[
50
  VisitWebpageTool(),
51
  WebSearchTool(),
 
81
  def __call__(self, question: str) -> str:
82
  print(f"Agent received question (first 50 chars): {question[:50]}...")
83
 
84
+ answer = self.agent.run(
85
  f"""You are a general AI assistant.You can use the provided tools and websearch for finding answers. I will ask you a question. Report your thoughts, and finish your 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.
86
  {question}""",
87
  )