albertCHY commited on
Commit
31c82c6
·
verified ·
1 Parent(s): 8002bd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -26,7 +26,7 @@ class BasicAgent:
26
  def __init__(self):
27
  print("BasicAgent initialized.")
28
  def __call__(self, question: str) -> str:
29
- answer = graph.invoke({
30
  "messages": [SystemMessage(content = """
31
  You are a general AI assistant. I will ask you a question.
32
  Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].
@@ -39,7 +39,9 @@ class BasicAgent:
39
  "url": None,
40
  "task_id": None
41
  })
42
- return answer["messages"][-1].text
 
 
43
 
44
  def run_and_submit_all( profile: gr.OAuthProfile | None):
45
  """
 
26
  def __init__(self):
27
  print("BasicAgent initialized.")
28
  def __call__(self, question: str) -> str:
29
+ response = graph.invoke({
30
  "messages": [SystemMessage(content = """
31
  You are a general AI assistant. I will ask you a question.
32
  Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].
 
39
  "url": None,
40
  "task_id": None
41
  })
42
+ print(response["messages"].text)
43
+ answer = response["messages"][-1].text
44
+ return answer
45
 
46
  def run_and_submit_all( profile: gr.OAuthProfile | None):
47
  """