antonioschiro commited on
Commit
2f03527
·
verified ·
1 Parent(s): 720ed0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -21,15 +21,15 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
21
  class BasicAgent:
22
  def __init__(self):
23
  self.agent = alfred
24
- async def __call__(self, question: str) -> str:
25
- state_dict = await alfred.ainvoke({"messages": [HumanMessage(content = question)]})
26
  response = state_dict["messages"][-1]
27
  try:
28
  return response.content
29
  except:
30
  return "Sorry, I can't answer to this question."
31
 
32
- async def run_and_submit_all( profile: gr.OAuthProfile | None):
33
  """
34
  Fetches all questions, runs the BasicAgent on them, submits all answers,
35
  and displays the results.
 
21
  class BasicAgent:
22
  def __init__(self):
23
  self.agent = alfred
24
+ def __call__(self, question: str) -> str:
25
+ state_dict = alfred.invoke({"messages": [HumanMessage(content = question)]})
26
  response = state_dict["messages"][-1]
27
  try:
28
  return response.content
29
  except:
30
  return "Sorry, I can't answer to this question."
31
 
32
+ def run_and_submit_all( profile: gr.OAuthProfile | None):
33
  """
34
  Fetches all questions, runs the BasicAgent on them, submits all answers,
35
  and displays the results.