MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

rag功能不能正常使用

Open zing-else opened this issue 9 months ago • 2 comments

安装稳定版(截止2025-3-19)无法使用rag功能,无法运行示例代码,会显示以下错误: Retrying llama_index.embeddings.openai.base.get_embeddings in 1.7915908865025045 seconds as it raised NotFoundError: Error code: 404 - {'event_id': '30-inst-228-20250319170241-4fed467a', 'error_msg': 'Not Found. Please check the configuration.'}. .... File "E:\Anaconda\envs\metagpt_stable\lib\site-packages\openai_base_client.py", line 930, in _request raise self._make_status_error_from_response(err.response) from None openai.NotFoundError: Error code: 404 - {'event_id': '30-inst-5-20250319170244-9280c94d', 'error_msg': 'Not Found. Please check the configuration.'}

安装最新的稳定版metagpt==0.8.2会有依赖冲突,试过git clone方法和pip install --upgrade metagpt(pip install --upgrade git+https://github.com/geekan/MetaGPT.git)后会出现缺失包的情况:

Traceback (most recent call last): File "D:\Metagpt\MetaGPT81\test.py", line 3, in from metagpt.rag.engines import SimpleEngine File "E:\Anaconda\envs\metagpt_stable\lib\site-packages\metagpt\rag\engines_init_.py", line 3, in from metagpt.rag.engines.simple import SimpleEngine File "E:\Anaconda\envs\metagpt_stable\lib\site-packages\metagpt\rag\engines\simple.py", line 35, in from metagpt.rag.factories import ( File "E:\Anaconda\envs\metagpt_stable\lib\site-packages\metagpt\rag\factories_init_.py", line 3, in from metagpt.rag.factories.retriever import get_retriever File "E:\Anaconda\envs\metagpt_stable\lib\site-packages\metagpt\rag\factories\retriever.py", line 16, in from llama_index.vector_stores.milvus import MilvusVectorStore ModuleNotFoundError: No module named 'llama_index.vector_stores.milvus'; 安装'llama_index.vector_stores.milvus就会有冲突,无法解决!!! 具体是metagpt==1.0.0依赖setuptools==65.6.3,但是pymilvus 2.5.5 requires setuptools>69等等,有很多冲突无法解决!!

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. llama-index-embeddings-azure-openai 0.1.6 requires llama-index-core<0.11.0,>=0.10.11.post1, but you have llama-index-core 0.12.25 which is incompatible. llama-index-embeddings-openai 0.1.5 requires llama-index-core<0.11.0,>=0.10.1, but you have llama-index-core 0.12.25 which is incompatible. llama-index-llms-azure-openai 0.1.4 requires llama-index-core<0.11.0,>=0.10.11.post1, but you have llama-index-core 0.12.25 which is incompatible. llama-index-llms-openai 0.1.8 requires llama-index-core<0.11.0,>=0.10.1, but you have llama-index-core 0.12.25 which is incompatible. llama-index-readers-file 0.1.4 requires llama-index-core<0.11.0,>=0.10.1, but you have llama-index-core 0.12.25 which is incompatible. llama-index-retrievers-bm25 0.1.3 requires llama-index-core<0.11.0,>=0.10.1, but you have llama-index-core 0.12.25 which is incompatible. llama-index-vector-stores-chroma 0.1.6 requires llama-index-core<0.11.0,>=0.10.1, but you have llama-index-core 0.12.25 which is incompatible. llama-index-vector-stores-elasticsearch 0.1.6 requires llama-index-core<0.11.0,>=0.10.1, but you have llama-index-core 0.12.25 which is incompatible. llama-index-vector-stores-faiss 0.1.1 requires llama-index-core<0.11.0,>=0.10.1, but you have llama-index-core 0.12.25 which is incompatible. metagpt 1.0.0 requires setuptools==65.6.3, but you have setuptools 76.1.0 which is incompatible. metagpt 1.0.0 requires typing-extensions==4.11.0, but you have typing-extensions 4.12.2 which is incompatible. semantic-kernel 0.4.3.dev0 requires python-dotenv==1.0.0, but you have python-dotenv 1.0.1 which is incompatible.

zing-else avatar Mar 19 '25 09:03 zing-else

确实,尝试解决了一上午一直失败

YyKMfight avatar Mar 30 '25 04:03 YyKMfight

由于依赖冲突,临时去掉RAG的milvus,可用main分支再试看看,相关PR

seehi avatar Mar 31 '25 08:03 seehi

This issue has no activity in the past 30 days. Please comment on the issue if you have anything to add.

github-actions[bot] avatar May 02 '25 00:05 github-actions[bot]

我也遇到过rag环境的问题,我按照官方手册的命令: pip install metagpt[rag] 一次性将metagpt环境和rag装好 这样安装的rag是正常的,不过embedding出现了报错,你可以试试(我的python版本是3.11)

lcj1069864078 avatar May 15 '25 12:05 lcj1069864078

This issue has no activity in the past 30 days. Please comment on the issue if you have anything to add.

github-actions[bot] avatar Jun 18 '25 00:06 github-actions[bot]

This issue was closed due to 45 days of inactivity. If you feel this issue is still relevant, please reopen the issue to continue the discussion.

github-actions[bot] avatar Jul 02 '25 00:07 github-actions[bot]