jarvis-ai-assistant 0.1.61__py3-none-any.whl → 0.1.63__py3-none-any.whl

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/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Jarvis AI Assistant"""
2
2
 
3
- __version__ = "0.1.61"
3
+ __version__ = "0.1.63"
jarvis/agent.py CHANGED
@@ -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": "经验总结内容 (update/add 时必需)",
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"创建经验总结文件失败: {str(e)}", OutputType.ERROR)
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"加载经验总结失败: {str(e)}", OutputType.ERROR)
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"保存经验总结失败: {str(e)}", OutputType.ERROR)
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: 经验总结内容 (update/add 时必需)
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]: 经验总结内容,如果不存在则返回 None
138
+ Optional[str]: 方法论内容,如果不存在则返回 None
139
139
  """
140
140
  methodologies = self._load_methodologies()
141
141
  return methodologies.get(problem_type)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.61
3
+ Version: 0.1.63
4
4
  Summary: Jarvis: An AI assistant that uses tools to interact with the system
5
5
  Home-page: https://github.com/skyfireitdiy/Jarvis
6
6
  Author: skyfire
@@ -1,5 +1,5 @@
1
- jarvis/__init__.py,sha256=hXWmKj3rApgD-Yzo4jt2kZEsepnNS-DfVUFCBFc79b0,50
2
- jarvis/agent.py,sha256=rL3QMLD-48KMrRmiq8eU9T4ftdJdYVLg48e7df5Mg4E,14660
1
+ jarvis/__init__.py,sha256=sZ5DQXpur0P2tY_PCFzbnYK8EQLpCoUcnhPRL-xFwRg,50
2
+ jarvis/agent.py,sha256=aIth7geQ2ZIugBYjW_Rx3sr-I6NuZtH1INEj4hOBVD4,14242
3
3
  jarvis/main.py,sha256=gXXtnrkkvGwEswJL6qiYjVrg3bpzye-GJeAe0Nf2B9o,6509
4
4
  jarvis/utils.py,sha256=JlkuC9RtspXH2VWDmj9nR0vnb8ie1gIsKc4vC7WRco8,7321
5
5
  jarvis/jarvis_coder/main.py,sha256=TosDDiaYSjDpzKPNKcygxZ3XXWbcnvBmIIMn3UMBc60,35102
@@ -15,15 +15,15 @@ jarvis/tools/base.py,sha256=EGRGbdfbLXDLwtyoWdvp9rlxNX7bzc20t0Vc2VkwIEY,652
15
15
  jarvis/tools/coder.py,sha256=ZJfPInKms4Hj3-eQlBwamVsvZ-2nlZ-4jsqJ-tJc6mg,2040
16
16
  jarvis/tools/file_ops.py,sha256=h8g0eT9UvlJf4kt0DLXvdSsjcPj7x19lxWdDApeDfpg,3842
17
17
  jarvis/tools/generator.py,sha256=vVP3eN5cCDpRXf_fn0skETkPXAW1XZFWx9pt2_ahK48,5999
18
- jarvis/tools/methodology.py,sha256=G3cOaHTMujGZBhDLhQEqyCV2NISizO3MXRuho1KfI6Y,5223
18
+ jarvis/tools/methodology.py,sha256=UG6s5VYRcd9wrKX4cg6f7zJhet5AIcthFGMOAdevBiw,5175
19
19
  jarvis/tools/registry.py,sha256=mlOAmUq3yzRz-7yvwrrCwbe5Lmw8eh1v8-_Fa5sezwI,7209
20
20
  jarvis/tools/search.py,sha256=1EqOVvLhg2Csh-i03-XeCrusbyfmH69FZ8khwZt8Tow,6131
21
21
  jarvis/tools/shell.py,sha256=UPKshPyOaUwTngresUw-ot1jHjQIb4wCY5nkJqa38lU,2520
22
22
  jarvis/tools/sub_agent.py,sha256=rEtAmSVY2ZjFOZEKr5m5wpACOQIiM9Zr_3dT92FhXYU,2621
23
23
  jarvis/tools/webpage.py,sha256=d3w3Jcjcu1ESciezTkz3n3Zf-rp_l91PrVoDEZnckOo,2391
24
- jarvis_ai_assistant-0.1.61.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
25
- jarvis_ai_assistant-0.1.61.dist-info/METADATA,sha256=GAXcRDc-6S5k0wEoSdTkD-n-_RcFGcnjqTnabBDPjow,11213
26
- jarvis_ai_assistant-0.1.61.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
27
- jarvis_ai_assistant-0.1.61.dist-info/entry_points.txt,sha256=ieRI4ilnGNx1R6LlzT2P510mJ27lhLesVZToezDjSd8,89
28
- jarvis_ai_assistant-0.1.61.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
29
- jarvis_ai_assistant-0.1.61.dist-info/RECORD,,
24
+ jarvis_ai_assistant-0.1.63.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
25
+ jarvis_ai_assistant-0.1.63.dist-info/METADATA,sha256=8Kq0xkFkfbqX9sB6kR3h9yKJhtb2T5hgeVBy_1Onyx4,11213
26
+ jarvis_ai_assistant-0.1.63.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
27
+ jarvis_ai_assistant-0.1.63.dist-info/entry_points.txt,sha256=ieRI4ilnGNx1R6LlzT2P510mJ27lhLesVZToezDjSd8,89
28
+ jarvis_ai_assistant-0.1.63.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
29
+ jarvis_ai_assistant-0.1.63.dist-info/RECORD,,