liunux4odoo 42aa900566
优化工具定义;添加 openai 兼容的统一 chat 接口 (#3570)
- 修复:
    - Qwen Agent 的 OutputParser 不再抛出异常,遇到非 COT 文本直接返回
    - CallbackHandler 正确处理工具调用信息

- 重写 tool 定义方式:
    - 添加 regist_tool 简化 tool 定义:
        - 可以指定一个用户友好的名称
        - 自动将函数的 __doc__ 作为 tool.description
	- 支持用 Field 定义参数,不再需要额外定义 ModelSchema
        - 添加 BaseToolOutput 封装 tool	返回结果,以便同时获取原始值、给LLM的字符串值
        - 支持工具热加载(有待测试)

- 增加 openai 兼容的统一 chat 接口,通过 tools/tool_choice/extra_body 不同参数组合支持:
    - Agent 对话
    - 指定工具调用(如知识库RAG)
    - LLM 对话

- 根据后端功能更新 webui
2024-03-29 11:55:32 +08:00
..
2024-03-27 10:12:28 +08:00
2024-03-29 10:23:28 +08:00
2024-03-27 10:12:28 +08:00

加入开发

依赖管理Poetry与env/dependency管理方法

这个项目使用 Poetry 来管理依赖。

注意在安装Poetry之前如果您使用Conda请创建并激活一个新的Conda env例如conda create-n chatchat python=3.9

Install Poetry: documentation on how to install it.

注意: 如果您使用 Conda 或 Pyenv 作为您的环境/包管理器在安装Poetry之后 使用如下命令使Poetry使用virtualenv python environment (poetry config virtualenvs.prefer-active-python true)

本地开发环境安装

  • 选择主项目目录
cd chatchat
  • 安装chatchat依赖(for running chatchat lint\tests):
poetry install --with lint,test