acps-sdk 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
acps_sdk-2.0.0/LICENSE ADDED
@@ -0,0 +1,90 @@
1
+ 木兰宽松许可证, 第2版
2
+
3
+ 木兰宽松许可证, 第2版
4
+ 2020年1月 http://license.coscl.org.cn/MulanPSL2
5
+
6
+
7
+ 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
8
+
9
+ 0. 定义
10
+
11
+ “软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
12
+
13
+ “贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
14
+
15
+ “贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
16
+
17
+ “法人实体”是指提交贡献的机构及其“关联实体”。
18
+
19
+ “关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
20
+
21
+ 1. 授予版权许可
22
+
23
+ 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
24
+
25
+ 2. 授予专利许可
26
+
27
+ 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
28
+
29
+ 3. 无商标许可
30
+
31
+ “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
32
+
33
+ 4. 分发限制
34
+
35
+ 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
36
+
37
+ 5. 免责声明与责任限制
38
+
39
+ “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
40
+
41
+ 6. 语言
42
+ “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
43
+
44
+ 条款结束
45
+
46
+
47
+ Mulan Permissive Software License,Version 2
48
+
49
+ Mulan Permissive Software License,Version 2 (Mulan PSL v2)
50
+ January 2020 http://license.coscl.org.cn/MulanPSL2
51
+
52
+ Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
53
+
54
+ 0. Definition
55
+
56
+ Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
57
+
58
+ Contribution means the copyrightable work licensed by a particular Contributor under this License.
59
+
60
+ Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
61
+
62
+ Legal Entity means the entity making a Contribution and all its Affiliates.
63
+
64
+ Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
65
+
66
+ 1. Grant of Copyright License
67
+
68
+ Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
69
+
70
+ 2. Grant of Patent License
71
+
72
+ Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
73
+
74
+ 3. No Trademark License
75
+
76
+ No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4.
77
+
78
+ 4. Distribution Restriction
79
+
80
+ You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
81
+
82
+ 5. Disclaimer of Warranty and Limitation of Liability
83
+
84
+ THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
85
+
86
+ 6. Language
87
+
88
+ THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
89
+
90
+ END OF THE TERMS AND CONDITIONS
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.4
2
+ Name: acps-sdk
3
+ Version: 2.0.0
4
+ Summary: ACPs SDK - Agent Collaboration Protocols SDK
5
+ License-Expression: MulanPSL-2.0
6
+ License-File: LICENSE
7
+ Author: Team
8
+ Author-email: team@ioa.pub
9
+ Requires-Python: >=3.10,<4.0
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Requires-Dist: aio-pika (>=9.0.0)
17
+ Requires-Dist: fastapi (>=0.100.0)
18
+ Requires-Dist: httpx (>=0.24.0)
19
+ Requires-Dist: pydantic (>=2.0.0)
20
+ Description-Content-Type: text/markdown
21
+
22
+ # ACPs SDK
23
+
24
+ Agent Collaboration Protocols(智能体协作协议体系)SDK — ACPs 协议体系的 Python 实现。
25
+
26
+ 目前本SDK包含以下模块:
27
+
28
+ | 模块 | 说明 |
29
+ | -------------- | --------------------------------------------- |
30
+ | `acps_sdk.acs` | Agent Capability Specification 智能体能力描述 |
31
+ | `acps_sdk.adp` | Agent Discovery Protocol 智能体发现协议 |
32
+ | `acps_sdk.aic` | Agent Identity Code 智能体身份码 |
33
+ | `acps_sdk.aip` | Agent Interaction Protocol 智能体交互协议 |
34
+
35
+ ## 1. SDK本地开发环境
36
+
37
+ ### 1.1. 开发环境搭建
38
+
39
+ 建议使用 Python 3.13+,并通过 Poetry 打包。
40
+
41
+ ```bash
42
+ # 克隆仓库
43
+ git clone <仓库地址>
44
+ cd acps-sdk
45
+
46
+ # 安装并激活虚拟环境
47
+ python3 -m venv .venv
48
+ source .venv/bin/activate
49
+
50
+ # 安装 poerty(如果尚未全局安装,则在虚拟环境中安装)
51
+ pip install poetry
52
+
53
+ # 安装SDK项目的依赖
54
+ poetry install
55
+ ```
56
+
57
+ ### 1.2. 构建和发布
58
+
59
+ ```bash
60
+ poetry build
61
+ ```
62
+
63
+ 生成的 wheel 和 sdist 将位于 `dist/` 目录。
64
+
65
+ 发布到 PyPI:
66
+
67
+ ```bash
68
+ poetry publish --username <PyPI用户名> --password <PyPI密码>
69
+ ```
70
+
71
+ ## 2. 目标项目中SDK的安装
72
+
73
+ ### 2.1 使用pip
74
+
75
+ 在需要使用本SDK的Python环境中,可以通过 pip 安装。
76
+
77
+ 从 PyPI(发布后):
78
+
79
+ ```bash
80
+ pip install acps-sdk
81
+ ```
82
+
83
+ 从本地 wheel 文件:
84
+
85
+ ```bash
86
+ pip install path/to/acps_sdk-2.0.0-py3-none-any.whl
87
+ ```
88
+
89
+ ### 2.2 使用pyproject.toml
90
+
91
+ 在需要使用本SDK的项目,可以用 `pyproject.toml` 管理依赖。
92
+
93
+ 从 PyPI(发布后):
94
+
95
+ ```toml
96
+ [tool.poetry.dependencies]
97
+ acps-sdk = "^2.0.0"
98
+ ```
99
+
100
+ 从本地 wheel 文件:
101
+
102
+ ```toml
103
+ [tool.poetry.dependencies]
104
+ acps-sdk = { path = "path/to/acps_sdk-2.0.0-py3-none-any.whl" }
105
+ ```
106
+
107
+ 从本地源码:
108
+
109
+ ```toml
110
+ [tool.poetry.dependencies]
111
+ acps-sdk = { path = "../acps-sdk" }
112
+ ```
113
+
114
+ ## 3. SDK使用示例代码
115
+
116
+ ```python
117
+ from acps_sdk.acs import AgentCapabilitySpec
118
+ from acps_sdk.aip import AipRpcClient, TaskState
119
+ from acps_sdk.aic import validate_aic_format, parse_aic
120
+ ```
121
+
@@ -0,0 +1,99 @@
1
+ # ACPs SDK
2
+
3
+ Agent Collaboration Protocols(智能体协作协议体系)SDK — ACPs 协议体系的 Python 实现。
4
+
5
+ 目前本SDK包含以下模块:
6
+
7
+ | 模块 | 说明 |
8
+ | -------------- | --------------------------------------------- |
9
+ | `acps_sdk.acs` | Agent Capability Specification 智能体能力描述 |
10
+ | `acps_sdk.adp` | Agent Discovery Protocol 智能体发现协议 |
11
+ | `acps_sdk.aic` | Agent Identity Code 智能体身份码 |
12
+ | `acps_sdk.aip` | Agent Interaction Protocol 智能体交互协议 |
13
+
14
+ ## 1. SDK本地开发环境
15
+
16
+ ### 1.1. 开发环境搭建
17
+
18
+ 建议使用 Python 3.13+,并通过 Poetry 打包。
19
+
20
+ ```bash
21
+ # 克隆仓库
22
+ git clone <仓库地址>
23
+ cd acps-sdk
24
+
25
+ # 安装并激活虚拟环境
26
+ python3 -m venv .venv
27
+ source .venv/bin/activate
28
+
29
+ # 安装 poerty(如果尚未全局安装,则在虚拟环境中安装)
30
+ pip install poetry
31
+
32
+ # 安装SDK项目的依赖
33
+ poetry install
34
+ ```
35
+
36
+ ### 1.2. 构建和发布
37
+
38
+ ```bash
39
+ poetry build
40
+ ```
41
+
42
+ 生成的 wheel 和 sdist 将位于 `dist/` 目录。
43
+
44
+ 发布到 PyPI:
45
+
46
+ ```bash
47
+ poetry publish --username <PyPI用户名> --password <PyPI密码>
48
+ ```
49
+
50
+ ## 2. 目标项目中SDK的安装
51
+
52
+ ### 2.1 使用pip
53
+
54
+ 在需要使用本SDK的Python环境中,可以通过 pip 安装。
55
+
56
+ 从 PyPI(发布后):
57
+
58
+ ```bash
59
+ pip install acps-sdk
60
+ ```
61
+
62
+ 从本地 wheel 文件:
63
+
64
+ ```bash
65
+ pip install path/to/acps_sdk-2.0.0-py3-none-any.whl
66
+ ```
67
+
68
+ ### 2.2 使用pyproject.toml
69
+
70
+ 在需要使用本SDK的项目,可以用 `pyproject.toml` 管理依赖。
71
+
72
+ 从 PyPI(发布后):
73
+
74
+ ```toml
75
+ [tool.poetry.dependencies]
76
+ acps-sdk = "^2.0.0"
77
+ ```
78
+
79
+ 从本地 wheel 文件:
80
+
81
+ ```toml
82
+ [tool.poetry.dependencies]
83
+ acps-sdk = { path = "path/to/acps_sdk-2.0.0-py3-none-any.whl" }
84
+ ```
85
+
86
+ 从本地源码:
87
+
88
+ ```toml
89
+ [tool.poetry.dependencies]
90
+ acps-sdk = { path = "../acps-sdk" }
91
+ ```
92
+
93
+ ## 3. SDK使用示例代码
94
+
95
+ ```python
96
+ from acps_sdk.acs import AgentCapabilitySpec
97
+ from acps_sdk.aip import AipRpcClient, TaskState
98
+ from acps_sdk.aic import validate_aic_format, parse_aic
99
+ ```
@@ -0,0 +1,11 @@
1
+ """
2
+ ACPs SDK - Agent Collaboration Protocols(智能体协作协议体系)SDK
3
+
4
+ 提供 ACPs 协议体系的 Python 实现,包括:
5
+ - ACS (Agent Capability Specification) 智能体能力描述
6
+ - ADP (Agent Discovery Protocol) 智能体发现协议
7
+ - AIC (Agent Identity Code) 智能体身份码
8
+ - AIP (Agent Interaction Protocol) 智能体交互协议
9
+ """
10
+
11
+ __version__ = "2.0.0"
@@ -0,0 +1,36 @@
1
+ # ACS SDK — 智能体能力描述模型
2
+
3
+ ACS(Agent Capability Specification)模块提供基于 **ACPs-spec-ACS-v02.00** 规范的 Python 数据模型,使用 Pydantic V2 实现类型验证与序列化。
4
+
5
+ ## 核心模型
6
+
7
+ | 模型 | 说明 |
8
+ | --------------------- | -------------------------------------------------- |
9
+ | `AgentCapabilitySpec` | ACS 根对象,完整描述智能体的身份、能力、端点和技能 |
10
+ | `AgentProvider` | 智能体服务提供者信息(组织、联系方式、资质) |
11
+ | `AgentCapabilities` | 技术能力配置(流式响应、异步通知、消息队列) |
12
+ | `AgentSkill` | 智能体技能定义(功能边界、输入输出规范) |
13
+ | `AgentEndPoint` | 服务端点配置(URL、传输协议、安全要求) |
14
+
15
+ ## 快速使用
16
+
17
+ ```python
18
+ from acps_sdk.acs import AgentCapabilitySpec
19
+
20
+ # 从字典创建
21
+ spec = AgentCapabilitySpec.from_dict(data)
22
+
23
+ # 从 JSON 字符串创建
24
+ spec = AgentCapabilitySpec.from_json(json_str)
25
+
26
+ # 从 JSON 文件加载
27
+ spec = AgentCapabilitySpec.from_file("agent.json")
28
+
29
+ # 序列化
30
+ json_str = spec.to_json()
31
+ data_dict = spec.to_dict()
32
+ ```
33
+
34
+ ## 字段别名
35
+
36
+ 模型使用 `populate_by_name=True` 配置,同时支持 Python 风格(`snake_case`)和协议风格(`camelCase`)字段名。序列化输出默认使用 `camelCase` 别名。
@@ -0,0 +1,48 @@
1
+ """
2
+ ACS (Agent Capability Specification) 智能体能力描述模型
3
+
4
+ 本模块定义了ACPs协议体系中智能体能力描述的Python数据模型,
5
+ 基于ACPs-spec-ACS-v02.00规范。
6
+ """
7
+
8
+ from .models import (
9
+ # 核心对象
10
+ AgentCapabilitySpec,
11
+ # Provider
12
+ AgentProvider,
13
+ # Capabilities
14
+ AgentCapabilities,
15
+ MQProtocolVersion,
16
+ # Security
17
+ SecurityScheme,
18
+ MutualTLSSecurityScheme,
19
+ OpenIdConnectSecurityScheme,
20
+ APIKeySecurityScheme,
21
+ HTTPAuthSecurityScheme,
22
+ OAuth2SecurityScheme,
23
+ # EndPoint
24
+ AgentEndPoint,
25
+ # Skill
26
+ AgentSkill,
27
+ )
28
+
29
+ __all__ = [
30
+ # 核心对象
31
+ "AgentCapabilitySpec",
32
+ # Provider
33
+ "AgentProvider",
34
+ # Capabilities
35
+ "AgentCapabilities",
36
+ "MQProtocolVersion",
37
+ # Security
38
+ "SecurityScheme",
39
+ "MutualTLSSecurityScheme",
40
+ "OpenIdConnectSecurityScheme",
41
+ "APIKeySecurityScheme",
42
+ "HTTPAuthSecurityScheme",
43
+ "OAuth2SecurityScheme",
44
+ # EndPoint
45
+ "AgentEndPoint",
46
+ # Skill
47
+ "AgentSkill",
48
+ ]