jarvis-ai-assistant 0.1.19__py3-none-any.whl → 0.1.22__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.19"
3
+ __version__ = "0.1.22"
Binary file
Binary file
jarvis/agent.py CHANGED
@@ -11,7 +11,7 @@ import os
11
11
  from datetime import datetime
12
12
 
13
13
  class Agent:
14
- def __init__(self, model: BaseModel, tool_registry: ToolRegistry, name: str = "Jarvis"):
14
+ def __init__(self, model: BaseModel, tool_registry: ToolRegistry, name: str = "Jarvis", is_sub_agent: bool = False):
15
15
  """Initialize Agent with a model, optional tool registry and name
16
16
 
17
17
  Args:
@@ -23,6 +23,7 @@ class Agent:
23
23
  self.model = model
24
24
  self.tool_registry = tool_registry or ToolRegistry(model)
25
25
  self.name = name
26
+ self.is_sub_agent = is_sub_agent
26
27
  self.prompt = ""
27
28
 
28
29
 
@@ -77,7 +78,7 @@ class Agent:
77
78
  except Exception as e:
78
79
  raise Exception(f"{self.name}: 模型调用失败: {str(e)}")
79
80
 
80
- def run(self, user_input: str, file_list: Optional[List[str]] = None, keep_history: bool = False):
81
+ def run(self, user_input: str, file_list: Optional[List[str]] = None, keep_history: bool = False) -> str:
81
82
  """处理用户输入并返回响应,返回任务总结报告
82
83
 
83
84
  Args:
@@ -203,7 +204,23 @@ arguments:
203
204
 
204
205
  if not user_input:
205
206
  PrettyOutput.section("任务完成", OutputType.SUCCESS)
206
- return
207
+ if self.is_sub_agent:
208
+ # 生成任务总结
209
+ summary_prompt = f"""请对以上任务执行情况生成一个简洁的总结报告,包括:
210
+
211
+ 1. 任务目标: xxxx
212
+ 2. 执行结果: 成功/失败
213
+ 3. 关键信息: 提取执行过程中的重要信息
214
+ 4. 重要发现: 任何值得注意的发现
215
+ 5. 后续建议: 如果有的话
216
+
217
+ 请用简洁的要点形式描述,突出重要信息。
218
+ """
219
+ self.prompt = summary_prompt
220
+ summary = self.model.chat(self.prompt)
221
+ return summary
222
+ else:
223
+ return "Task completed"
207
224
 
208
225
  except Exception as e:
209
226
  PrettyOutput.print(str(e), OutputType.ERROR)
jarvis/tools/base.py CHANGED
@@ -115,7 +115,7 @@ class ToolRegistry:
115
115
  parameters=tool_instance.parameters,
116
116
  func=tool_instance.execute
117
117
  )
118
- self.output_handler.print(f"已加载工具: {tool_instance.name}", OutputType.INFO)
118
+ self.output_handler.print(f"已加载工具: {tool_instance.name}: {tool_instance.description}", OutputType.INFO)
119
119
  tool_found = True
120
120
 
121
121
  if not tool_found:
jarvis/tools/generator.py CHANGED
@@ -15,7 +15,7 @@ class ModelHandler(Protocol):
15
15
 
16
16
  class ToolGeneratorTool:
17
17
  name = "generate_tool"
18
- description = "生成新的工具代码并自动注册到ToolRegistry"
18
+ description = "生成新的工具代码并自动注册到Jarvis,自动扩充Jarvis的能力"
19
19
  parameters = {
20
20
  "type": "object",
21
21
  "properties": {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.19
3
+ Version: 0.1.22
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,9 +1,9 @@
1
- jarvis/__init__.py,sha256=ZS0T4CRb_B0dOsiPYPRNrunjMPVvZzmD9IIaUB29ig8,50
2
- jarvis/agent.py,sha256=r00CssF8HzSj4r2GXR9KNJ3XJk46HIjw4BEfzx-fKMQ,8114
1
+ jarvis/__init__.py,sha256=Ltq0PxhuQ9N0aWtdEVB8sZZp_5T574JJR69CubPKJW8,50
2
+ jarvis/agent.py,sha256=Srcz3RxRGItJG--etdt_juF4FN6-XnbsNx7fXPrTlhw,8876
3
3
  jarvis/main.py,sha256=tptQp6rjhHOSsPphmrtoxf7l78btnP_hJmr3hVMO4zg,8103
4
4
  jarvis/utils.py,sha256=YipQpEuIRwFE3y3YrgGlSVLEPDrlbBNY1gRiOJix9DU,6602
5
- jarvis/__pycache__/__init__.cpython-313.pyc,sha256=TnbFSQwCFYqlSRaAgJgfajYnPQVIUrqM9Pyj4QRQjDQ,209
6
- jarvis/__pycache__/agent.cpython-313.pyc,sha256=ItAH6Mb964vpqvziIsw-62avHUVu54mNgTa02VWK3lM,10855
5
+ jarvis/__pycache__/__init__.cpython-313.pyc,sha256=rR_OlOkGGLilqfXDD4v_hwWoZS5HYDeXP0BqMSXb8yQ,209
6
+ jarvis/__pycache__/agent.cpython-313.pyc,sha256=JAemMJtOmhmSzSYZeDC9Opi4jgtHKMbXbtFIpdiy2Fo,11814
7
7
  jarvis/__pycache__/main.cpython-313.pyc,sha256=uQ1QHMHR6EukOb7z-YOz8CicXRPEfiHyS7KRq15xxVw,10943
8
8
  jarvis/__pycache__/models.cpython-313.pyc,sha256=uWuRIjGrY4YDB3dGW5PGDLWaS03et8g11O725TjY_eU,5960
9
9
  jarvis/__pycache__/tools.cpython-313.pyc,sha256=lAD4LrnnWzNZQmHXGfZ_2l7oskOpr2_2OC-gdFhxQY8,33933
@@ -16,17 +16,17 @@ jarvis/models/__pycache__/__init__.cpython-313.pyc,sha256=jAwySX4diR7EWM_alK75ti
16
16
  jarvis/models/__pycache__/base.cpython-313.pyc,sha256=4I9KZlXHvTB7vENA9YWK4Fx0sns_KvIOtWqzE9y_-Co,1094
17
17
  jarvis/models/__pycache__/kimi.cpython-313.pyc,sha256=-hOwhZrfvqfd5K_c34Tm-uR3gaZ9r6EV1NtwV0-FDmg,13647
18
18
  jarvis/tools/__init__.py,sha256=AjmFYLXt-_ulZXdYiXya2fD7QCJ-RaK91PEZCNj-UbA,262
19
- jarvis/tools/base.py,sha256=ZHmRczYks7CuaYHU9uB5QnsD40G_jeqE6ubuhlaSFR8,7318
19
+ jarvis/tools/base.py,sha256=4LvbpUXDnLNu2r6S2G-luAPKRk_-6I6lfQQbxxiyIUw,7347
20
20
  jarvis/tools/file_ops.py,sha256=KbQLVCCXw-MtJg-12iyMeVGu8BTtLq7Mk7fpVKau40U,4296
21
- jarvis/tools/generator.py,sha256=VJXfZg0Xt3OZr1LtX8m-RJh9807VxZRah5xV7UtX6is,7406
21
+ jarvis/tools/generator.py,sha256=qURQ2ct61tRaN-CNhnbpjoj7recGGjFWnQUteKvej_g,7430
22
22
  jarvis/tools/shell.py,sha256=MWe9-BAGApbGJfR60XG4nElGYHNBnbdF9vsOQTnEZ4g,2989
23
23
  jarvis/tools/__pycache__/__init__.cpython-313.pyc,sha256=KC48FS57427navbkxZ0eDKLePMCH2BKc5vAIu0b8lFc,404
24
- jarvis/tools/__pycache__/base.cpython-313.pyc,sha256=r-jPPg5L_Rok2c_VsMEAXkhuiiUjHv6bLCwVjnONDRo,9861
24
+ jarvis/tools/__pycache__/base.cpython-313.pyc,sha256=Pw89qn1ZMSNdU03CoM4ezkAHEiP_iTZEWceGg1TE_mk,9913
25
25
  jarvis/tools/__pycache__/bing_search.cpython-313.pyc,sha256=1G_wPbk5wcQYh7H0drLIS2Aw0XOG2ZM8ztgfQaqu3P8,2031
26
26
  jarvis/tools/__pycache__/calculator.cpython-313.pyc,sha256=C_qwTDGm6gc7QNxtPzPZXyStdKEintJVQIt5NMHQ8oY,4205
27
27
  jarvis/tools/__pycache__/calculator_tool.cpython-313.pyc,sha256=PI4LZNDTPdSe3ffWDRovLZ-r-vF8Kl-n6xdGdFWiBpY,4296
28
28
  jarvis/tools/__pycache__/file_ops.cpython-313.pyc,sha256=OBR2EDQ2Ana7CTtLOoM5AYJzyVwP683LS7QrOR8_I3g,5208
29
- jarvis/tools/__pycache__/generator.cpython-313.pyc,sha256=3XTMBphRw7gqRqJXPuQrA4_6FirinFZ3khd7LiCy7uU,8746
29
+ jarvis/tools/__pycache__/generator.cpython-313.pyc,sha256=EXK5lveBUQqOnpHRsAvYHZFCso350-OchiHJc62wEVQ,8770
30
30
  jarvis/tools/__pycache__/python_script.cpython-313.pyc,sha256=8JpryqTovEiTvBlWAK1KjZmPvHUuPc9GT9rTXBEQoJc,6693
31
31
  jarvis/tools/__pycache__/rag.cpython-313.pyc,sha256=JH6-PSZRMKAvTZqCwlRXJGClxYXNMs-vetU0q7hBLz0,6064
32
32
  jarvis/tools/__pycache__/search.cpython-313.pyc,sha256=wLMIkFwT-h4NGHgssytT4xme7sGO6ZhEnex7kjcy0-k,5990
@@ -36,9 +36,9 @@ jarvis/tools/__pycache__/user_confirmation.cpython-313.pyc,sha256=wK3Ev10lHSUSRv
36
36
  jarvis/tools/__pycache__/user_input.cpython-313.pyc,sha256=JjTFOhObKsKF4Pn8KBRuKfV1_Ssj083fjU7Mfc_5z7c,2531
37
37
  jarvis/tools/__pycache__/user_interaction.cpython-313.pyc,sha256=RuVZ-pmiPBDywY3efgXSfohMAciC1avMGPmBK5qlnew,3305
38
38
  jarvis/tools/__pycache__/webpage.cpython-313.pyc,sha256=BjzSfnNzsKCrLETCcWjt32lNDLzwnjqcVGg4JfWd9OM,3008
39
- jarvis_ai_assistant-0.1.19.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
40
- jarvis_ai_assistant-0.1.19.dist-info/METADATA,sha256=SPaJ0q7U024HA6W3sagtO6SlmDizohRfXhCBEuFMdrM,10193
41
- jarvis_ai_assistant-0.1.19.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
42
- jarvis_ai_assistant-0.1.19.dist-info/entry_points.txt,sha256=iKu7OMfew9dtfGhW71gIMTg4wvafuPqKb4wyQOnMAGU,44
43
- jarvis_ai_assistant-0.1.19.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
44
- jarvis_ai_assistant-0.1.19.dist-info/RECORD,,
39
+ jarvis_ai_assistant-0.1.22.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
40
+ jarvis_ai_assistant-0.1.22.dist-info/METADATA,sha256=OzkgBU0mQbrNVdQ5qsdCBsqhXI0mXk-QwNC9A_WMpBc,10193
41
+ jarvis_ai_assistant-0.1.22.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
42
+ jarvis_ai_assistant-0.1.22.dist-info/entry_points.txt,sha256=iKu7OMfew9dtfGhW71gIMTg4wvafuPqKb4wyQOnMAGU,44
43
+ jarvis_ai_assistant-0.1.22.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
44
+ jarvis_ai_assistant-0.1.22.dist-info/RECORD,,