jarvis-ai-assistant 0.1.214__py3-none-any.whl → 0.1.217__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 +1 -1
- jarvis/jarvis_agent/__init__.py +32 -18
- jarvis/jarvis_agent/jarvis.py +17 -1
- jarvis/jarvis_code_agent/code_agent.py +12 -4
- jarvis/jarvis_platform/ai8.py +8 -2
- jarvis/jarvis_platform/base.py +12 -2
- jarvis/jarvis_platform/human.py +5 -2
- jarvis/jarvis_platform/kimi.py +8 -3
- jarvis/jarvis_platform/openai.py +10 -1
- jarvis/jarvis_platform/oyi.py +8 -2
- jarvis/jarvis_platform/registry.py +17 -7
- jarvis/jarvis_platform/tongyi.py +15 -4
- jarvis/jarvis_platform/yuanbao.py +8 -3
- jarvis/jarvis_utils/input.py +4 -3
- {jarvis_ai_assistant-0.1.214.dist-info → jarvis_ai_assistant-0.1.217.dist-info}/METADATA +2 -1
- {jarvis_ai_assistant-0.1.214.dist-info → jarvis_ai_assistant-0.1.217.dist-info}/RECORD +20 -20
- {jarvis_ai_assistant-0.1.214.dist-info → jarvis_ai_assistant-0.1.217.dist-info}/WHEEL +0 -0
- {jarvis_ai_assistant-0.1.214.dist-info → jarvis_ai_assistant-0.1.217.dist-info}/entry_points.txt +0 -0
- {jarvis_ai_assistant-0.1.214.dist-info → jarvis_ai_assistant-0.1.217.dist-info}/licenses/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.214.dist-info → jarvis_ai_assistant-0.1.217.dist-info}/top_level.txt +0 -0
jarvis/__init__.py
CHANGED
jarvis/jarvis_agent/__init__.py
CHANGED
@@ -119,17 +119,13 @@ origin_agent_system_prompt = f"""
|
|
119
119
|
|
120
120
|
|
121
121
|
class OutputHandlerProtocol(Protocol):
|
122
|
-
def name(self) -> str:
|
123
|
-
...
|
122
|
+
def name(self) -> str: ...
|
124
123
|
|
125
|
-
def can_handle(self, response: str) -> bool:
|
126
|
-
...
|
124
|
+
def can_handle(self, response: str) -> bool: ...
|
127
125
|
|
128
|
-
def prompt(self) -> str:
|
129
|
-
...
|
126
|
+
def prompt(self) -> str: ...
|
130
127
|
|
131
|
-
def handle(self, response: str, agent: Any) -> Tuple[bool, Any]:
|
132
|
-
...
|
128
|
+
def handle(self, response: str, agent: Any) -> Tuple[bool, Any]: ...
|
133
129
|
|
134
130
|
|
135
131
|
class Agent:
|
@@ -195,7 +191,9 @@ class Agent:
|
|
195
191
|
if isinstance(platform, str):
|
196
192
|
self.model = PlatformRegistry().create_platform(platform)
|
197
193
|
if self.model is None:
|
198
|
-
PrettyOutput.print(
|
194
|
+
PrettyOutput.print(
|
195
|
+
f"平台 {platform} 不存在,将使用普通模型", OutputType.WARNING
|
196
|
+
)
|
199
197
|
self.model = PlatformRegistry().get_normal_platform()
|
200
198
|
else:
|
201
199
|
self.model = platform
|
@@ -365,14 +363,24 @@ class Agent:
|
|
365
363
|
return False
|
366
364
|
session_dir = os.path.join(os.getcwd(), ".jarvis")
|
367
365
|
os.makedirs(session_dir, exist_ok=True)
|
368
|
-
|
366
|
+
platform_name = self.model.platform_name()
|
367
|
+
model_name = self.model.name().replace("/", "_").replace("\\", "_")
|
368
|
+
session_file = os.path.join(
|
369
|
+
session_dir, f"saved_session_{self.name}_{platform_name}_{model_name}.json"
|
370
|
+
)
|
369
371
|
return self.model.save(session_file)
|
370
372
|
|
371
373
|
def restore_session(self) -> bool:
|
372
374
|
"""从文件恢复会话状态"""
|
373
375
|
if not self.model:
|
374
376
|
return False # No model, cannot restore
|
375
|
-
|
377
|
+
platform_name = self.model.platform_name()
|
378
|
+
model_name = self.model.name().replace("/", "_").replace("\\", "_")
|
379
|
+
session_file = os.path.join(
|
380
|
+
os.getcwd(),
|
381
|
+
".jarvis",
|
382
|
+
f"saved_session_{self.name}_{platform_name}_{model_name}.json",
|
383
|
+
)
|
376
384
|
if not os.path.exists(session_file):
|
377
385
|
return False
|
378
386
|
|
@@ -810,14 +818,18 @@ arguments:
|
|
810
818
|
|
811
819
|
if get_interrupt():
|
812
820
|
set_interrupt(False)
|
813
|
-
user_input = self.multiline_inputer(
|
821
|
+
user_input = self.multiline_inputer(
|
822
|
+
f"模型交互期间被中断,请输入用户干预信息:"
|
823
|
+
)
|
814
824
|
if user_input:
|
815
825
|
# 如果有工具调用且用户确认继续,则将干预信息和工具执行结果拼接为prompt
|
816
826
|
if any(
|
817
827
|
handler.can_handle(current_response)
|
818
828
|
for handler in self.output_handler
|
819
829
|
):
|
820
|
-
if user_confirm(
|
830
|
+
if user_confirm(
|
831
|
+
"检测到有工具调用,是否继续处理工具调用?", True
|
832
|
+
):
|
821
833
|
self.prompt = f"{user_input}\n\n{current_response}"
|
822
834
|
continue
|
823
835
|
self.prompt += f"{user_input}"
|
@@ -863,7 +875,9 @@ arguments:
|
|
863
875
|
if self.use_methodology:
|
864
876
|
if not upload_methodology(self.model, other_files=self.files):
|
865
877
|
if self.files:
|
866
|
-
PrettyOutput.print(
|
878
|
+
PrettyOutput.print(
|
879
|
+
"文件上传失败,将忽略文件列表", OutputType.WARNING
|
880
|
+
)
|
867
881
|
# 上传失败则回退到本地加载
|
868
882
|
msg = self.prompt
|
869
883
|
for handler in self.input_handler:
|
@@ -871,14 +885,14 @@ arguments:
|
|
871
885
|
self.prompt = f"{self.prompt}\n\n以下是历史类似问题的执行经验,可参考:\n{load_methodology(msg, self.get_tool_registry())}"
|
872
886
|
else:
|
873
887
|
if self.files:
|
874
|
-
self.prompt =
|
875
|
-
f"{self.prompt}\n\n上传的文件包含历史对话信息和方法论文件,可以从中获取一些经验信息。"
|
876
|
-
)
|
888
|
+
self.prompt = f"{self.prompt}\n\n上传的文件包含历史对话信息和方法论文件,可以从中获取一些经验信息。"
|
877
889
|
else:
|
878
890
|
self.prompt = f"{self.prompt}\n\n上传的文件包含历史对话信息,可以从中获取一些经验信息。"
|
879
891
|
elif self.files:
|
880
892
|
if not self.model.upload_files(self.files):
|
881
|
-
PrettyOutput.print(
|
893
|
+
PrettyOutput.print(
|
894
|
+
"文件上传失败,将忽略文件列表", OutputType.WARNING
|
895
|
+
)
|
882
896
|
else:
|
883
897
|
self.prompt = f"{self.prompt}\n\n上传的文件包含历史对话信息,可以从中获取一些经验信息。"
|
884
898
|
else:
|
jarvis/jarvis_agent/jarvis.py
CHANGED
@@ -112,9 +112,18 @@ def main() -> None:
|
|
112
112
|
parser.add_argument("-p", "--platform", type=str, help="Platform to use")
|
113
113
|
parser.add_argument("-m", "--model", type=str, help="Model to use")
|
114
114
|
parser.add_argument(
|
115
|
-
"-t",
|
115
|
+
"-t",
|
116
|
+
"--task",
|
117
|
+
type=str,
|
118
|
+
help="Directly input task content from command line",
|
116
119
|
)
|
117
120
|
parser.add_argument("-f", "--config", type=str, help="Path to custom config file")
|
121
|
+
parser.add_argument(
|
122
|
+
"--restore-session",
|
123
|
+
action="store_true",
|
124
|
+
help="Restore session from .jarvis/saved_session.json",
|
125
|
+
default=False,
|
126
|
+
)
|
118
127
|
args = parser.parse_args()
|
119
128
|
init_env(
|
120
129
|
"欢迎使用 Jarvis AI 助手,您的智能助理已准备就绪!", config_file=args.config
|
@@ -130,6 +139,13 @@ def main() -> None:
|
|
130
139
|
need_summary=False,
|
131
140
|
)
|
132
141
|
|
142
|
+
# 尝试恢复会话
|
143
|
+
if args.restore_session:
|
144
|
+
if agent.restore_session():
|
145
|
+
PrettyOutput.print("会话已成功恢复。", OutputType.SUCCESS)
|
146
|
+
else:
|
147
|
+
PrettyOutput.print("无法恢复会话。", OutputType.WARNING)
|
148
|
+
|
133
149
|
# 优先处理命令行直接传入的任务
|
134
150
|
if args.task:
|
135
151
|
agent.run(args.task)
|
@@ -419,6 +419,9 @@ def main() -> None:
|
|
419
419
|
parser.add_argument(
|
420
420
|
"-r", "--requirement", type=str, help="Requirement to process", default=None
|
421
421
|
)
|
422
|
+
parser.add_argument(
|
423
|
+
"--restore-session", action="store_true", help="Restore session from .jarvis/saved_session.json", default=False
|
424
|
+
)
|
422
425
|
args = parser.parse_args()
|
423
426
|
|
424
427
|
curr_dir = os.getcwd()
|
@@ -429,10 +432,15 @@ def main() -> None:
|
|
429
432
|
agent = CodeAgent(platform=args.platform, model=args.model, need_summary=False)
|
430
433
|
|
431
434
|
# 尝试恢复会话
|
432
|
-
if
|
433
|
-
|
434
|
-
|
435
|
-
|
435
|
+
if args.restore_session:
|
436
|
+
if agent.agent.restore_session():
|
437
|
+
PrettyOutput.print(
|
438
|
+
"已从 .jarvis/saved_session.json 恢复会话。", OutputType.SUCCESS
|
439
|
+
)
|
440
|
+
else:
|
441
|
+
PrettyOutput.print(
|
442
|
+
"无法从 .jarvis/saved_session.json 恢复会话。", OutputType.WARNING
|
443
|
+
)
|
436
444
|
|
437
445
|
if args.requirement:
|
438
446
|
agent.run(args.requirement)
|
jarvis/jarvis_platform/ai8.py
CHANGED
@@ -12,7 +12,6 @@ from jarvis.jarvis_utils.utils import while_success
|
|
12
12
|
class AI8Model(BasePlatform):
|
13
13
|
"""AI8 model implementation"""
|
14
14
|
|
15
|
-
platform_name = "ai8"
|
16
15
|
BASE_URL = "https://ai8.rcouyi.com"
|
17
16
|
|
18
17
|
def get_model_list(self) -> List[Tuple[str, str]]:
|
@@ -167,6 +166,11 @@ class AI8Model(BasePlatform):
|
|
167
166
|
"""Return model name"""
|
168
167
|
return self.model_name
|
169
168
|
|
169
|
+
@classmethod
|
170
|
+
def platform_name(cls) -> str:
|
171
|
+
"""Return platform name"""
|
172
|
+
return "ai8"
|
173
|
+
|
170
174
|
def delete_chat(self) -> bool:
|
171
175
|
"""Delete current chat session"""
|
172
176
|
try:
|
@@ -235,7 +239,9 @@ class AI8Model(BasePlatform):
|
|
235
239
|
PrettyOutput.print(f"会话文件未找到: {file_path}", OutputType.ERROR)
|
236
240
|
return False
|
237
241
|
except KeyError as e:
|
238
|
-
PrettyOutput.print(
|
242
|
+
PrettyOutput.print(
|
243
|
+
f"恢复失败: 会话文件格式不正确,缺少键 {e}", OutputType.ERROR
|
244
|
+
)
|
239
245
|
return False
|
240
246
|
except Exception as e:
|
241
247
|
PrettyOutput.print(f"恢复会话失败: {str(e)}", OutputType.ERROR)
|
jarvis/jarvis_platform/base.py
CHANGED
@@ -95,10 +95,14 @@ class BasePlatform(ABC):
|
|
95
95
|
):
|
96
96
|
response += trunk
|
97
97
|
|
98
|
-
print(
|
98
|
+
print(
|
99
|
+
f"📤 提交第{submit_count}部分完成,当前进度:{length}/{len(message)}"
|
100
|
+
)
|
99
101
|
print("✅ 提交完成")
|
100
102
|
response += "\n" + while_true(
|
101
|
-
lambda: while_success(
|
103
|
+
lambda: while_success(
|
104
|
+
lambda: self._chat("内容已经全部提供完毕,请根据内容继续"), 5
|
105
|
+
),
|
102
106
|
5,
|
103
107
|
)
|
104
108
|
else:
|
@@ -176,6 +180,12 @@ class BasePlatform(ABC):
|
|
176
180
|
"""Model name"""
|
177
181
|
raise NotImplementedError("name is not implemented")
|
178
182
|
|
183
|
+
@classmethod
|
184
|
+
@abstractmethod
|
185
|
+
def platform_name(cls) -> str:
|
186
|
+
"""Platform name"""
|
187
|
+
raise NotImplementedError("platform_name is not implemented")
|
188
|
+
|
179
189
|
@abstractmethod
|
180
190
|
def delete_chat(self) -> bool:
|
181
191
|
"""Delete chat"""
|
jarvis/jarvis_platform/human.py
CHANGED
@@ -17,8 +17,6 @@ from jarvis.jarvis_utils.output import OutputType, PrettyOutput
|
|
17
17
|
class HumanPlatform(BasePlatform):
|
18
18
|
"""人类交互平台实现,模拟大模型但实际上与人交互"""
|
19
19
|
|
20
|
-
platform_name = "human"
|
21
|
-
|
22
20
|
def get_model_list(self) -> List[Tuple[str, str]]:
|
23
21
|
"""获取支持的模型列表"""
|
24
22
|
return [("human", "Human Interaction")]
|
@@ -126,6 +124,11 @@ class HumanPlatform(BasePlatform):
|
|
126
124
|
"""平台名称"""
|
127
125
|
return self.model_name
|
128
126
|
|
127
|
+
@classmethod
|
128
|
+
def platform_name(cls) -> str:
|
129
|
+
"""平台名称"""
|
130
|
+
return "human"
|
131
|
+
|
129
132
|
def support_web(self) -> bool:
|
130
133
|
"""是否支持网页浏览功能"""
|
131
134
|
return False
|
jarvis/jarvis_platform/kimi.py
CHANGED
@@ -21,8 +21,6 @@ class KimiModel(BasePlatform):
|
|
21
21
|
- 消息收发
|
22
22
|
"""
|
23
23
|
|
24
|
-
platform_name = "kimi"
|
25
|
-
|
26
24
|
def get_model_list(self) -> List[Tuple[str, str]]:
|
27
25
|
"""Get model list"""
|
28
26
|
return [
|
@@ -70,7 +68,9 @@ class KimiModel(BasePlatform):
|
|
70
68
|
sleep_time=5,
|
71
69
|
)
|
72
70
|
if response.status_code != 200:
|
73
|
-
PrettyOutput.print(
|
71
|
+
PrettyOutput.print(
|
72
|
+
f"错误:创建会话失败:{response.json()}", OutputType.ERROR
|
73
|
+
)
|
74
74
|
return False
|
75
75
|
self.chat_id = response.json()["id"]
|
76
76
|
return True
|
@@ -415,6 +415,11 @@ class KimiModel(BasePlatform):
|
|
415
415
|
"""Model name"""
|
416
416
|
return self.model_name
|
417
417
|
|
418
|
+
@classmethod
|
419
|
+
def platform_name(cls) -> str:
|
420
|
+
"""Platform name"""
|
421
|
+
return "kimi"
|
422
|
+
|
418
423
|
def support_web(self) -> bool:
|
419
424
|
"""Kimi平台支持web功能"""
|
420
425
|
return True
|
jarvis/jarvis_platform/openai.py
CHANGED
@@ -10,7 +10,6 @@ from jarvis.jarvis_utils.output import OutputType, PrettyOutput
|
|
10
10
|
|
11
11
|
|
12
12
|
class OpenAIModel(BasePlatform):
|
13
|
-
platform_name = "openai"
|
14
13
|
|
15
14
|
def __init__(self):
|
16
15
|
"""
|
@@ -132,6 +131,16 @@ class OpenAIModel(BasePlatform):
|
|
132
131
|
"""
|
133
132
|
return self.model_name
|
134
133
|
|
134
|
+
@classmethod
|
135
|
+
def platform_name(cls) -> str:
|
136
|
+
"""
|
137
|
+
获取当前平台的名称
|
138
|
+
|
139
|
+
返回:
|
140
|
+
str: 当前平台的名称
|
141
|
+
"""
|
142
|
+
return "openai"
|
143
|
+
|
135
144
|
def delete_chat(self) -> bool:
|
136
145
|
"""
|
137
146
|
删除当前对话历史
|
jarvis/jarvis_platform/oyi.py
CHANGED
@@ -12,7 +12,6 @@ from jarvis.jarvis_utils.utils import while_success
|
|
12
12
|
class OyiModel(BasePlatform):
|
13
13
|
"""Oyi model implementation"""
|
14
14
|
|
15
|
-
platform_name = "oyi"
|
16
15
|
BASE_URL = "https://api-10086.rcouyi.com"
|
17
16
|
|
18
17
|
def get_model_list(self) -> List[Tuple[str, str]]:
|
@@ -87,7 +86,9 @@ class OyiModel(BasePlatform):
|
|
87
86
|
self.conversation = data
|
88
87
|
return True
|
89
88
|
else:
|
90
|
-
PrettyOutput.print(
|
89
|
+
PrettyOutput.print(
|
90
|
+
f"创建会话失败: {data['message']}", OutputType.WARNING
|
91
|
+
)
|
91
92
|
return False
|
92
93
|
|
93
94
|
except Exception as e:
|
@@ -190,6 +191,11 @@ class OyiModel(BasePlatform):
|
|
190
191
|
"""Return model name"""
|
191
192
|
return self.model_name
|
192
193
|
|
194
|
+
@classmethod
|
195
|
+
def platform_name(cls) -> str:
|
196
|
+
"""Return platform name"""
|
197
|
+
return "oyi"
|
198
|
+
|
193
199
|
def delete_chat(self) -> bool:
|
194
200
|
"""Delete current chat session"""
|
195
201
|
try:
|
@@ -6,10 +6,13 @@ import sys
|
|
6
6
|
from typing import Dict, List, Optional, Type
|
7
7
|
|
8
8
|
from jarvis.jarvis_platform.base import BasePlatform
|
9
|
-
from jarvis.jarvis_utils.config import (
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
from jarvis.jarvis_utils.config import (
|
10
|
+
get_data_dir,
|
11
|
+
get_normal_model_name,
|
12
|
+
get_normal_platform_name,
|
13
|
+
get_thinking_model_name,
|
14
|
+
get_thinking_platform_name,
|
15
|
+
)
|
13
16
|
from jarvis.jarvis_utils.output import OutputType, PrettyOutput
|
14
17
|
|
15
18
|
REQUIRED_METHODS = [
|
@@ -94,7 +97,7 @@ class PlatformRegistry:
|
|
94
97
|
Returns:
|
95
98
|
Dict[str, Type[BasePlatform]]: Platform name to platform class mapping
|
96
99
|
"""
|
97
|
-
platforms = {}
|
100
|
+
platforms: Dict[str, Type[BasePlatform]] = {}
|
98
101
|
|
99
102
|
# 确保目录存在
|
100
103
|
if not os.path.exists(directory):
|
@@ -130,12 +133,19 @@ class PlatformRegistry:
|
|
130
133
|
inspect.isclass(obj)
|
131
134
|
and issubclass(obj, BasePlatform)
|
132
135
|
and obj != BasePlatform
|
133
|
-
and hasattr(obj, "platform_name")
|
134
136
|
):
|
135
137
|
# 检查平台实现
|
136
138
|
if not PlatformRegistry.check_platform_implementation(obj):
|
137
139
|
continue
|
138
|
-
|
140
|
+
try:
|
141
|
+
# 调用类方法 platform_name
|
142
|
+
platform_name = obj.platform_name()
|
143
|
+
platforms[platform_name] = obj
|
144
|
+
except Exception as e:
|
145
|
+
PrettyOutput.print(
|
146
|
+
f"实例化或注册平台失败 {obj.__name__}: {str(e)}",
|
147
|
+
OutputType.ERROR,
|
148
|
+
)
|
139
149
|
break
|
140
150
|
except Exception as e:
|
141
151
|
PrettyOutput.print(
|
jarvis/jarvis_platform/tongyi.py
CHANGED
@@ -17,8 +17,6 @@ class TongyiPlatform(BasePlatform):
|
|
17
17
|
# Supported image formats
|
18
18
|
IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp", ".tiff"}
|
19
19
|
|
20
|
-
platform_name = "tongyi"
|
21
|
-
|
22
20
|
def __init__(self):
|
23
21
|
"""Initialize Tongyi platform"""
|
24
22
|
super().__init__()
|
@@ -395,12 +393,16 @@ class TongyiPlatform(BasePlatform):
|
|
395
393
|
add_url, headers=headers, json=add_payload
|
396
394
|
)
|
397
395
|
if add_response.status_code != 200:
|
398
|
-
print(
|
396
|
+
print(
|
397
|
+
f"❌ 添加文件到对话失败: HTTP {add_response.status_code}"
|
398
|
+
)
|
399
399
|
continue
|
400
400
|
|
401
401
|
add_result = add_response.json()
|
402
402
|
if not add_result.get("success"):
|
403
|
-
print(
|
403
|
+
print(
|
404
|
+
f"❌ 添加文件到对话失败: {add_result.get('errorMsg')}"
|
405
|
+
)
|
404
406
|
continue
|
405
407
|
|
406
408
|
file_info.update(add_result.get("data", {}))
|
@@ -455,6 +457,15 @@ class TongyiPlatform(BasePlatform):
|
|
455
457
|
"""
|
456
458
|
return self.model_name
|
457
459
|
|
460
|
+
@classmethod
|
461
|
+
def platform_name(cls) -> str:
|
462
|
+
"""Get platform name
|
463
|
+
|
464
|
+
Returns:
|
465
|
+
str: Platform name
|
466
|
+
"""
|
467
|
+
return "tongyi"
|
468
|
+
|
458
469
|
def delete_chat(self) -> bool:
|
459
470
|
"""Delete chat history
|
460
471
|
|
@@ -18,8 +18,6 @@ from jarvis.jarvis_utils.utils import while_success
|
|
18
18
|
class YuanbaoPlatform(BasePlatform):
|
19
19
|
"""Hunyuan模型实现"""
|
20
20
|
|
21
|
-
platform_name = "yuanbao"
|
22
|
-
|
23
21
|
def get_model_list(self) -> List[Tuple[str, str]]:
|
24
22
|
"""获取支持的模型列表"""
|
25
23
|
return [
|
@@ -104,7 +102,9 @@ class YuanbaoPlatform(BasePlatform):
|
|
104
102
|
self.conversation_id = response_json["id"]
|
105
103
|
return True
|
106
104
|
else:
|
107
|
-
PrettyOutput.print(
|
105
|
+
PrettyOutput.print(
|
106
|
+
f"错误:创建会话失败,响应: {response_json}", OutputType.ERROR
|
107
|
+
)
|
108
108
|
return False
|
109
109
|
except Exception as e:
|
110
110
|
PrettyOutput.print(f"错误:创建会话失败:{e}", OutputType.ERROR)
|
@@ -619,6 +619,11 @@ class YuanbaoPlatform(BasePlatform):
|
|
619
619
|
"""模型名称"""
|
620
620
|
return self.model_name
|
621
621
|
|
622
|
+
@classmethod
|
623
|
+
def platform_name(cls) -> str:
|
624
|
+
"""平台名称"""
|
625
|
+
return "yuanbao"
|
626
|
+
|
622
627
|
def support_web(self) -> bool:
|
623
628
|
"""Yuanbao平台支持web功能"""
|
624
629
|
return True
|
jarvis/jarvis_utils/input.py
CHANGED
@@ -223,10 +223,11 @@ def get_multiline_input(tip: str) -> str:
|
|
223
223
|
if last_msg:
|
224
224
|
try:
|
225
225
|
# 使用xsel将内容复制到剪贴板
|
226
|
-
|
227
|
-
|
226
|
+
subprocess.run(
|
227
|
+
["xsel", "-b", "-i"], input=last_msg.encode("utf-8"), check=True
|
228
|
+
)
|
228
229
|
PrettyOutput.print("已将最后一条消息复制到剪贴板", OutputType.INFO)
|
229
|
-
except
|
230
|
+
except subprocess.CalledProcessError as e:
|
230
231
|
PrettyOutput.print(f"复制到剪贴板失败: {e}", OutputType.ERROR)
|
231
232
|
else:
|
232
233
|
PrettyOutput.print("没有可复制的消息", OutputType.INFO)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: jarvis-ai-assistant
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.217
|
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
|
@@ -563,6 +563,7 @@ OPENAI_API_BASE: https://api.openai.com/v1
|
|
563
563
|
| `'FindRelatedFiles'` | 查找与功能相关的文件 |
|
564
564
|
| `'Fix'` | 修复问题 |
|
565
565
|
| `'Check'` | 执行静态代码检查,包括错误和风格问题 |
|
566
|
+
| `'SaveSession'` | 保存当前会话并退出 |
|
566
567
|
|
567
568
|
### 3. 自定义替换配置
|
568
569
|
在`~/.jarvis/config.yaml`中添加:
|
@@ -1,13 +1,13 @@
|
|
1
|
-
jarvis/__init__.py,sha256=
|
2
|
-
jarvis/jarvis_agent/__init__.py,sha256=
|
1
|
+
jarvis/__init__.py,sha256=pNiY6uGHpsa1WuucDsKsgkXW1EzZpRkgJEkjMcFwJWo,75
|
2
|
+
jarvis/jarvis_agent/__init__.py,sha256=Ftod6FDMlGJ_DuueI2W19whAmpldVAsGYvlgbvqC55w,33260
|
3
3
|
jarvis/jarvis_agent/builtin_input_handler.py,sha256=lcw-VBm8-CVcblxEbGU4dVD6IixgXTLz9uBrv9Y6p20,2710
|
4
4
|
jarvis/jarvis_agent/edit_file_handler.py,sha256=vKx26I4yOQwiQHNfkqMJ44Ybf90n37mojTcXNQQy-hw,17382
|
5
|
-
jarvis/jarvis_agent/jarvis.py,sha256=
|
5
|
+
jarvis/jarvis_agent/jarvis.py,sha256=4LBtAh9_AuQcjvqBFInqY19eyEJVJtGH4py32yu8olc,6287
|
6
6
|
jarvis/jarvis_agent/main.py,sha256=c6bQe-8LXvW2-NBn9Rn_yPYdrwnkJ8KQaSFY2cPvkxw,2775
|
7
7
|
jarvis/jarvis_agent/output_handler.py,sha256=P7oWpXBGFfOsWq7cIhS_z9crkQ19ES7qU5pM92KKjAs,1172
|
8
8
|
jarvis/jarvis_agent/shell_input_handler.py,sha256=zVaKNthIHJh1j4g8_-d3w5ahNH9aH-ZNRSOourQpHR4,1328
|
9
9
|
jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
-
jarvis/jarvis_code_agent/code_agent.py,sha256=
|
10
|
+
jarvis/jarvis_code_agent/code_agent.py,sha256=mQosGLngkM23sMAW9BJtl7XBPFmwOiIZUDG9tb7xAq8,18571
|
11
11
|
jarvis/jarvis_code_agent/lint.py,sha256=LZPsfyZPMo7Wm7LN4osZocuNJwZx1ojacO3MlF870x8,4009
|
12
12
|
jarvis/jarvis_code_analysis/code_review.py,sha256=uCCbGd4Y1RjDzhZoVE8JdN2avlwOfqimSDIrcM-KMew,30456
|
13
13
|
jarvis/jarvis_code_analysis/checklists/__init__.py,sha256=LIXAYa1sW3l7foP6kohLWnE98I_EQ0T7z5bYKHq6rJA,78
|
@@ -45,15 +45,15 @@ jarvis/jarvis_methodology/main.py,sha256=-PqsWvtpUJkkhiGgV-1JegEnEZBmv8SHnNMNNm_
|
|
45
45
|
jarvis/jarvis_multi_agent/__init__.py,sha256=sDd3sK88dS7_qAz2ywIAaEWdQ4iRVCiuBu2rQQmrKbU,4512
|
46
46
|
jarvis/jarvis_multi_agent/main.py,sha256=h7VUSwoPrES0XTK8z5kt3XLX1mmcm8UEuFEHQOUWPH4,1696
|
47
47
|
jarvis/jarvis_platform/__init__.py,sha256=WLQHSiE87PPket2M50_hHzjdMIgPIBx2VF8JfB_NNRk,105
|
48
|
-
jarvis/jarvis_platform/ai8.py,sha256=
|
49
|
-
jarvis/jarvis_platform/base.py,sha256
|
50
|
-
jarvis/jarvis_platform/human.py,sha256=
|
51
|
-
jarvis/jarvis_platform/kimi.py,sha256=
|
52
|
-
jarvis/jarvis_platform/openai.py,sha256=
|
53
|
-
jarvis/jarvis_platform/oyi.py,sha256=
|
54
|
-
jarvis/jarvis_platform/registry.py,sha256=
|
55
|
-
jarvis/jarvis_platform/tongyi.py,sha256=
|
56
|
-
jarvis/jarvis_platform/yuanbao.py,sha256=
|
48
|
+
jarvis/jarvis_platform/ai8.py,sha256=yi7xG8ld4Yrf7drz-uu_JT_XCGYRB0obhygt-jKik8o,10871
|
49
|
+
jarvis/jarvis_platform/base.py,sha256=-XegiAS8G_nzwsWPOVEAQ2iTxE33fxu5-TWV4c3Pz-g,8981
|
50
|
+
jarvis/jarvis_platform/human.py,sha256=quB5yMMoyU8w55IrVqa9F4ITOpF2TdM0GHQVD9zyWgk,4925
|
51
|
+
jarvis/jarvis_platform/kimi.py,sha256=OEiRNlC4Ao3PrO_yiogEwgMtTobehoEm_X4CMGT-Aas,15315
|
52
|
+
jarvis/jarvis_platform/openai.py,sha256=ccGqsU2cFfd5324P7SH1tSmFABpvto8fytmxQGkr3BA,6412
|
53
|
+
jarvis/jarvis_platform/oyi.py,sha256=GvVooV8ScRqDb9QxJdINtdZwsx6PUIdo1-bt9k0hmqY,12604
|
54
|
+
jarvis/jarvis_platform/registry.py,sha256=1bMy0YZUa8NLzuZlKfC4CBtpa0iniypTxUZk0Hv6g9Y,8415
|
55
|
+
jarvis/jarvis_platform/tongyi.py,sha256=vSK1b4NhTeHbNhTgGRj4PANXptwCAwitczwK8VXwWwU,22921
|
56
|
+
jarvis/jarvis_platform/yuanbao.py,sha256=W4yEsjkxnwi681UnAX0hV8vVPuNRmn6lRGZ3G-d74nw,23007
|
57
57
|
jarvis/jarvis_platform_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
58
58
|
jarvis/jarvis_platform_manager/main.py,sha256=LxlXSfIfmkYNcajOG_XvvlmwlSWSGb0DmbzIDSHHYOU,18330
|
59
59
|
jarvis/jarvis_platform_manager/service.py,sha256=hQGWQ2qAlzm_C_lNQDuLORQ4rmjR1P1-V3ou7l2Bv0s,13622
|
@@ -83,14 +83,14 @@ jarvis/jarvis_utils/file_processors.py,sha256=XiM248SHS7lLgQDCbORVFWqinbVDUawYxW
|
|
83
83
|
jarvis/jarvis_utils/git_utils.py,sha256=7AZblSD4b76vXxaDFkmZOy5rNkwvkwQQxGUy3NAusDQ,21641
|
84
84
|
jarvis/jarvis_utils/globals.py,sha256=WzZh_acNfHJj1LDulhyLQ7cojksBy0gdrITe0vH1XA0,3901
|
85
85
|
jarvis/jarvis_utils/http.py,sha256=Uqt1kcz0HWnAfXHHi1fNGwLb2lcVUqpbrG2Uk_-kcIU,4882
|
86
|
-
jarvis/jarvis_utils/input.py,sha256=
|
86
|
+
jarvis/jarvis_utils/input.py,sha256=XNnSOY7EEcqxA2DZcCQ40l0q30b1Lu7ijbfKjq6WWCA,8965
|
87
87
|
jarvis/jarvis_utils/methodology.py,sha256=-cvM6pwgJK7BXCYg2uVjIId_j3v5RUh2z2PBcK_2vj4,8155
|
88
88
|
jarvis/jarvis_utils/output.py,sha256=PRCgudPOB8gMEP3u-g0FGD2c6tBgJhLXUMqNPglfjV8,10813
|
89
89
|
jarvis/jarvis_utils/tag.py,sha256=f211opbbbTcSyzCDwuIK_oCnKhXPNK-RknYyGzY1yD0,431
|
90
90
|
jarvis/jarvis_utils/utils.py,sha256=BoRwLcixdf7mU3Tawe95ygGhQpkMffrFYLYhPwIvw8A,14498
|
91
|
-
jarvis_ai_assistant-0.1.
|
92
|
-
jarvis_ai_assistant-0.1.
|
93
|
-
jarvis_ai_assistant-0.1.
|
94
|
-
jarvis_ai_assistant-0.1.
|
95
|
-
jarvis_ai_assistant-0.1.
|
96
|
-
jarvis_ai_assistant-0.1.
|
91
|
+
jarvis_ai_assistant-0.1.217.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
|
92
|
+
jarvis_ai_assistant-0.1.217.dist-info/METADATA,sha256=GjT3qUhLZnjUFpZp-6mPjURP8eoPBDv3LIkNqw6uFg8,19614
|
93
|
+
jarvis_ai_assistant-0.1.217.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
94
|
+
jarvis_ai_assistant-0.1.217.dist-info/entry_points.txt,sha256=SF46ViTZcQVZEfbqzJDKKVc9TrN1x-P1mQ6wup7u2HY,875
|
95
|
+
jarvis_ai_assistant-0.1.217.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
|
96
|
+
jarvis_ai_assistant-0.1.217.dist-info/RECORD,,
|
File without changes
|
{jarvis_ai_assistant-0.1.214.dist-info → jarvis_ai_assistant-0.1.217.dist-info}/entry_points.txt
RENAMED
File without changes
|
{jarvis_ai_assistant-0.1.214.dist-info → jarvis_ai_assistant-0.1.217.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
{jarvis_ai_assistant-0.1.214.dist-info → jarvis_ai_assistant-0.1.217.dist-info}/top_level.txt
RENAMED
File without changes
|