复现gaia时出错
环境 windows11,已经配好了环境,mcp server全部成功运行。为什么会有这个问题。
这里代码没问题吗? result = Runners.sync_run_task( task=Task(input=question, agent=super_agent, conf=TaskConfig()) )
我server应该是都没问题吧,我看没在server上报错.为什么最后会出现这个问题呀。看起来像是result返回的是中间过程,而不是最终的结果,所以这个match = re.search(r"
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'
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.
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)