jarvis-ai-assistant 0.1.53__py3-none-any.whl → 0.1.55__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 +1 -1
- jarvis/jarvis_coder/main.py +740 -0
- jarvis/main.py +9 -6
- jarvis/models/ai8.py +1 -1
- jarvis/models/openai.py +1 -1
- jarvis/models/oyi.py +1 -1
- {jarvis_ai_assistant-0.1.53.dist-info → jarvis_ai_assistant-0.1.55.dist-info}/METADATA +1 -1
- {jarvis_ai_assistant-0.1.53.dist-info → jarvis_ai_assistant-0.1.55.dist-info}/RECORD +12 -12
- jarvis_ai_assistant-0.1.55.dist-info/entry_points.txt +3 -0
- jarvis/tools/code_edit.py +0 -729
- jarvis_ai_assistant-0.1.53.dist-info/entry_points.txt +0 -3
- {jarvis_ai_assistant-0.1.53.dist-info → jarvis_ai_assistant-0.1.55.dist-info}/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.53.dist-info → jarvis_ai_assistant-0.1.55.dist-info}/WHEEL +0 -0
- {jarvis_ai_assistant-0.1.53.dist-info → jarvis_ai_assistant-0.1.55.dist-info}/top_level.txt +0 -0
jarvis/main.py
CHANGED
|
@@ -100,23 +100,26 @@ def select_task(tasks: dict) -> str:
|
|
|
100
100
|
def main():
|
|
101
101
|
"""Jarvis 的主入口点"""
|
|
102
102
|
# 添加参数解析器
|
|
103
|
+
load_env_from_file()
|
|
103
104
|
parser = argparse.ArgumentParser(description='Jarvis AI 助手')
|
|
104
105
|
parser.add_argument('-f', '--files', nargs='*', help='要处理的文件列表')
|
|
105
106
|
parser.add_argument('--keep-history', action='store_true', help='保持聊天历史(不删除会话)')
|
|
106
|
-
parser.add_argument('-p', '--platform', default='', help='选择AI平台')
|
|
107
|
-
parser.add_argument('-m', '--model', default='', help='模型') # 用于指定使用的模型名称,默认使用环境变量或平台默认模型
|
|
107
|
+
parser.add_argument('-p', '--platform', default=os.getenv('JARVIS_PLATFORM') or 'kimi', help='选择AI平台')
|
|
108
|
+
parser.add_argument('-m', '--model', default=os.getenv('JARVIS_MODEL') or '', help='模型') # 用于指定使用的模型名称,默认使用环境变量或平台默认模型
|
|
108
109
|
args = parser.parse_args()
|
|
109
110
|
|
|
110
|
-
load_env_from_file()
|
|
111
|
-
|
|
112
111
|
platform = args.platform if args.platform else os.getenv('JARVIS_PLATFORM')
|
|
113
112
|
|
|
114
113
|
if not platform:
|
|
115
114
|
PrettyOutput.print("未指定AI平台,请使用 -p 参数或者设置 JARVIS_PLATFORM 环境变量", OutputType.ERROR)
|
|
116
115
|
return 1
|
|
117
|
-
|
|
118
|
-
PlatformRegistry.get_global_platform_registry().set_global_platform_name(platform)
|
|
119
116
|
|
|
117
|
+
PlatformRegistry.get_global_platform_registry().set_global_platform_name(platform)
|
|
118
|
+
|
|
119
|
+
if args.model:
|
|
120
|
+
PrettyOutput.print(f"用户传入了模型参数,更换模型: {args.model}", OutputType.USER)
|
|
121
|
+
os.environ["JARVIS_MODEL"] = args.model
|
|
122
|
+
|
|
120
123
|
try:
|
|
121
124
|
# 获取全局模型实例
|
|
122
125
|
agent = Agent()
|
jarvis/models/ai8.py
CHANGED
|
@@ -63,7 +63,7 @@ class AI8Model(BasePlatform):
|
|
|
63
63
|
|
|
64
64
|
PrettyOutput.print("使用AI8_MODEL环境变量配置模型", OutputType.SUCCESS)
|
|
65
65
|
|
|
66
|
-
self.model_name = os.getenv("AI8_MODEL") or "deepseek-chat"
|
|
66
|
+
self.model_name = os.getenv("AI8_MODEL") or os.getenv("JARVIS_MODEL") or "deepseek-chat"
|
|
67
67
|
if self.model_name not in self.models:
|
|
68
68
|
PrettyOutput.print(f"警告: 当前选择的模型 {self.model_name} 不在可用列表中", OutputType.WARNING)
|
|
69
69
|
|
jarvis/models/openai.py
CHANGED
|
@@ -30,7 +30,7 @@ class OpenAIModel(BasePlatform):
|
|
|
30
30
|
raise Exception("OPENAI_API_KEY is not set")
|
|
31
31
|
|
|
32
32
|
self.base_url = os.getenv("OPENAI_API_BASE", "https://api.deepseek.com")
|
|
33
|
-
self.model_name = os.getenv("OPENAI_MODEL_NAME"
|
|
33
|
+
self.model_name = os.getenv("OPENAI_MODEL_NAME") or os.getenv("JARVIS_MODEL") or "deepseek-chat"
|
|
34
34
|
|
|
35
35
|
PrettyOutput.print(f"当前使用模型: {self.model_name}", OutputType.SYSTEM)
|
|
36
36
|
|
jarvis/models/oyi.py
CHANGED
|
@@ -36,7 +36,7 @@ class OyiModel(BasePlatform):
|
|
|
36
36
|
if not self.token:
|
|
37
37
|
raise Exception("OYI_API_KEY is not set")
|
|
38
38
|
|
|
39
|
-
self.model_name = os.getenv("OYI_MODEL") or "deepseek-chat"
|
|
39
|
+
self.model_name = os.getenv("OYI_MODEL") or os.getenv("JARVIS_MODEL") or "deepseek-chat"
|
|
40
40
|
if self.model_name not in [m.split()[0] for m in available_models]:
|
|
41
41
|
PrettyOutput.print(f"警告: 当前选择的模型 {self.model_name} 不在可用列表中", OutputType.WARNING)
|
|
42
42
|
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
jarvis/__init__.py,sha256=
|
|
1
|
+
jarvis/__init__.py,sha256=TgQTdVOK-cueqCWiQsECrUAQWOxTSqYI1Iu7YTFBom8,50
|
|
2
2
|
jarvis/agent.py,sha256=s8VebNef8BbKM6D9IDWWN-XenEXEL9KoYnDLGKyZY58,12347
|
|
3
|
-
jarvis/main.py,sha256=
|
|
3
|
+
jarvis/main.py,sha256=gXXtnrkkvGwEswJL6qiYjVrg3bpzye-GJeAe0Nf2B9o,6509
|
|
4
4
|
jarvis/utils.py,sha256=JlkuC9RtspXH2VWDmj9nR0vnb8ie1gIsKc4vC7WRco8,7321
|
|
5
|
+
jarvis/jarvis_coder/main.py,sha256=eKo7ipNb3eSRuUMwMZclTozz6LUtU95t2B-w_LGkexs,30155
|
|
5
6
|
jarvis/models/__init__.py,sha256=mrOt67nselz_H1gX9wdAO4y2DY5WPXzABqJbr5Des8k,63
|
|
6
|
-
jarvis/models/ai8.py,sha256=
|
|
7
|
+
jarvis/models/ai8.py,sha256=6Nu4AJ_YtzVcVJirOrzbRI1WF0WpGBzWuDvu_C5oP0s,12624
|
|
7
8
|
jarvis/models/base.py,sha256=eeNJJbv9ikPVTtV_E7mgW8LZzVgjQ-OzxlHF6slYrHw,1237
|
|
8
9
|
jarvis/models/kimi.py,sha256=N0bPQ1ugx0RwjR96jLchmOPvCmws-fXyA0mnOAdo2k4,17161
|
|
9
|
-
jarvis/models/openai.py,sha256=
|
|
10
|
-
jarvis/models/oyi.py,sha256=
|
|
10
|
+
jarvis/models/openai.py,sha256=yJ8e4js365uh-pdka-q8tD6iUoSdP-n4kdxUfaHIQ28,4262
|
|
11
|
+
jarvis/models/oyi.py,sha256=VwPW4UawGrMrDOCIbSs9ieNlE6N0pBtgiroyg9JCJ48,15004
|
|
11
12
|
jarvis/models/registry.py,sha256=iVBjN9ImEvGHcz8WR-z8pPMJQZI907o_nccVOFANhak,7951
|
|
12
13
|
jarvis/tools/__init__.py,sha256=Kj1bKj34lwRDKMKHLOrLyQElf2lHbqA2tDgP359eaDo,71
|
|
13
14
|
jarvis/tools/base.py,sha256=EGRGbdfbLXDLwtyoWdvp9rlxNX7bzc20t0Vc2VkwIEY,652
|
|
14
|
-
jarvis/tools/code_edit.py,sha256=oMoggVC66Ve_nsQMJiCP00GdH8QzfiLTQnZF9TKa0Vk,30990
|
|
15
15
|
jarvis/tools/file_ops.py,sha256=h8g0eT9UvlJf4kt0DLXvdSsjcPj7x19lxWdDApeDfpg,3842
|
|
16
16
|
jarvis/tools/generator.py,sha256=vVP3eN5cCDpRXf_fn0skETkPXAW1XZFWx9pt2_ahK48,5999
|
|
17
17
|
jarvis/tools/methodology.py,sha256=G3cOaHTMujGZBhDLhQEqyCV2NISizO3MXRuho1KfI6Y,5223
|
|
18
18
|
jarvis/tools/registry.py,sha256=NbH7A4A2lyN2IoyZGFwa5Ghed2dpzbJWCAd1Dg95WBI,7183
|
|
19
19
|
jarvis/tools/shell.py,sha256=UPKshPyOaUwTngresUw-ot1jHjQIb4wCY5nkJqa38lU,2520
|
|
20
20
|
jarvis/tools/sub_agent.py,sha256=rEtAmSVY2ZjFOZEKr5m5wpACOQIiM9Zr_3dT92FhXYU,2621
|
|
21
|
-
jarvis_ai_assistant-0.1.
|
|
22
|
-
jarvis_ai_assistant-0.1.
|
|
23
|
-
jarvis_ai_assistant-0.1.
|
|
24
|
-
jarvis_ai_assistant-0.1.
|
|
25
|
-
jarvis_ai_assistant-0.1.
|
|
26
|
-
jarvis_ai_assistant-0.1.
|
|
21
|
+
jarvis_ai_assistant-0.1.55.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
|
|
22
|
+
jarvis_ai_assistant-0.1.55.dist-info/METADATA,sha256=LTOhw_m-9kM2VF5j4rnF3sy1T8rV89BB6eRI9ulKIlY,10015
|
|
23
|
+
jarvis_ai_assistant-0.1.55.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
24
|
+
jarvis_ai_assistant-0.1.55.dist-info/entry_points.txt,sha256=xDf1Kjt0cr1GrASlrV1iuiMWMkAV6i-jUbcfKasR0os,89
|
|
25
|
+
jarvis_ai_assistant-0.1.55.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
|
|
26
|
+
jarvis_ai_assistant-0.1.55.dist-info/RECORD,,
|