MetaGPT
MetaGPT copied to clipboard
error when run crawl_webpage.py
Bug description
exception happens in File "\MetaGPT\metagpt\actions\mi\write_plan.py", line 63, in assign_task_type task_type_list = rsp["task_type"] KeyError: 'task_type'
Bug solved method
Environment information
- LLM type and model name: Qwen1.5-14B-Chat
- System version: windows 11
- Python version: python 3.9.18
- packages version:
- installation method:
Screenshots or logs
To install langchain-community run pip install -U langchain-community.
warnings.warn(
[
{
"task_id": "task01",
"dependent_task_ids": [],
"instruction": "Scrape the data from the ICLR 2024 statistics page on multiagent and large language model-related papers"
},
{
"task_id": "task02",
"dependent_task_ids": ["task01"],
"instruction": "Filter the scraped data to include papers with 'multiagent' or 'large language model' in the title"
},
{
"task_id": "task03",
"dependent_task_ids": ["task02"],
"instruction": "Extract key variables (e.g., title, authors, publication date) from the filtered data"
},
{
"task_id": "task04",
"dependent_task_ids": ["task03"],
"instruction": "Save the filtered and key variable data into a CSV file"
}
]
Warning: model not found. Using cl100k_base encoding. 2024-03-04 10:09:23.738 | WARNING | metagpt.provider.openai_api:_calc_usage:277 - usage calculation failed: num_tokens_from_messages() is not implemented for model Qwen1.5-14B-Chat. See https://github.com/openai/openai-python/blob/main/chatml.md for information on how messages are converted to tokens. 2024-03-04 10:09:23.740 | WARNING | metagpt.utils.cost_manager:update_cost:47 - Model Qwen1.5-14B-Chat not found in TOKEN_COSTS. 2024-03-04 10:09:34.769 | WARNING | metagpt.utils.cost_manager:update_cost:47 - Model Qwen1.5-14B-Chat not found in TOKEN_COSTS. 2024-03-04 10:09:44.147 | WARNING | metagpt.utils.cost_manager:update_cost:47 - Model Qwen1.5-14B-Chat not found in TOKEN_COSTS. 2024-03-04 10:09:44.147 | WARNING | metagpt.utils.common:wrapper:571 - There is a exception in role's execution, in order to resume, we delete the newest role communication message in the role's memory. Traceback (most recent call last): File "C:\xxx\works\MetaGPT\metagpt\utils\common.py", line 562, in wrapper return await func(self, *args, **kwargs) File "C:\xxx\works\MetaGPT\metagpt\roles\role.py", line 558, in run rsp = await self.react() File "C:\xxx\works\MetaGPT\metagpt\roles\role.py", line 529, in react rsp = await self._plan_and_act() File "C:\xxx\works\MetaGPT\metagpt\roles\role.py", line 489, in _plan_and_act await self.planner.update_plan(goal=goal) File "C:\xxx\works\MetaGPT\metagpt\strategy\planner.py", line 56, in update_plan rsp = await WritePlan().run(context, max_tasks=max_tasks, use_tools=self.use_tools) File "C:\xxx\works\MetaGPT\metagpt\actions\mi\write_plan.py", line 78, in run rsp = await self.assign_task_type(json.loads(rsp)) File "C:\xxx\works\MetaGPT\metagpt\actions\mi\write_plan.py", line 63, in assign_task_type task_type_list = rsp["task_type"] KeyError: 'task_type'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\xxx\works\MetaGPT\examples\mi\crawl_webpage.py", line 22, in
same problem, any solution?
It seems the llm responds unexpected data. You can retry with the main branch, some bugs have beed fixed on that branch.
Hey. Can you try the latest version to make sure the problem still exists?
Hey. Can you try the latest version to make sure the problem still exists?
I had tried and work for me
@chunzha1 Great! Thx for your effort.