alipay / agentUniverse

agentUniverse is a LLM multi-agent framework that allows developers to easily build multi-agent applications.
Apache License 2.0
906 stars 113 forks source link

from langchain.agents.tools import Tool 报错 #190

Open zhangxnan opened 2 weeks ago

zhangxnan commented 2 weeks ago

` def as_langchain_tool(self):

    from langchain.agents.tools import Tool

    .....

    return Tool(
        name=self.agent_model.info.get("name"),
        func=self.langchain_run,
        description=self.agent_model.info.get("description") + args_description
    )`

这里面可能由于langchain.agents.tools 包的升级,这行代码已经不适用了,运行使用工具的agent将会跑错。应该修改为: ` def as_langchain_tool(self):

    from langchain.agents.tools import InvalidTool

     ......

    return InvalidTool(
        name=self.agent_model.info.get("name"),
        func=self.langchain_run,
        description=self.agent_model.info.get("description") + args_description
    )`
LandJerry commented 2 weeks ago

langchain = "0.1.20" langchain-core = "0.1.52" langchain-community = "0.0.38"

这个是目前v0.0.13版本au使用的langchain版本,可以检查一下是否一致。