跳转至

安装

基础安装

TongAgents SDK 安装非常简单。默认安装只包含核心库和必要的依赖:

pip install tongagents
uv add tongagents

(Python 3.11或3.12)

2.0 架构说明

TongAgents SDK 2.0 将工具、MCP、运行环境等底层能力统一到开源 chuang_agent 作为基础实现;tongagents 在其之上提供 workflow 引擎、WorkFlowEnv 与企业级能力。安装 tongagents 会自动满足对 chuang_agent 的依赖,无需单独安装。如需仅使用底层能力,请参考 chuang_agent 的文档。

扩展功能安装

TongAgents SDK 提供了多个可选的功能扩展,您可以根据需要单独安装:

示例代码

如果您想运行 TongAgents SDK 提供的示例代码,需要安装 examples 可选组:

pip install 'tongagents[examples]'
uv add 'tongagents[examples]'

要运行示例,请按照示例文档中的说明进行操作。

知识库功能

如果您需要使用知识库相关功能(包括向量数据库、文本嵌入等),请安装 knowledge 可选组:

pip install 'tongagents[knowledge]'
uv add 'tongagents[knowledge]'

检测功能

如果您需要使用文本检测功能(包括 Surya 文本检测模型),请安装 detection 可选组:

pip install 'tongagents[detection]'
uv add 'tongagents[detection]'

这将安装 Surya 文本检测模型及其相关依赖(包括 PyTorch、Transformers 等)。

组合安装

您也可以同时安装多个功能组的依赖,例如:

pip install 'tongagents[knowledge,examples,detection]'
uv add 'tongagents[knowledge,examples,detection]'