MariaFilipkowska commited on
Commit
48441c2
·
verified ·
1 Parent(s): 33d126f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -143,15 +143,15 @@ system_prompt = SystemMessage(
143
  )
144
 
145
 
146
- # class BasicAgent:
147
- # def __init__(self):
148
- # print("BasicAgent initialized.")
149
 
150
- # def __call__(self, question: str) -> str:
151
- # print(f"Agent received question (first 50 chars): {question[:50]}...")
152
- # fixed_answer = "This is a default answer."
153
- # print(f"Agent returning fixed answer: {fixed_answer}")
154
- # return fixed_answer
155
 
156
 
157
  def run_and_submit_all(profile: gr.OAuthProfile | None):
@@ -175,7 +175,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
175
 
176
  # 1. Instantiate Agent ( modify this part to create your agent)
177
  try:
178
- agent = alfred
179
  except Exception as e:
180
  print(f"Error instantiating agent: {e}")
181
  return f"Error initializing agent: {e}", None
 
143
  )
144
 
145
 
146
+ class BasicAgent:
147
+ def __init__(self):
148
+ print("BasicAgent initialized.")
149
 
150
+ def __call__(self, question: str) -> str:
151
+ print(f"Agent received question (first 50 chars): {question[:50]}...")
152
+ fixed_answer = alfred.invoke({"messages": [system_prompt, question]},{"recursion_limit": 3})
153
+ print(f"Agent returning fixed answer: {fixed_answer}")
154
+ return fixed_answer
155
 
156
 
157
  def run_and_submit_all(profile: gr.OAuthProfile | None):
 
175
 
176
  # 1. Instantiate Agent ( modify this part to create your agent)
177
  try:
178
+ agent = BasicAgent()
179
  except Exception as e:
180
  print(f"Error instantiating agent: {e}")
181
  return f"Error initializing agent: {e}", None