agentscope icon indicating copy to clipboard operation
agentscope copied to clipboard

[Bug]: conversation_with_RAG_agents/rag_example.py ERROR

Open czw90130 opened this issue 1 year ago • 1 comments

AgentScope is an open-source project. To involve a broader community, we recommend asking your questions in English.

Describe the bug rag_example.py 执行至 rag_agents:_prepare_args_from_config:103 附近报错:

To Reproduce Steps to reproduce the behavior: . 示例代码未修改

Expected behavior 继续执行demo

Error messages 2024-05-22 13:44:56.131 | INFO | rag_agents:_prepare_args_from_config:103 - load and build object(<module 'llama_index.core.node_parser' from 'C:\Users\XXX\miniconda3\envs\agentscope\lib\site-packages\llama_index\core\node_parser\init.py'>, <class 'llama_index.core.node_parser.text.code.CodeSplitter'>, {'language': 'python', 'chunk_lines': 100}) Could not get parser for language python. Check https://github.com/grantjenks/py-tree-sitter-languages#license for a list of valid languages. Traceback (most recent call last): File "C:\Users\XXX\Documents\workspace\agentscope\examples\conversation_with_RAG_agents\rag_example.py", line 66, in main() File "C:\Users\XXX\Documents\workspace\agentscope\examples\conversation_with_RAG_agents\rag_example.py", line 41, in main code_explain_agent = LlamaIndexAgent(**agent_configs[1]["args"]) File "C:\Users\XXX\Documents\workspace\agentscope\src\agentscope\agents\agent.py", line 82, in call instance = super().call(*args, **kwargs) File "C:\Users\XXX\Documents\workspace\agentscope\examples\conversation_with_RAG_agents\rag_agents.py", line 283, in init super().init( File "C:\Users\XXX\Documents\workspace\agentscope\examples\conversation_with_RAG_agents\rag_agents.py", line 69, in init self.rag = self.init_rag() File "C:\Users\XXX\Documents\workspace\agentscope\examples\conversation_with_RAG_agents\rag_agents.py", line 323, in init_rag store_and_index_args = self._prepare_args_from_config( File "C:\Users\XXX\Documents\workspace\agentscope\examples\conversation_with_RAG_agents\rag_agents.py", line 123, in _prepare_args_from_config self._prepare_args_from_config(c), File "C:\Users\XXX\Documents\workspace\agentscope\examples\conversation_with_RAG_agents\rag_agents.py", line 106, in _prepare_args_from_config return cur_class(**init_args) File "C:\Users\XXX\miniconda3\envs\agentscope\lib\site-packages\llama_index\core\node_parser\text\code.py", line 63, in init parser = tree_sitter_languages.get_parser(language) File "tree_sitter_languages\core.pyx", line 19, in tree_sitter_languages.core.get_parser File "tree_sitter_languages\core.pyx", line 14, in tree_sitter_languages.core.get_language TypeError: init() takes exactly 1 argument (2 given)

Environment (please complete the following information):

  • AgentScope Version: 0.0.4
  • Python Version: 3.9
  • OS: windows 11

czw90130 avatar May 22 '24 10:05 czw90130

@czw90130
Please try to downgrade the version of tree-sitter, just as follows:

pip install tree-sitter<=0.21.3

zhijianma avatar May 23 '24 00:05 zhijianma

This bug is fixed in #248

DavdGao avatar May 24 '24 03:05 DavdGao

Feel free to create a new issue if you have new question. Closing this for now.

DavdGao avatar May 24 '24 03:05 DavdGao