jarvis-ai-assistant 0.1.186__py3-none-any.whl → 0.1.187__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.1.186"
4
+ __version__ = "0.1.187"
@@ -436,7 +436,9 @@ class Agent:
436
436
  if self.conversation_length > self.max_token_count:
437
437
  message = self._summarize_and_clear_history() + "\n\n" + message
438
438
  self.conversation_length += get_context_token_count(message)
439
- return self.model.chat_until_success(message) # type: ignore
439
+ response = self.model.chat_until_success(message) # type: ignore
440
+ self.conversation_length += get_context_token_count(response)
441
+ return response
440
442
 
441
443
  def _summarize_and_clear_history(self) -> str:
442
444
  """总结当前对话并清理历史记录
@@ -780,27 +782,23 @@ arguments:
780
782
  # 如果有上传文件,先上传文件
781
783
  if self.files and isinstance(self.model, BasePlatform) and hasattr(self.model, "upload_files"):
782
784
  self.model.upload_files(self.files)
783
- self.prompt = f"{user_input}\n\n已上传{len(self.files)}个文件到平台"
785
+ self.prompt = f"{user_input}"
784
786
 
785
787
  # 如果启用方法论且没有上传文件,上传方法论
786
788
  elif self.use_methodology:
787
789
  platform = self.model if hasattr(self.model, "upload_files") else None
788
790
  if platform and upload_methodology(platform):
789
- self.prompt = f"{user_input}\n\n方法论已上传到平台,请参考平台上的方法论内容"
791
+ self.prompt = f"{user_input}"
790
792
  else:
791
793
  # 上传失败则回退到本地加载
792
794
  self.prompt = f"{user_input}\n\n以下是历史类似问题的执行经验,可参考:\n{load_methodology(user_input, self.get_tool_registry())}"
793
795
 
794
796
  self.first = False
795
797
 
796
- self.conversation_length = get_context_token_count(self.prompt)
797
798
  while True:
798
799
  try:
799
800
  current_response = self._call_model(self.prompt, True)
800
801
  self.prompt = ""
801
- self.conversation_length += get_context_token_count(
802
- current_response
803
- )
804
802
 
805
803
  need_return, self.prompt = self._call_tools(current_response)
806
804
 
@@ -35,7 +35,7 @@ def main():
35
35
  """Main entry point for Jarvis agent"""
36
36
  # Set up argument parser
37
37
  parser = argparse.ArgumentParser(description='Jarvis AI assistant')
38
- parser.add_argument('-f', '--config', type=str, required=True,
38
+ parser.add_argument('-f', '--config', type=str, required=False,
39
39
  help='Path to agent config file')
40
40
  parser.add_argument('-c', '--agent_definition', type=str,
41
41
  help='Path to agent definition file')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.186
3
+ Version: 0.1.187
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=2Jubd1by59etw8bG1OynB8re955CEag1nBes2ilDJD4,74
2
- jarvis/jarvis_agent/__init__.py,sha256=Mho0roePyuitHFjVCbK0_v9FPgEarcpvgIvY3sQKLws,30843
1
+ jarvis/__init__.py,sha256=asOF79piCkaX_uxiI4Oz9X7T0At-IuYPfb0XQlJZ6k8,74
2
+ jarvis/jarvis_agent/__init__.py,sha256=GBlsKYlZUpBekI7mTYFqAsmjXhlxMbIAoHkBpNjwt7M,30611
3
3
  jarvis/jarvis_agent/builtin_input_handler.py,sha256=f4DaEHPakXcAbgykFP-tiOQP6fh_yGFlZx_h91_j2tQ,1529
4
4
  jarvis/jarvis_agent/file_input_handler.py,sha256=7u8pXWD7F9mmiJkr9XO83mhFu40FSRoYQm55DbZHgQo,4203
5
5
  jarvis/jarvis_agent/jarvis.py,sha256=gOZfTwVlG-GZxPjgCoSiIcFsl4RwwfPA0CGUjE5J7oU,6249
6
- jarvis/jarvis_agent/main.py,sha256=EDHk8N4QD2ssS9yWnxXC7rYMgWdsHeHf3VSLIz31fBk,2851
6
+ jarvis/jarvis_agent/main.py,sha256=hgyf0QDESx88GlqYfGelxJ5HCpYOpm3FlcDXc-5jtjE,2852
7
7
  jarvis/jarvis_agent/output_handler.py,sha256=7qori-RGrQmdiFepoEe3oPPKJIvRt90l_JDmvCoa4zA,1219
8
8
  jarvis/jarvis_agent/shell_input_handler.py,sha256=pi3AtPKrkKc6K9e99S1djKXQ_XrxtP6FrSWebQmRT6E,1261
9
9
  jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -91,9 +91,9 @@ jarvis/jarvis_utils/methodology.py,sha256=A8pE8ZqNHvGKaDO4TFtg7Oz-hAXPBcQfhmSPWM
91
91
  jarvis/jarvis_utils/output.py,sha256=QboL42GtG_dnvd1O64sl8o72mEBhXNRADPXQMXgDE7Q,9661
92
92
  jarvis/jarvis_utils/tag.py,sha256=YJHmuedLb7_AiqvKQetHr4R1FxyzIh7HN0RRkWMmYbU,429
93
93
  jarvis/jarvis_utils/utils.py,sha256=dTFIN6EV48BuC4VOyvcVcj4P0tsWysc9ennbMRhLJjk,10960
94
- jarvis_ai_assistant-0.1.186.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
95
- jarvis_ai_assistant-0.1.186.dist-info/METADATA,sha256=9W9DQ__NkfHLemo6-uXEn62SiFyrg9iVuNSE2yPs2mE,15923
96
- jarvis_ai_assistant-0.1.186.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
97
- jarvis_ai_assistant-0.1.186.dist-info/entry_points.txt,sha256=Gy3DOP1PYLMK0GCj4rrP_9lkOyBQ39EK_lKGUSwn41E,869
98
- jarvis_ai_assistant-0.1.186.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
99
- jarvis_ai_assistant-0.1.186.dist-info/RECORD,,
94
+ jarvis_ai_assistant-0.1.187.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
95
+ jarvis_ai_assistant-0.1.187.dist-info/METADATA,sha256=lbhXX4AEUFxgJOFe_c2Sz40dB98YotFgNHHnhtB4WU4,15923
96
+ jarvis_ai_assistant-0.1.187.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
97
+ jarvis_ai_assistant-0.1.187.dist-info/entry_points.txt,sha256=Gy3DOP1PYLMK0GCj4rrP_9lkOyBQ39EK_lKGUSwn41E,869
98
+ jarvis_ai_assistant-0.1.187.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
99
+ jarvis_ai_assistant-0.1.187.dist-info/RECORD,,