Skip to content
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

Can't run when role is assistant #1329

Closed
yousia33 opened this issue Jun 6, 2024 · 2 comments
Closed

Can't run when role is assistant #1329

yousia33 opened this issue Jun 6, 2024 · 2 comments

Comments

@yousia33
Copy link

yousia33 commented Jun 6, 2024

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
Copy link
Author

yousia33 commented Jun 6, 2024

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
Copy link
Contributor

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

For customer_service: pip install "metagpt[rag]"

iorisa pushed a commit to iorisa/MetaGPT that referenced this issue Jul 16, 2024
geekan added a commit that referenced this issue Jul 18, 2024
yulin-jin pushed a commit to yulin-jin/MetaGPT that referenced this issue Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants