chatchat-space / Langchain-Chatchat

Langchain-Chatchat(原Langchain-ChatGLM)基于 Langchain 与 ChatGLM, Qwen 与 Llama 等语言模型的 RAG 与 Agent 应用 | Langchain-Chatchat (formerly langchain-ChatGLM), local knowledge based LLM (like ChatGLM, Qwen and Llama) RAG and Agent app with langchain
Apache License 2.0
31.23k stars 5.45k forks source link

启动报错\site-packages\langchain_core\tools.py", line 1036, in from_function #4725

Closed 1490113799 closed 2 weeks ago

1490113799 commented 1 month ago

执行python chatchat/cli.py start -a命令进行源码启动时,报错提示 Traceback (most recent call last): File "D:\Programs\Python\Python311\Lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "D:\Programs\Python\Python311\Lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "E:\PycharmProjects\Langchain-Chatchat03\libs\chatchat-server\chatchat\startup.py", line 52, in run_api_server from chatchat.server.api_server.server_app import create_app File "E:\PycharmProjects\Langchain-Chatchat03\libs\chatchat-server\chatchat\server\api_server\server_app.py", line 13, in from chatchat.server.api_server.chat_routes import chat_router File "E:\PycharmProjects\Langchain-Chatchat03\libs\chatchat-server\chatchat\server\api_server\chat_routes.py", line 11, in from chatchat.server.chat.kb_chat import kb_chat File "E:\PycharmProjects\Langchain-Chatchat03\libs\chatchat-server\chatchat\server\chat\kb_chat.py", line 15, in from chatchat.server.agent.tools_factory.search_internet import search_engine File "E:\PycharmProjects\Langchain-Chatchat03\libs\chatchat-server\chatchat\server\agent\tools_factory__init.py", line 4, in from .search_local_knowledgebase import search_local_knowledgebase File "E:\PycharmProjects\Langchain-Chatchat03\libs\chatchat-server\chatchat\server\agent\tools_factory\search_local_knowledgebase.py", line 34, in @regist_tool(description=template_knowledge, title="本地知识库") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\PycharmProjects\Langchain-Chatchat03\libs\chatchat-server\chatchat\server\agent\tools_factory\toolsregistry.py", line 109, in wrapper t = partial(def_func) ^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python311\Lib\site-packages\langchain_core\tools.py", line 1266, in _partial return _make_with_name(func.name__)(func) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python311\Lib\site-packages\langchain_core\tools.py", line 1222, in _make_tool return StructuredTool.from_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python311\Lib\site-packages\langchain_core\tools.py", line 1036, in from_function raise ValueError( ValueError: Function must have a docstring if description not provided. image

liunux4odoo commented 2 weeks ago

这个已经修复了,可以拉最新代码试试。 我先关闭了,如果还是有问题,可以 reopen.