geekan / MetaGPT

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
https://deepwisdom.ai/
MIT License
41.33k stars 4.93k forks source link

Can't run when role is assistant #1329

Open yousia33 opened 3 weeks ago

yousia33 commented 3 weeks ago

code

import asyncio

from metagpt.context import Context from metagpt.roles.assistant import Assistant from metagpt.logs import logger

async def main(): msg = "Explain to child how you work as a doctor with nurses and pharmacists" context = Context() role = Assistant(context=context) logger.info(msg) result = await role.run(msg) logger.info(result)

asyncio.run(main())

Traceback

(metagpt) PS F:\MetaGPT> python F:\MetaGPT\test.py 2024-06-06 15:33:35.456 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to F:\MetaGPT Traceback (most recent call last): File "F:\MetaGPT\test.py", line 4, in from metagpt.roles.assistant import Assistant File "F:\MetaGPT\metagpt\roles\assistant.py", line 27, in from metagpt.memory.brain_memory import BrainMemory File "F:\MetaGPT\metagpt\memory\brain_memory.py", line 23, in from metagpt.utils.redis import Redis File "F:\MetaGPT\metagpt\utils\redis.py", line 13, in import aioredis # https://aioredis.readthedocs.io/en/latest/getting-started/ ^^^^^^^^^^^^^^^ File "F:\anacoda\envs\metagpt\Lib\site-packages\aioredis__init__.py", line 1, in from aioredis.client import Redis, StrictRedis File "F:\anacoda\envs\metagpt\Lib\site-packages\aioredis\client.py", line 32, in from aioredis.connection import ( File "F:\anacoda\envs\metagpt\Lib\site-packages\aioredis\connection.py", line 33, in from .exceptions import ( File "F:\anacoda\envs\metagpt\Lib\site-packages\aioredis\exceptions.py", line 14, in class TimeoutError(asyncio.TimeoutError, builtins.TimeoutError, RedisError): TypeError: duplicate base class TimeoutError

yousia33 commented 3 weeks ago

and this is what happend when role is customer_service

Traceback:

(metagpt) PS F:\MetaGPT> python F:\MetaGPT\test.py 2024-06-06 15:48:34.480 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to F:\MetaGPT Traceback (most recent call last): File "F:\MetaGPT\test.py", line 4, in from metagpt.roles.customer_service import CustomerService File "F:\MetaGPT\metagpt\roles\customer_service.py", line 12, in from metagpt.document_store.base_store import BaseStore File "F:\MetaGPT\metagpt\document_store__init__.py", line 9, in from metagpt.document_store.faiss_store import FaissStore File "F:\MetaGPT\metagpt\document_store\faiss_store.py", line 17, in from llama_index.vector_stores.faiss import FaissVectorStore ModuleNotFoundError: No module named 'llama_index.vector_stores'

Kaushal-26 commented 3 weeks ago

For assistant: If using python>=3.11 this would be the issue, https://github.com/aio-libs-abandoned/aioredis-py/issues/1409 @geekan can the package aioredis be changed to redis ? using this: https://github.com/aio-libs-abandoned/aioredis-py/issues/1301

For customer_service: pip install "metagpt[rag]"