dygoo commited on
Commit
f9b23bf
·
verified ·
1 Parent(s): a645b49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -19,16 +19,21 @@ class BasicAgent:
19
  def __init__(self, model=None, tools=None):
20
  self.model = model
21
  self.tools = tools if tools is not None else []
22
- self.agent = BasicAgent
23
  print("BasicAgent initialized.")
24
 
25
  def __call__(self, question: str) -> str:
26
  print(f"Agent received question (first 50 chars): {question[:50]}...")
27
  # Implement your agent logic here using self.model and self.tools
28
- final_answer = self.agent.run
29
- print(f"Agent returning fixed answer: {fixed_answer}")
30
  return final_answer
31
 
 
 
 
 
 
32
  def run_and_submit_all( profile: gr.OAuthProfile | None):
33
  """
34
  Fetches all questions, runs the BasicAgent on them, submits all answers,
 
19
  def __init__(self, model=None, tools=None):
20
  self.model = model
21
  self.tools = tools if tools is not None else []
22
+ self.history = []
23
  print("BasicAgent initialized.")
24
 
25
  def __call__(self, question: str) -> str:
26
  print(f"Agent received question (first 50 chars): {question[:50]}...")
27
  # Implement your agent logic here using self.model and self.tools
28
+ final_answer = self.process_question(question)
29
+ print(f"Agent returning answer: {final_answer[:50]}...")
30
  return final_answer
31
 
32
+ def _process_question (self, question:str) -> str:
33
+ search_results = search_tool(question) if self.tools and search_tool in self.tools else "No search results available."
34
+ return f"Based on my analysis of '{question}', I found: {search_results[:500]}..."
35
+
36
+
37
  def run_and_submit_all( profile: gr.OAuthProfile | None):
38
  """
39
  Fetches all questions, runs the BasicAgent on them, submits all answers,