New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'list' object has no attribute 'keys' #1229
Comments
It seems |
yes it is.
|
The type of the field may have changed, or there is a special situation. FYI: @shenchucheng |
@Yue-Rain Could you please provide the
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description
Traceback (most recent call last):
File "/root/workspace/jjyue/MetaGPT-main/metagpt/utils/common.py", line 640, in wrapper
return await func(self, *args, **kwargs)
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/role.py", line 555, in run
rsp = await self.react()
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/researcher.py", line 130, in react
msg = await super().react()
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/role.py", line 524, in react
rsp = await self._act_by_order()
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/role.py", line 478, in _act_by_order
rsp = await self._act()
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/researcher.py", line 74, in _act
links = await todo.run(topic, 4, 4)
File "/root/workspace/jjyue/MetaGPT-main/metagpt/actions/research.py", line 123, in run
results = await asyncio.gather(
File "/root/workspace/jjyue/MetaGPT-main/metagpt/tools/search_engine.py", line 164, in run
raise e
File "/root/workspace/jjyue/MetaGPT-main/metagpt/tools/search_engine.py", line 159, in run
return await self.run_func(query, max_results=max_results, as_string=as_string)
File "/root/workspace/jjyue/MetaGPT-main/metagpt/tools/search_engine_serpapi.py", line 55, in run
return self._process_response(result, as_string=as_string)
File "/root/workspace/jjyue/MetaGPT-main/metagpt/tools/search_engine_serpapi.py", line 103, in _process_response
if "answer_box" in res.keys() and "answer" in res["answer_box"].keys():
AttributeError: 'list' object has no attribute 'keys'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/workspace/jjyue/MetaGPT-main/entry.py", line 23, in
asyncio.run(main())
File "/root/miniconda3/envs/llm_nlp/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/root/miniconda3/envs/llm_nlp/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/root/workspace/jjyue/MetaGPT-main/entry.py", line 18, in main
await role.run(topic)
File "/root/workspace/jjyue/MetaGPT-main/metagpt/utils/common.py", line 662, in wrapper
raise Exception(format_trackback_info(limit=None))
Exception: Traceback (most recent call last):
File "/root/workspace/jjyue/MetaGPT-main/metagpt/utils/common.py", line 640, in wrapper
return await func(self, *args, **kwargs)
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/role.py", line 555, in run
rsp = await self.react()
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/researcher.py", line 130, in react
msg = await super().react()
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/role.py", line 524, in react
rsp = await self._act_by_order()
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/role.py", line 478, in _act_by_order
rsp = await self._act()
File "/root/workspace/jjyue/MetaGPT-main/metagpt/roles/researcher.py", line 74, in _act
links = await todo.run(topic, 4, 4)
File "/root/workspace/jjyue/MetaGPT-main/metagpt/actions/research.py", line 123, in run
results = await asyncio.gather(
File "/root/workspace/jjyue/MetaGPT-main/metagpt/tools/search_engine.py", line 164, in run
raise e
File "/root/workspace/jjyue/MetaGPT-main/metagpt/tools/search_engine.py", line 159, in run
return await self.run_func(query, max_results=max_results, as_string=as_string)
File "/root/workspace/jjyue/MetaGPT-main/metagpt/tools/search_engine_serpapi.py", line 55, in run
return self._process_response(result, as_string=as_string)
File "/root/workspace/jjyue/MetaGPT-main/metagpt/tools/search_engine_serpapi.py", line 103, in _process_response
if "answer_box" in res.keys() and "answer" in res["answer_box"].keys():
AttributeError: 'list' object has no attribute 'keys'
Bug solved method
Environment information
Screenshots or logs
The text was updated successfully, but these errors were encountered: