AWorld icon indicating copy to clipboard operation
AWorld copied to clipboard

复现gaia时出错

Open mixiazhiyang opened this issue 1 year ago • 2 comments

环境 windows11,已经配好了环境,mcp server全部成功运行。为什么会有这个问题。

Image

这里代码没问题吗? result = Runners.sync_run_task(                     task=Task(input=question, agent=super_agent, conf=TaskConfig())                 )

Image

Image

我server应该是都没问题吧,我看没在server上报错.为什么最后会出现这个问题呀。看起来像是result返回的是中间过程,而不是最终的结果,所以这个match = re.search(r"(.*?)", result["task_0"]["answer"]) 找不到answer。

  File "C:\use\research\LLM\agent\AWorld\examples\gaia\run.py", line 211, in <module>
  File "C:\use\research\LLM\agent\AWorld\examples\gaia\run.py", line 211, in <module>
    match = re.search(r"<answer>(.*?)</answer>", result["task_0"]["answer"])
                                                 ~~~~~~^^^^^^^^^^
KeyError: 'task_0'

mixiazhiyang avatar Jun 04 '25 08:06 mixiazhiyang

Sorry for this issue, it is caused by the interface upgrade. You can update this file or replace it with the following code.

task = Task(input=question, agent=super_agent, conf=TaskConfig())
result = Runners.sync_run_task(task=task)

match = re.search(r"<answer>(.*?)</answer>", result[task.id].get('answer'))

Or use the server version.

rainsonGain avatar Jun 04 '25 08:06 rainsonGain

thank you for prompting response, after test, the code you gave has a little flaw, it will raise bug, say it does not have get attribute. so I tested code below, and it worked

task = Task(input=question, agent=super_agent, conf=TaskConfig())
result = Runners.sync_run_task(task=task)
match = re.search(r"<answer>(.*?)</answer>", result[task.id].answer)

mixiazhiyang avatar Jun 04 '25 13:06 mixiazhiyang