jarvis-ai-assistant 0.1.61__tar.gz → 0.1.63__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.
Potentially problematic release.
This version of jarvis-ai-assistant might be problematic. Click here for more details.
- {jarvis_ai_assistant-0.1.61/src/jarvis_ai_assistant.egg-info → jarvis_ai_assistant-0.1.63}/PKG-INFO +1 -1
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/pyproject.toml +1 -1
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/setup.py +1 -1
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/__init__.py +1 -1
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/agent.py +3 -13
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/methodology.py +16 -16
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63/src/jarvis_ai_assistant.egg-info}/PKG-INFO +1 -1
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/MANIFEST.in +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/README.md +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/setup.cfg +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/jarvis_coder/main.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/main.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/models/__init__.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/models/ai8.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/models/base.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/models/kimi.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/models/openai.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/models/oyi.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/models/registry.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/__init__.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/base.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/coder.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/file_ops.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/generator.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/registry.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/search.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/shell.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/sub_agent.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/tools/webpage.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis/utils.py +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis_ai_assistant.egg-info/SOURCES.txt +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis_ai_assistant.egg-info/dependency_links.txt +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis_ai_assistant.egg-info/entry_points.txt +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis_ai_assistant.egg-info/requires.txt +0 -0
- {jarvis_ai_assistant-0.1.61 → jarvis_ai_assistant-0.1.63}/src/jarvis_ai_assistant.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "jarvis-ai-assistant"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.63"
|
|
8
8
|
description = "Jarvis: An AI assistant that uses tools to interact with the system"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Your Name", email = "your.email@example.com" }]
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="jarvis-ai-assistant",
|
|
5
|
-
version="0.1.
|
|
5
|
+
version="0.1.63",
|
|
6
6
|
author="skyfire",
|
|
7
7
|
author_email="skyfireitdiy@hotmail.com",
|
|
8
8
|
description="An AI assistant that uses various tools to interact with the system",
|
|
@@ -142,16 +142,6 @@ class Agent:
|
|
|
142
142
|
except Exception as e:
|
|
143
143
|
PrettyOutput.print(f"总结对话历史失败: {str(e)}", OutputType.ERROR)
|
|
144
144
|
|
|
145
|
-
def _make_mathodology(self) -> str:
|
|
146
|
-
PrettyOutput.section("生成方法论", OutputType.PLANNING)
|
|
147
|
-
"""生成方法论"""
|
|
148
|
-
prompt = f"""任务已经结束,请总结任务执行过程中的经验,评估是否需要补充新的方法论,如果需要,请调用方法论工具生成方法论,方法论内容格式如下:
|
|
149
|
-
|
|
150
|
-
1. 问题重述
|
|
151
|
-
2. 最优解决方案
|
|
152
|
-
3. 最优方案执行步骤(失败的行动不需要体现)
|
|
153
|
-
"""
|
|
154
|
-
return self._call_model(prompt)
|
|
155
145
|
|
|
156
146
|
def _choose_methodology(self, methodology: Dict[str, str], task: str) -> str:
|
|
157
147
|
"""选择方法论"""
|
|
@@ -160,8 +150,10 @@ class Agent:
|
|
|
160
150
|
{task}
|
|
161
151
|
|
|
162
152
|
方法论:
|
|
163
|
-
{methodology}
|
|
164
153
|
"""
|
|
154
|
+
for k, v in methodology.items():
|
|
155
|
+
prompt += f"问题类型:{k}\n"
|
|
156
|
+
prompt += f"方法论:{v}\n"
|
|
165
157
|
return self._call_model(prompt)
|
|
166
158
|
|
|
167
159
|
def _complete_task(self) -> str:
|
|
@@ -171,8 +163,6 @@ class Agent:
|
|
|
171
163
|
str: 任务总结或完成状态
|
|
172
164
|
"""
|
|
173
165
|
PrettyOutput.section("任务完成", OutputType.SUCCESS)
|
|
174
|
-
|
|
175
|
-
self._make_mathodology()
|
|
176
166
|
|
|
177
167
|
if not self.is_sub_agent:
|
|
178
168
|
return "Task completed"
|
|
@@ -8,7 +8,7 @@ class MethodologyTool:
|
|
|
8
8
|
"""经验管理工具"""
|
|
9
9
|
|
|
10
10
|
name = "methodology"
|
|
11
|
-
description = "
|
|
11
|
+
description = "管理问题处理方法论,支持添加、更新、删除操作"
|
|
12
12
|
parameters = {
|
|
13
13
|
"type": "object",
|
|
14
14
|
"properties": {
|
|
@@ -23,7 +23,7 @@ class MethodologyTool:
|
|
|
23
23
|
},
|
|
24
24
|
"content": {
|
|
25
25
|
"type": "string",
|
|
26
|
-
"description": "
|
|
26
|
+
"description": "方法论内容 (update/add 时必需)",
|
|
27
27
|
"optional": True
|
|
28
28
|
}
|
|
29
29
|
},
|
|
@@ -36,39 +36,39 @@ class MethodologyTool:
|
|
|
36
36
|
self._ensure_file_exists()
|
|
37
37
|
|
|
38
38
|
def _ensure_file_exists(self):
|
|
39
|
-
"""
|
|
39
|
+
"""确保方法论文件存在"""
|
|
40
40
|
if not os.path.exists(self.methodology_file):
|
|
41
41
|
try:
|
|
42
42
|
with open(self.methodology_file, 'w', encoding='utf-8') as f:
|
|
43
43
|
yaml.safe_dump({}, f, allow_unicode=True)
|
|
44
44
|
except Exception as e:
|
|
45
|
-
PrettyOutput.print(f"
|
|
45
|
+
PrettyOutput.print(f"创建方法论文件失败: {str(e)}", OutputType.ERROR)
|
|
46
46
|
|
|
47
47
|
def _load_methodologies(self) -> Dict:
|
|
48
|
-
"""
|
|
48
|
+
"""加载所有方法论"""
|
|
49
49
|
try:
|
|
50
50
|
with open(self.methodology_file, 'r', encoding='utf-8') as f:
|
|
51
51
|
return yaml.safe_load(f) or {}
|
|
52
52
|
except Exception as e:
|
|
53
|
-
PrettyOutput.print(f"
|
|
53
|
+
PrettyOutput.print(f"加载方法论失败: {str(e)}", OutputType.ERROR)
|
|
54
54
|
return {}
|
|
55
55
|
|
|
56
56
|
def _save_methodologies(self, methodologies: Dict):
|
|
57
|
-
"""
|
|
57
|
+
"""保存所有方法论"""
|
|
58
58
|
try:
|
|
59
59
|
with open(self.methodology_file, 'w', encoding='utf-8') as f:
|
|
60
60
|
yaml.safe_dump(methodologies, f, allow_unicode=True)
|
|
61
61
|
except Exception as e:
|
|
62
|
-
PrettyOutput.print(f"
|
|
62
|
+
PrettyOutput.print(f"保存方法论失败: {str(e)}", OutputType.ERROR)
|
|
63
63
|
|
|
64
64
|
def execute(self, args: Dict[str, Any]) -> Dict[str, Any]:
|
|
65
|
-
"""
|
|
65
|
+
"""执行方法论管理操作
|
|
66
66
|
|
|
67
67
|
Args:
|
|
68
68
|
args: 包含操作参数的字典
|
|
69
69
|
- operation: 操作类型 (delete/update/add)
|
|
70
70
|
- problem_type: 问题类型
|
|
71
|
-
- content:
|
|
71
|
+
- content: 方法论内容 (update/add 时必需)
|
|
72
72
|
|
|
73
73
|
Returns:
|
|
74
74
|
Dict[str, Any]: 包含执行结果的字典
|
|
@@ -92,19 +92,19 @@ class MethodologyTool:
|
|
|
92
92
|
self._save_methodologies(methodologies)
|
|
93
93
|
return {
|
|
94
94
|
"success": True,
|
|
95
|
-
"stdout": f"已删除问题类型 '{problem_type}'
|
|
95
|
+
"stdout": f"已删除问题类型 '{problem_type}' 的方法论"
|
|
96
96
|
}
|
|
97
97
|
else:
|
|
98
98
|
return {
|
|
99
99
|
"success": False,
|
|
100
|
-
"error": f"未找到问题类型 '{problem_type}'
|
|
100
|
+
"error": f"未找到问题类型 '{problem_type}' 的方法论"
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
elif operation in ["update", "add"]:
|
|
104
104
|
if not content:
|
|
105
105
|
return {
|
|
106
106
|
"success": False,
|
|
107
|
-
"error": "
|
|
107
|
+
"error": "需要提供方法论内容"
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
methodologies[problem_type] = content
|
|
@@ -113,7 +113,7 @@ class MethodologyTool:
|
|
|
113
113
|
action = "更新" if problem_type in methodologies else "添加"
|
|
114
114
|
return {
|
|
115
115
|
"success": True,
|
|
116
|
-
"stdout": f"已{action}问题类型 '{problem_type}'
|
|
116
|
+
"stdout": f"已{action}问题类型 '{problem_type}' 的方法论"
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
else:
|
|
@@ -129,13 +129,13 @@ class MethodologyTool:
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
def get_methodology(self, problem_type: str) -> Optional[str]:
|
|
132
|
-
"""
|
|
132
|
+
"""获取指定问题类型的方法论
|
|
133
133
|
|
|
134
134
|
Args:
|
|
135
135
|
problem_type: 问题类型
|
|
136
136
|
|
|
137
137
|
Returns:
|
|
138
|
-
Optional[str]:
|
|
138
|
+
Optional[str]: 方法论内容,如果不存在则返回 None
|
|
139
139
|
"""
|
|
140
140
|
methodologies = self._load_methodologies()
|
|
141
141
|
return methodologies.get(problem_type)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|