ShunX-ai 1.3.1__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.
shunx_ai-1.3.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Author Name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: ShunX-ai
3
+ Version: 1.3.1
4
+ Summary: A minimalist library with as few dependencies as possible.
5
+ Author-email: Fujiwara Kyokugen <s@shunx.top>
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest; extra == "dev"
15
+ Requires-Dist: flake8; extra == "dev"
16
+ Requires-Dist: build; extra == "dev"
17
+ Requires-Dist: twine; extra == "dev"
18
+ Requires-Dist: numpy; extra == "dev"
19
+ Provides-Extra: memory
20
+ Requires-Dist: pymilvus>=2.4.0; extra == "memory"
21
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "memory"
22
+ Dynamic: license-file
23
+
24
+ # ShunX-ai
25
+
26
+ 前身项目 https://pypi.org/project/kiori/ 遵循MIT分发
27
+
28
+ **ShunX** 是一个极简、高度可扩展的 Python 框架,用于构建基于 SLM/LLM 的 Agent。遵循其设计理念,它不堆砌冗余依赖,只提供干净、可组合的架构。
29
+
30
+ 自 1.2.0 版本起,ShunX 拥抱 **零配置(Zero-Configuration)** 与 **自动自愈(Auto-Healing)**:它依赖现代小语言模型(SLM)的推理能力,并内置了自动纠正模型输出语法错误的机制。
31
+
32
+ ---
33
+
34
+ ## 架构概览
35
+
36
+ 在把 prompt 发送给模型之前,ShunX 会无缝融合多种机制:
37
+
38
+ 1. **长期记忆(LTM)与加权模式匹配**:基于 Milvus Lite,LTM 把历史交互和 few-shot 例子编码成向量存储。新 prompt 到来时,ShunX 执行语义搜索(余弦相似度),高置信度的匹配会被动态复制(加权放大),以显著影响模型的行为。
39
+ 2. **短期记忆(Replay Buffer)**:保留对话中最近的回合,让模型清楚感知近期上下文。*注意:ShunX 会智能过滤掉损坏的交互,确保你的 SLM 只学到格式完美的例子。*
40
+ 3. **智能解析器(`ShunXParser`)**:评估 LLM 输出并将其分为三种状态:
41
+ - `SUCCESS`:LLM 输出与预期的 `[ACTION: name, ARGS: {...}]` 格式完全匹配。
42
+ - `NATURAL_CHAT`:LLM 只是在与用户自然对话。
43
+ - `BROKEN_FORMAT`:LLM 尝试执行行动,但 JSON 或方括号语法出错。
44
+ 4. **自愈循环(Auto-Healing Loop)**:如果 LLM 输出了 `BROKEN_FORMAT`,ShunX 会自动累加重试计数器、追加一条系统观察消息(`[System Observation: ...]`),并立即提示 LLM 自己纠正错误。
45
+
46
+ ---
47
+
48
+ ## 安装
49
+
50
+ ```bash
51
+ # 核心极简安装
52
+ pip install shunx-ai
53
+
54
+ # 安装含记忆模块的依赖(pymilvus 与 sentence-transformers)
55
+ pip install "shunx-ai[memory]"
56
+ ```
57
+
58
+ ## 快速开始:端到端流程
59
+
60
+ 下面是一个完整示例,演示如何初始化 Agent、配置记忆、注册行动,并执行用户 prompt。
61
+
62
+ ```python
63
+ from shunx_ai.agent import ShunXAgent
64
+ from shunx_ai.models import Action, ActionExample
65
+ from shunx_ai.memory import MilvusLTM, ReplayBuffer
66
+
67
+ # 1. 配置记忆模块
68
+ ltm = MilvusLTM() # 自动初始化本地 Milvus Lite 向量库
69
+ replay_buffer = ReplayBuffer()
70
+
71
+ # 2. 往 LTM 里写入先验知识(few-shot 例子)
72
+ example = ActionExample(
73
+ user_prompt="Check the server status",
74
+ expected_action_text="[ACTION: get_status, ARGS: {}]"
75
+ )
76
+ ltm.add_examples([example])
77
+
78
+ # 3. 初始化 ShunX Agent(零配置!)
79
+ agent = ShunXAgent(ltm=ltm, replay_buffer=replay_buffer)
80
+
81
+ # 4. 定义并注册行动(普通的 Python 可调用对象)
82
+ def get_status() -> str:
83
+ return "Server is running smoothly."
84
+
85
+ agent.add_action(Action("get_status", "Fetches current server status", get_status))
86
+
87
+ # 5. 提供 LLM 回调函数
88
+ def my_llm_callback(prompt: str) -> str:
89
+ # 为演示故意模拟一个损坏的 LLM 响应:
90
+ return 'I will run the command: [ACTION: get_status ARGS: {}' # 缺少逗号和右括号!
91
+
92
+ # 6. 执行流水线
93
+ # ShunX 会自动检测 BROKEN_FORMAT、追加修正提示,
94
+ # 并反复调用 `my_llm_callback`,直到输出合法的 SUCCESS 格式或达到 max_retries!
95
+ result = agent.run("Is the server okay?", llm_callback=my_llm_callback, max_retries=3)
96
+
97
+ print(result)
98
+ ```
99
+
100
+ ## 高级用法
101
+
102
+ ### 聊天模板(适用于经过聊天微调的 SLM)
103
+
104
+ 传入 `chat_format`,让 ShunX 用模型专属模板包装 prompt,并在 assistant 回合开头**预填(prefix-fill)** `[ACTION:` —— 模型只需补全后续内容,可大幅降低格式错误率。
105
+
106
+ ```python
107
+ # 支持:"gemma"(默认)、"llama3"、"chatml"
108
+ agent = ShunXAgent(chat_format="chatml")
109
+
110
+ result = agent.run("Is the server okay?", llm_callback=my_llm_callback)
111
+ ```
112
+
113
+ ### 自然语言总结
114
+
115
+ 设置 `summarize_observation=True`,让 LLM 把原始行动结果改写成自然友好的回答(隐藏行动名等技术细节):
116
+
117
+ ```python
118
+ reply = agent.run("Is the server okay?", llm_callback=my_llm_callback, summarize_observation=True)
119
+ ```
120
+
121
+ ### 静态 Few-shot 例子
122
+
123
+ 即使不配置向量记忆(`ltm`),你也可以手动固定一些总是会被写进 prompt 的例子:
124
+
125
+ ```python
126
+ agent = ShunXAgent()
127
+ agent.add_example(ActionExample(
128
+ user_prompt="Check the CPU usage",
129
+ expected_action_text="[ACTION: get_cpu, ARGS: {}]"
130
+ ))
131
+ ```
132
+
133
+ `get_context_examples(...)` 也支持在单次调用中覆盖 `threshold`、`max_copies` 和 `sample_n` 参数;不传则使用构造时的默认值。
134
+
135
+ ## 设计理念
136
+
137
+ ShunX 追求轻量、易懂、不依赖臃肿的外部包。通过保持核心架构的极简,开发者可以自由组合和定制 AI 执行流程,而不被僵化的设计模式束缚。
@@ -0,0 +1,114 @@
1
+ # ShunX-ai
2
+
3
+ 前身项目 https://pypi.org/project/kiori/ 遵循MIT分发
4
+
5
+ **ShunX** 是一个极简、高度可扩展的 Python 框架,用于构建基于 SLM/LLM 的 Agent。遵循其设计理念,它不堆砌冗余依赖,只提供干净、可组合的架构。
6
+
7
+ 自 1.2.0 版本起,ShunX 拥抱 **零配置(Zero-Configuration)** 与 **自动自愈(Auto-Healing)**:它依赖现代小语言模型(SLM)的推理能力,并内置了自动纠正模型输出语法错误的机制。
8
+
9
+ ---
10
+
11
+ ## 架构概览
12
+
13
+ 在把 prompt 发送给模型之前,ShunX 会无缝融合多种机制:
14
+
15
+ 1. **长期记忆(LTM)与加权模式匹配**:基于 Milvus Lite,LTM 把历史交互和 few-shot 例子编码成向量存储。新 prompt 到来时,ShunX 执行语义搜索(余弦相似度),高置信度的匹配会被动态复制(加权放大),以显著影响模型的行为。
16
+ 2. **短期记忆(Replay Buffer)**:保留对话中最近的回合,让模型清楚感知近期上下文。*注意:ShunX 会智能过滤掉损坏的交互,确保你的 SLM 只学到格式完美的例子。*
17
+ 3. **智能解析器(`ShunXParser`)**:评估 LLM 输出并将其分为三种状态:
18
+ - `SUCCESS`:LLM 输出与预期的 `[ACTION: name, ARGS: {...}]` 格式完全匹配。
19
+ - `NATURAL_CHAT`:LLM 只是在与用户自然对话。
20
+ - `BROKEN_FORMAT`:LLM 尝试执行行动,但 JSON 或方括号语法出错。
21
+ 4. **自愈循环(Auto-Healing Loop)**:如果 LLM 输出了 `BROKEN_FORMAT`,ShunX 会自动累加重试计数器、追加一条系统观察消息(`[System Observation: ...]`),并立即提示 LLM 自己纠正错误。
22
+
23
+ ---
24
+
25
+ ## 安装
26
+
27
+ ```bash
28
+ # 核心极简安装
29
+ pip install shunx-ai
30
+
31
+ # 安装含记忆模块的依赖(pymilvus 与 sentence-transformers)
32
+ pip install "shunx-ai[memory]"
33
+ ```
34
+
35
+ ## 快速开始:端到端流程
36
+
37
+ 下面是一个完整示例,演示如何初始化 Agent、配置记忆、注册行动,并执行用户 prompt。
38
+
39
+ ```python
40
+ from shunx_ai.agent import ShunXAgent
41
+ from shunx_ai.models import Action, ActionExample
42
+ from shunx_ai.memory import MilvusLTM, ReplayBuffer
43
+
44
+ # 1. 配置记忆模块
45
+ ltm = MilvusLTM() # 自动初始化本地 Milvus Lite 向量库
46
+ replay_buffer = ReplayBuffer()
47
+
48
+ # 2. 往 LTM 里写入先验知识(few-shot 例子)
49
+ example = ActionExample(
50
+ user_prompt="Check the server status",
51
+ expected_action_text="[ACTION: get_status, ARGS: {}]"
52
+ )
53
+ ltm.add_examples([example])
54
+
55
+ # 3. 初始化 ShunX Agent(零配置!)
56
+ agent = ShunXAgent(ltm=ltm, replay_buffer=replay_buffer)
57
+
58
+ # 4. 定义并注册行动(普通的 Python 可调用对象)
59
+ def get_status() -> str:
60
+ return "Server is running smoothly."
61
+
62
+ agent.add_action(Action("get_status", "Fetches current server status", get_status))
63
+
64
+ # 5. 提供 LLM 回调函数
65
+ def my_llm_callback(prompt: str) -> str:
66
+ # 为演示故意模拟一个损坏的 LLM 响应:
67
+ return 'I will run the command: [ACTION: get_status ARGS: {}' # 缺少逗号和右括号!
68
+
69
+ # 6. 执行流水线
70
+ # ShunX 会自动检测 BROKEN_FORMAT、追加修正提示,
71
+ # 并反复调用 `my_llm_callback`,直到输出合法的 SUCCESS 格式或达到 max_retries!
72
+ result = agent.run("Is the server okay?", llm_callback=my_llm_callback, max_retries=3)
73
+
74
+ print(result)
75
+ ```
76
+
77
+ ## 高级用法
78
+
79
+ ### 聊天模板(适用于经过聊天微调的 SLM)
80
+
81
+ 传入 `chat_format`,让 ShunX 用模型专属模板包装 prompt,并在 assistant 回合开头**预填(prefix-fill)** `[ACTION:` —— 模型只需补全后续内容,可大幅降低格式错误率。
82
+
83
+ ```python
84
+ # 支持:"gemma"(默认)、"llama3"、"chatml"
85
+ agent = ShunXAgent(chat_format="chatml")
86
+
87
+ result = agent.run("Is the server okay?", llm_callback=my_llm_callback)
88
+ ```
89
+
90
+ ### 自然语言总结
91
+
92
+ 设置 `summarize_observation=True`,让 LLM 把原始行动结果改写成自然友好的回答(隐藏行动名等技术细节):
93
+
94
+ ```python
95
+ reply = agent.run("Is the server okay?", llm_callback=my_llm_callback, summarize_observation=True)
96
+ ```
97
+
98
+ ### 静态 Few-shot 例子
99
+
100
+ 即使不配置向量记忆(`ltm`),你也可以手动固定一些总是会被写进 prompt 的例子:
101
+
102
+ ```python
103
+ agent = ShunXAgent()
104
+ agent.add_example(ActionExample(
105
+ user_prompt="Check the CPU usage",
106
+ expected_action_text="[ACTION: get_cpu, ARGS: {}]"
107
+ ))
108
+ ```
109
+
110
+ `get_context_examples(...)` 也支持在单次调用中覆盖 `threshold`、`max_copies` 和 `sample_n` 参数;不传则使用构造时的默认值。
111
+
112
+ ## 设计理念
113
+
114
+ ShunX 追求轻量、易懂、不依赖臃肿的外部包。通过保持核心架构的极简,开发者可以自由组合和定制 AI 执行流程,而不被僵化的设计模式束缚。
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: ShunX-ai
3
+ Version: 1.3.1
4
+ Summary: A minimalist library with as few dependencies as possible.
5
+ Author-email: Fujiwara Kyokugen <s@shunx.top>
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest; extra == "dev"
15
+ Requires-Dist: flake8; extra == "dev"
16
+ Requires-Dist: build; extra == "dev"
17
+ Requires-Dist: twine; extra == "dev"
18
+ Requires-Dist: numpy; extra == "dev"
19
+ Provides-Extra: memory
20
+ Requires-Dist: pymilvus>=2.4.0; extra == "memory"
21
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "memory"
22
+ Dynamic: license-file
23
+
24
+ # ShunX-ai
25
+
26
+ 前身项目 https://pypi.org/project/kiori/ 遵循MIT分发
27
+
28
+ **ShunX** 是一个极简、高度可扩展的 Python 框架,用于构建基于 SLM/LLM 的 Agent。遵循其设计理念,它不堆砌冗余依赖,只提供干净、可组合的架构。
29
+
30
+ 自 1.2.0 版本起,ShunX 拥抱 **零配置(Zero-Configuration)** 与 **自动自愈(Auto-Healing)**:它依赖现代小语言模型(SLM)的推理能力,并内置了自动纠正模型输出语法错误的机制。
31
+
32
+ ---
33
+
34
+ ## 架构概览
35
+
36
+ 在把 prompt 发送给模型之前,ShunX 会无缝融合多种机制:
37
+
38
+ 1. **长期记忆(LTM)与加权模式匹配**:基于 Milvus Lite,LTM 把历史交互和 few-shot 例子编码成向量存储。新 prompt 到来时,ShunX 执行语义搜索(余弦相似度),高置信度的匹配会被动态复制(加权放大),以显著影响模型的行为。
39
+ 2. **短期记忆(Replay Buffer)**:保留对话中最近的回合,让模型清楚感知近期上下文。*注意:ShunX 会智能过滤掉损坏的交互,确保你的 SLM 只学到格式完美的例子。*
40
+ 3. **智能解析器(`ShunXParser`)**:评估 LLM 输出并将其分为三种状态:
41
+ - `SUCCESS`:LLM 输出与预期的 `[ACTION: name, ARGS: {...}]` 格式完全匹配。
42
+ - `NATURAL_CHAT`:LLM 只是在与用户自然对话。
43
+ - `BROKEN_FORMAT`:LLM 尝试执行行动,但 JSON 或方括号语法出错。
44
+ 4. **自愈循环(Auto-Healing Loop)**:如果 LLM 输出了 `BROKEN_FORMAT`,ShunX 会自动累加重试计数器、追加一条系统观察消息(`[System Observation: ...]`),并立即提示 LLM 自己纠正错误。
45
+
46
+ ---
47
+
48
+ ## 安装
49
+
50
+ ```bash
51
+ # 核心极简安装
52
+ pip install shunx-ai
53
+
54
+ # 安装含记忆模块的依赖(pymilvus 与 sentence-transformers)
55
+ pip install "shunx-ai[memory]"
56
+ ```
57
+
58
+ ## 快速开始:端到端流程
59
+
60
+ 下面是一个完整示例,演示如何初始化 Agent、配置记忆、注册行动,并执行用户 prompt。
61
+
62
+ ```python
63
+ from shunx_ai.agent import ShunXAgent
64
+ from shunx_ai.models import Action, ActionExample
65
+ from shunx_ai.memory import MilvusLTM, ReplayBuffer
66
+
67
+ # 1. 配置记忆模块
68
+ ltm = MilvusLTM() # 自动初始化本地 Milvus Lite 向量库
69
+ replay_buffer = ReplayBuffer()
70
+
71
+ # 2. 往 LTM 里写入先验知识(few-shot 例子)
72
+ example = ActionExample(
73
+ user_prompt="Check the server status",
74
+ expected_action_text="[ACTION: get_status, ARGS: {}]"
75
+ )
76
+ ltm.add_examples([example])
77
+
78
+ # 3. 初始化 ShunX Agent(零配置!)
79
+ agent = ShunXAgent(ltm=ltm, replay_buffer=replay_buffer)
80
+
81
+ # 4. 定义并注册行动(普通的 Python 可调用对象)
82
+ def get_status() -> str:
83
+ return "Server is running smoothly."
84
+
85
+ agent.add_action(Action("get_status", "Fetches current server status", get_status))
86
+
87
+ # 5. 提供 LLM 回调函数
88
+ def my_llm_callback(prompt: str) -> str:
89
+ # 为演示故意模拟一个损坏的 LLM 响应:
90
+ return 'I will run the command: [ACTION: get_status ARGS: {}' # 缺少逗号和右括号!
91
+
92
+ # 6. 执行流水线
93
+ # ShunX 会自动检测 BROKEN_FORMAT、追加修正提示,
94
+ # 并反复调用 `my_llm_callback`,直到输出合法的 SUCCESS 格式或达到 max_retries!
95
+ result = agent.run("Is the server okay?", llm_callback=my_llm_callback, max_retries=3)
96
+
97
+ print(result)
98
+ ```
99
+
100
+ ## 高级用法
101
+
102
+ ### 聊天模板(适用于经过聊天微调的 SLM)
103
+
104
+ 传入 `chat_format`,让 ShunX 用模型专属模板包装 prompt,并在 assistant 回合开头**预填(prefix-fill)** `[ACTION:` —— 模型只需补全后续内容,可大幅降低格式错误率。
105
+
106
+ ```python
107
+ # 支持:"gemma"(默认)、"llama3"、"chatml"
108
+ agent = ShunXAgent(chat_format="chatml")
109
+
110
+ result = agent.run("Is the server okay?", llm_callback=my_llm_callback)
111
+ ```
112
+
113
+ ### 自然语言总结
114
+
115
+ 设置 `summarize_observation=True`,让 LLM 把原始行动结果改写成自然友好的回答(隐藏行动名等技术细节):
116
+
117
+ ```python
118
+ reply = agent.run("Is the server okay?", llm_callback=my_llm_callback, summarize_observation=True)
119
+ ```
120
+
121
+ ### 静态 Few-shot 例子
122
+
123
+ 即使不配置向量记忆(`ltm`),你也可以手动固定一些总是会被写进 prompt 的例子:
124
+
125
+ ```python
126
+ agent = ShunXAgent()
127
+ agent.add_example(ActionExample(
128
+ user_prompt="Check the CPU usage",
129
+ expected_action_text="[ACTION: get_cpu, ARGS: {}]"
130
+ ))
131
+ ```
132
+
133
+ `get_context_examples(...)` 也支持在单次调用中覆盖 `threshold`、`max_copies` 和 `sample_n` 参数;不传则使用构造时的默认值。
134
+
135
+ ## 设计理念
136
+
137
+ ShunX 追求轻量、易懂、不依赖臃肿的外部包。通过保持核心架构的极简,开发者可以自由组合和定制 AI 执行流程,而不被僵化的设计模式束缚。
@@ -0,0 +1,18 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.cfg
5
+ ShunX_ai.egg-info/PKG-INFO
6
+ ShunX_ai.egg-info/SOURCES.txt
7
+ ShunX_ai.egg-info/dependency_links.txt
8
+ ShunX_ai.egg-info/requires.txt
9
+ ShunX_ai.egg-info/top_level.txt
10
+ shunx_ai/__init__.py
11
+ shunx_ai/agent.py
12
+ shunx_ai/chat_templates.py
13
+ shunx_ai/executor.py
14
+ shunx_ai/memory.py
15
+ shunx_ai/models.py
16
+ shunx_ai/parser.py
17
+ tests/test_core.py
18
+ tests/test_memory.py
@@ -0,0 +1,11 @@
1
+
2
+ [dev]
3
+ pytest
4
+ flake8
5
+ build
6
+ twine
7
+ numpy
8
+
9
+ [memory]
10
+ pymilvus>=2.4.0
11
+ sentence-transformers>=2.2.0
@@ -0,0 +1 @@
1
+ shunx_ai
@@ -0,0 +1,36 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ShunX-ai"
7
+ version = "1.3.1"
8
+ description = "A minimalist library with as few dependencies as possible."
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [
12
+ {name = "Fujiwara Kyokugen", email = "s@shunx.top"}
13
+ ]
14
+ requires-python = ">=3.8"
15
+ dependencies = []
16
+ classifiers = [
17
+ "Programming Language :: Python :: 3",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ ]
21
+
22
+ [project.optional-dependencies]
23
+ dev = [
24
+ "pytest",
25
+ "flake8",
26
+ "build",
27
+ "twine",
28
+ "numpy" # 测试依赖:tests/test_memory.py 直接 import numpy
29
+ ]
30
+ memory = [
31
+ "pymilvus>=2.4.0",
32
+ "sentence-transformers>=2.2.0"
33
+ ]
34
+
35
+ [tool.setuptools.packages.find]
36
+ include = ["shunx_ai*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,32 @@
1
+ from .agent import ShunXAgent, context_shuffler, format_prompt
2
+ from .models import Action, ActionExample
3
+ from .memory import MilvusLTM, ReplayBuffer
4
+ from .executor import execute_action
5
+ from .parser import (
6
+ ShunXParser, ParseStatus, ParseResult,
7
+ ACTION_PREFIX, ACTION_FORMAT,
8
+ ACTION_FORMAT_INSTRUCTION_EN, ACTION_FORMAT_INSTRUCTION_VI,
9
+ ACTION_FORMAT_HINT, ACTION_REGEX
10
+ )
11
+ from .chat_templates import apply_chat_template
12
+
13
+ __all__ = [
14
+ "ShunXAgent",
15
+ "Action",
16
+ "ActionExample",
17
+ "MilvusLTM",
18
+ "ReplayBuffer",
19
+ "context_shuffler",
20
+ "format_prompt",
21
+ "ShunXParser",
22
+ "ParseStatus",
23
+ "ParseResult",
24
+ "execute_action",
25
+ "apply_chat_template",
26
+ "ACTION_PREFIX",
27
+ "ACTION_FORMAT",
28
+ "ACTION_FORMAT_INSTRUCTION_EN",
29
+ "ACTION_FORMAT_INSTRUCTION_VI",
30
+ "ACTION_FORMAT_HINT",
31
+ "ACTION_REGEX",
32
+ ]