jarvis-ai-assistant 0.3.12__py3-none-any.whl → 0.3.13__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.
jarvis/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Jarvis AI Assistant"""
3
3
 
4
- __version__ = "0.3.12"
4
+ __version__ = "0.3.13"
@@ -180,11 +180,11 @@ origin_agent_system_prompt = f"""
180
180
 
181
181
 
182
182
  class Agent:
183
- def clear(self):
183
+ def clear_history(self):
184
184
  """
185
185
  Clears the current conversation history by delegating to the session manager.
186
186
  """
187
- self.session.clear()
187
+ self.session.clear_history()
188
188
 
189
189
  def __del__(self):
190
190
  # 只有在记录启动时才停止记录
@@ -284,7 +284,9 @@ class Agent:
284
284
 
285
285
  self.model = PlatformRegistry().create_platform(platform_name)
286
286
  if self.model is None:
287
- PrettyOutput.print(f"平台 {platform_name} 不存在,将使用普通模型", OutputType.WARNING)
287
+ PrettyOutput.print(
288
+ f"平台 {platform_name} 不存在,将使用普通模型", OutputType.WARNING
289
+ )
288
290
  self.model = PlatformRegistry().get_normal_platform()
289
291
 
290
292
  if model_name:
@@ -715,12 +717,18 @@ class Agent:
715
717
  if isinstance(interrupt_result, tuple):
716
718
  run_input_handlers, should_continue = interrupt_result
717
719
  if should_continue:
720
+ self.run_input_handlers_next_turn = True
718
721
  continue
719
722
  else:
720
723
  return interrupt_result
721
724
 
722
725
  # 处理工具调用
723
- need_return, self.session.prompt = self._call_tools(current_response)
726
+ need_return, prompt = self._call_tools(current_response)
727
+ if self.session.prompt and prompt:
728
+ self.session.prompt += "\n\n" + prompt
729
+ else:
730
+ self.session.prompt = prompt
731
+
724
732
  if need_return:
725
733
  return self.session.prompt
726
734
 
@@ -785,7 +793,9 @@ class Agent:
785
793
  返回:
786
794
  str: "continue" 或 "complete"
787
795
  """
788
- user_input = self.multiline_inputer(f"{self.name}: 请输入,或输入空行来结束当前任务:")
796
+ user_input = self.multiline_inputer(
797
+ f"{self.name}: 请输入,或输入空行来结束当前任务:"
798
+ )
789
799
 
790
800
  if user_input:
791
801
  self.session.prompt = user_input
@@ -871,9 +881,3 @@ class Agent:
871
881
  organizer.organize_memories(memory_type, min_overlap=3)
872
882
  else:
873
883
  PrettyOutput.print(f"已取消 '{scope_name}' 记忆库整理。", OutputType.INFO)
874
-
875
- def clear_history(self):
876
- """
877
- Clears conversation history by delegating to the session manager.
878
- """
879
- self.session.clear_history()
@@ -43,7 +43,7 @@ def builtin_input_handler(user_input: str, agent_: Any) -> Tuple[str, bool]:
43
43
  prompt = memory_tags_prompt
44
44
  return prompt, True
45
45
  elif tag == "Clear":
46
- agent.clear()
46
+ agent.clear_history()
47
47
  return "", True
48
48
  elif tag == "ToolUsage":
49
49
  agent.set_addon_prompt(agent.get_tool_usage_prompt())
@@ -34,14 +34,6 @@ class SessionManager:
34
34
  """Sets the addon prompt for the next model call."""
35
35
  self.addon_prompt = addon_prompt
36
36
 
37
- def clear(self):
38
- """
39
- Clears the current conversation history, prompt, and length counter.
40
- """
41
- self.model.reset()
42
- self.conversation_length = 0
43
- self.prompt = ""
44
-
45
37
  def save_session(self) -> bool:
46
38
  """Saves the current session state to a file."""
47
39
  session_dir = os.path.join(os.getcwd(), ".jarvis")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.3.12
3
+ Version: 0.3.13
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,7 +1,7 @@
1
- jarvis/__init__.py,sha256=hKFiP0Zvdw8obyd8zdfmd9Lpchych2UJUzD76YYyLMY,74
2
- jarvis/jarvis_agent/__init__.py,sha256=stw0ptywcW6DwUjLHd8gjdvRwlIkL26W5OqoqwLvg9g,31738
1
+ jarvis/__init__.py,sha256=sNG-zIDnzHZonw0jMokUfOeIX1O9_pvk1H7gGrXcEUI,74
2
+ jarvis/jarvis_agent/__init__.py,sha256=vpioyz2E-F4hTK0A2isCbdeH6_90kfZ3FM-I5_mOnaM,31879
3
3
  jarvis/jarvis_agent/agent_manager.py,sha256=YzpMiF0H2-eyk2kn2o24Bkj3bXsQx7Pv2vfD4gWepo0,2893
4
- jarvis/jarvis_agent/builtin_input_handler.py,sha256=0rrztbSWDyCVTAPGHMSkTMWdwdcb4zhRwkq19lQ8anY,2909
4
+ jarvis/jarvis_agent/builtin_input_handler.py,sha256=wS-FqpT3pIXwHn1dfL3SpXonUKWgVThbQueUIeyRc2U,2917
5
5
  jarvis/jarvis_agent/config_editor.py,sha256=Ctk82sO6w2cNW0-_5L7Bomj-hgM4U7WwMc52fwhAJyg,1809
6
6
  jarvis/jarvis_agent/edit_file_handler.py,sha256=w-byNJ4TN_SlV3djjfFC7OksySOFGrM8ku49w662dzc,11854
7
7
  jarvis/jarvis_agent/file_methodology_manager.py,sha256=PwDUQwq7HVIyPInsN8fgWyMXLwi8heIXPrqfBZJhVHs,4260
@@ -13,7 +13,7 @@ jarvis/jarvis_agent/output_handler.py,sha256=P7oWpXBGFfOsWq7cIhS_z9crkQ19ES7qU5p
13
13
  jarvis/jarvis_agent/prompt_builder.py,sha256=PH1fPDVa8z_RXkoXHJFNDf8PQjUoLNLYwkh2lC__p40,1705
14
14
  jarvis/jarvis_agent/prompts.py,sha256=X6cXa-n0xqBQ8LDTgLsD0kqziAh1s0cNp89i4mxcvHg,9444
15
15
  jarvis/jarvis_agent/protocols.py,sha256=JWnJDikFEuwvFUv7uzXu0ggJ4O9K2FkMnfVCwIJ5REw,873
16
- jarvis/jarvis_agent/session_manager.py,sha256=DnvI9rWkVmkyO1XfKZyo9lTn4ajg4ccwzEkoRHFPOJM,2925
16
+ jarvis/jarvis_agent/session_manager.py,sha256=xPeQcQRBmAlc-CGAzVz4MTOKhZKb27rTS-5De3Oauwg,2713
17
17
  jarvis/jarvis_agent/share_manager.py,sha256=wFcdULSog1mMxDyB94ofbqitFL8DCX8i1u6qVzSEuAk,8704
18
18
  jarvis/jarvis_agent/shell_input_handler.py,sha256=1IboqdxcJuoIqRpmDU10GugR9fWXUHyCEbVF4nIWbyo,1328
19
19
  jarvis/jarvis_agent/task_analyzer.py,sha256=-fQ9YBYFcc-Z1FSoDIPzRfAgkREFoIOXtU2TdBkB-e0,4656
@@ -119,9 +119,9 @@ jarvis/jarvis_utils/methodology.py,sha256=IIMU17WVSunsWXsnXROd4G77LxgYs4xEC_xm_0
119
119
  jarvis/jarvis_utils/output.py,sha256=QRLlKObQKT0KuRSeZRqYb7NlTQvsd1oZXZ41WxeWEuU,10894
120
120
  jarvis/jarvis_utils/tag.py,sha256=f211opbbbTcSyzCDwuIK_oCnKhXPNK-RknYyGzY1yD0,431
121
121
  jarvis/jarvis_utils/utils.py,sha256=LiVui9RMsbfUdzbvBBwbGNC4uniGnLp3LFsk7LXGrQE,47370
122
- jarvis_ai_assistant-0.3.12.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
123
- jarvis_ai_assistant-0.3.12.dist-info/METADATA,sha256=cuuexl5WsxPeiGwbal3UnCBnK2lolNhK-G8d6J2PjbY,18216
124
- jarvis_ai_assistant-0.3.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
125
- jarvis_ai_assistant-0.3.12.dist-info/entry_points.txt,sha256=4GcWKFxRJD-QU14gw_3ZaW4KuEVxOcZK9i270rwPdjA,1395
126
- jarvis_ai_assistant-0.3.12.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
127
- jarvis_ai_assistant-0.3.12.dist-info/RECORD,,
122
+ jarvis_ai_assistant-0.3.13.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
123
+ jarvis_ai_assistant-0.3.13.dist-info/METADATA,sha256=YJ01G5YB7gEX59rrdrPw6xb-0p_pdg-KT5318_yl3t4,18216
124
+ jarvis_ai_assistant-0.3.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
125
+ jarvis_ai_assistant-0.3.13.dist-info/entry_points.txt,sha256=4GcWKFxRJD-QU14gw_3ZaW4KuEVxOcZK9i270rwPdjA,1395
126
+ jarvis_ai_assistant-0.3.13.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
127
+ jarvis_ai_assistant-0.3.13.dist-info/RECORD,,