jarvis-ai-assistant 0.1.43__tar.gz → 0.1.45__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/MANIFEST.in +2 -1
- {jarvis_ai_assistant-0.1.43/src/jarvis_ai_assistant.egg-info → jarvis_ai_assistant-0.1.45}/PKG-INFO +1 -1
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/pyproject.toml +1 -1
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/setup.py +1 -1
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/__init__.py +1 -1
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/models/ai8.py +90 -47
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/models/base.py +0 -1
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/models/oyi.py +91 -29
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45/src/jarvis_ai_assistant.egg-info}/PKG-INFO +1 -1
- jarvis_ai_assistant-0.1.45/src/jarvis_ai_assistant.egg-info/SOURCES.txt +30 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/__pycache__/__init__.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/__pycache__/agent.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/__pycache__/main.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/__pycache__/models.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/__pycache__/tools.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/__pycache__/utils.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/__pycache__/zte_llm.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/models/__pycache__/__init__.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/models/__pycache__/ai8.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/models/__pycache__/base.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/models/__pycache__/kimi.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/models/__pycache__/openai.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/models/__pycache__/oyi.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/models/__pycache__/registry.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/base.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/bing_search.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/calculator.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/calculator_tool.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/file_ops.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/generator.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/methodology.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/python_script.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/rag.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/registry.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/search.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/shell.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/sub_agent.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/user_confirmation.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/user_input.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/user_interaction.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis/tools/__pycache__/webpage.cpython-313.pyc +0 -0
- jarvis_ai_assistant-0.1.43/src/jarvis_ai_assistant.egg-info/SOURCES.txt +0 -62
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/README.md +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/setup.cfg +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/agent.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/main.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/models/__init__.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/models/kimi.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/models/openai.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/models/registry.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/tools/__init__.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/tools/base.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/tools/file_ops.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/tools/generator.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/tools/methodology.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/tools/registry.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/tools/shell.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/tools/sub_agent.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis/utils.py +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis_ai_assistant.egg-info/dependency_links.txt +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis_ai_assistant.egg-info/entry_points.txt +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis_ai_assistant.egg-info/requires.txt +0 -0
- {jarvis_ai_assistant-0.1.43 → jarvis_ai_assistant-0.1.45}/src/jarvis_ai_assistant.egg-info/top_level.txt +0 -0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "jarvis-ai-assistant"
|
7
|
-
version = "0.1.
|
7
|
+
version = "0.1.45"
|
8
8
|
description = "Jarvis: An AI assistant that uses tools to interact with the system"
|
9
9
|
readme = "README.md"
|
10
10
|
authors = [{ name = "Your Name", email = "your.email@example.com" }]
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="jarvis-ai-assistant",
|
5
|
-
version="0.1.
|
5
|
+
version="0.1.45",
|
6
6
|
author="skyfire",
|
7
7
|
author_email="skyfireitdiy@hotmail.com",
|
8
8
|
description="An AI assistant that uses various tools to interact with the system",
|
@@ -14,58 +14,59 @@ class AI8Model(BasePlatform):
|
|
14
14
|
|
15
15
|
def __init__(self):
|
16
16
|
"""Initialize model"""
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
PrettyOutput.print("gpt-4o", OutputType.INFO)
|
22
|
-
PrettyOutput.print("gpt-4o-mini", OutputType.INFO)
|
23
|
-
PrettyOutput.print("o1-mini", OutputType.INFO)
|
24
|
-
PrettyOutput.print("gpt-4-vision-preview", OutputType.INFO)
|
25
|
-
PrettyOutput.print("gpt-4-turbo-preview", OutputType.INFO)
|
26
|
-
PrettyOutput.print("o1-mini-all", OutputType.INFO)
|
27
|
-
PrettyOutput.print("gpt-4o-all", OutputType.INFO)
|
28
|
-
PrettyOutput.print("o1-preview", OutputType.INFO)
|
29
|
-
PrettyOutput.print("claude-3-5-sonnet-20241022", OutputType.INFO)
|
30
|
-
PrettyOutput.print("claude-3-opus-20240229", OutputType.INFO)
|
31
|
-
PrettyOutput.print("claude-3-haiku-20240307", OutputType.INFO)
|
32
|
-
PrettyOutput.print("claude-3-5-sonnet-20240620", OutputType.INFO)
|
33
|
-
PrettyOutput.print("deepseek-chat", OutputType.INFO)
|
34
|
-
PrettyOutput.print("deepseek-coder", OutputType.INFO)
|
35
|
-
PrettyOutput.print("glm-4-flash", OutputType.INFO)
|
36
|
-
PrettyOutput.print("glm-4-air", OutputType.INFO)
|
37
|
-
PrettyOutput.print("glm-4v-flash", OutputType.INFO)
|
38
|
-
PrettyOutput.print("qwen-plus", OutputType.INFO)
|
39
|
-
PrettyOutput.print("qwen-vl-max", OutputType.INFO)
|
40
|
-
PrettyOutput.print("qwen-turbo", OutputType.INFO)
|
41
|
-
PrettyOutput.print("lite", OutputType.INFO)
|
42
|
-
PrettyOutput.print("generalv3.5", OutputType.INFO)
|
43
|
-
PrettyOutput.print("yi-lightning", OutputType.INFO)
|
44
|
-
PrettyOutput.print("yi-vision", OutputType.INFO)
|
45
|
-
PrettyOutput.print("yi-spark", OutputType.INFO)
|
46
|
-
PrettyOutput.print("yi-medium", OutputType.INFO)
|
47
|
-
PrettyOutput.print("Doubao-lite-4k", OutputType.INFO)
|
48
|
-
PrettyOutput.print("Doubao-lite-32k", OutputType.INFO)
|
49
|
-
PrettyOutput.print("Doubao-pro-4k", OutputType.INFO)
|
50
|
-
PrettyOutput.print("Doubao-pro-32k", OutputType.INFO)
|
51
|
-
PrettyOutput.print("step-1-flash", OutputType.INFO)
|
52
|
-
PrettyOutput.print("step-1v-8k", OutputType.INFO)
|
53
|
-
PrettyOutput.print("Baichuan4-Air", OutputType.INFO)
|
54
|
-
PrettyOutput.print("Baichuan4-Turbo", OutputType.INFO)
|
55
|
-
PrettyOutput.print("moonshot-v1-8k", OutputType.INFO)
|
56
|
-
PrettyOutput.print("ERNIE-Speed-128K", OutputType.INFO)
|
57
|
-
PrettyOutput.print("ERNIE-3.5-128K", OutputType.INFO)
|
17
|
+
self.system_message = ""
|
18
|
+
self.conversation = None
|
19
|
+
self.files = []
|
20
|
+
self.models = {} # 存储模型信息
|
58
21
|
|
22
|
+
# 获取可用模型列表
|
23
|
+
available_models = self.get_available_models()
|
24
|
+
|
25
|
+
if available_models:
|
26
|
+
PrettyOutput.section("支持的模型", OutputType.SUCCESS)
|
27
|
+
for model in self.models.values():
|
28
|
+
# 格式化显示模型信息
|
29
|
+
model_str = f"{model['value']:<30}"
|
30
|
+
|
31
|
+
# 添加标签
|
32
|
+
model_str += f"{model['label']}"
|
33
|
+
|
34
|
+
# 添加标签和积分信息
|
35
|
+
attrs = []
|
36
|
+
if model['attr'].get('tag'):
|
37
|
+
attrs.append(model['attr']['tag'])
|
38
|
+
if model['attr'].get('integral'):
|
39
|
+
attrs.append(model['attr']['integral'])
|
40
|
+
|
41
|
+
# 添加特性标记
|
42
|
+
features = []
|
43
|
+
if model['attr'].get('multimodal'):
|
44
|
+
features.append("多模态")
|
45
|
+
if model['attr'].get('plugin'):
|
46
|
+
features.append("插件支持")
|
47
|
+
if model['attr'].get('onlyImg'):
|
48
|
+
features.append("图像支持")
|
49
|
+
if features:
|
50
|
+
model_str += f" [{'|'.join(features)}]"
|
51
|
+
|
52
|
+
# 添加备注
|
53
|
+
if model['attr'].get('note'):
|
54
|
+
model_str += f" - {model['attr']['note']}"
|
55
|
+
|
56
|
+
PrettyOutput.print(model_str, OutputType.INFO)
|
57
|
+
else:
|
58
|
+
PrettyOutput.print("获取模型列表失败", OutputType.WARNING)
|
59
59
|
|
60
|
+
self.token = os.getenv("AI8_API_KEY")
|
61
|
+
if not self.token:
|
62
|
+
raise Exception("AI8_API_KEY is not set")
|
63
|
+
|
60
64
|
PrettyOutput.print("使用AI8_MODEL环境变量配置模型", OutputType.SUCCESS)
|
61
65
|
|
62
|
-
self.system_message = ""
|
63
|
-
self.conversation = None
|
64
|
-
self.files = []
|
65
66
|
self.model_name = os.getenv("AI8_MODEL") or "deepseek-chat"
|
66
|
-
self.
|
67
|
-
|
68
|
-
|
67
|
+
if self.model_name not in self.models:
|
68
|
+
PrettyOutput.print(f"警告: 当前选择的模型 {self.model_name} 不在可用列表中", OutputType.WARNING)
|
69
|
+
|
69
70
|
PrettyOutput.print(f"当前使用模型: {self.model_name}", OutputType.SYSTEM)
|
70
71
|
|
71
72
|
def set_model_name(self, model_name: str):
|
@@ -279,3 +280,45 @@ class AI8Model(BasePlatform):
|
|
279
280
|
PrettyOutput.print(f"删除会话异常: {str(e)}", OutputType.ERROR)
|
280
281
|
return False
|
281
282
|
|
283
|
+
def get_available_models(self) -> List[str]:
|
284
|
+
"""获取可用的模型列表
|
285
|
+
|
286
|
+
Returns:
|
287
|
+
List[str]: 可用模型名称列表
|
288
|
+
"""
|
289
|
+
try:
|
290
|
+
headers = {
|
291
|
+
'Content-Type': 'application/json',
|
292
|
+
'Accept': 'application/json, text/plain, */*',
|
293
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
|
294
|
+
'X-APP-VERSION': '2.2.2',
|
295
|
+
'Origin': self.BASE_URL,
|
296
|
+
'Referer': f'{self.BASE_URL}/chat?_userMenuKey=chat'
|
297
|
+
}
|
298
|
+
|
299
|
+
response = requests.get(
|
300
|
+
f"{self.BASE_URL}/api/chat/template",
|
301
|
+
headers=headers
|
302
|
+
)
|
303
|
+
|
304
|
+
if response.status_code != 200:
|
305
|
+
PrettyOutput.print(f"获取模型列表失败: {response.status_code}", OutputType.ERROR)
|
306
|
+
return []
|
307
|
+
|
308
|
+
data = response.json()
|
309
|
+
if data['code'] != 0:
|
310
|
+
PrettyOutput.print(f"获取模型列表失败: {data.get('msg', '未知错误')}", OutputType.ERROR)
|
311
|
+
return []
|
312
|
+
|
313
|
+
# 保存模型信息
|
314
|
+
self.models = {
|
315
|
+
model['value']: model
|
316
|
+
for model in data['data']['models']
|
317
|
+
}
|
318
|
+
|
319
|
+
return list(self.models.keys())
|
320
|
+
|
321
|
+
except Exception as e:
|
322
|
+
PrettyOutput.print(f"获取模型列表异常: {str(e)}", OutputType.ERROR)
|
323
|
+
return []
|
324
|
+
|
@@ -15,42 +15,31 @@ class OyiModel(BasePlatform):
|
|
15
15
|
def __init__(self):
|
16
16
|
"""Initialize model"""
|
17
17
|
PrettyOutput.section("支持的模型", OutputType.SUCCESS)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
PrettyOutput.print("deepseek-chat", OutputType.INFO)
|
28
|
-
PrettyOutput.print("deepseek-coder", OutputType.INFO)
|
29
|
-
PrettyOutput.print("glm-4-flash", OutputType.INFO)
|
30
|
-
PrettyOutput.print("glm-4-air", OutputType.INFO)
|
31
|
-
PrettyOutput.print("qwen-plus", OutputType.INFO)
|
32
|
-
PrettyOutput.print("qwen-turbo", OutputType.INFO)
|
33
|
-
PrettyOutput.print("Doubao-lite-4k", OutputType.INFO)
|
34
|
-
PrettyOutput.print("Doubao-pro-4k", OutputType.INFO)
|
35
|
-
PrettyOutput.print("yi-lightning", OutputType.INFO)
|
36
|
-
PrettyOutput.print("step-1-flash", OutputType.INFO)
|
37
|
-
PrettyOutput.print("moonshot-v1-8k", OutputType.INFO)
|
38
|
-
PrettyOutput.print("lite", OutputType.INFO)
|
39
|
-
PrettyOutput.print("generalv3.5", OutputType.INFO)
|
40
|
-
PrettyOutput.print("gemini-pro", OutputType.INFO)
|
41
|
-
PrettyOutput.print("llama3-70b-8192", OutputType.INFO)
|
18
|
+
|
19
|
+
# 获取可用模型列表
|
20
|
+
available_models = self.get_available_models()
|
21
|
+
if available_models:
|
22
|
+
for model in available_models:
|
23
|
+
PrettyOutput.print(model, OutputType.INFO)
|
24
|
+
else:
|
25
|
+
PrettyOutput.print("获取模型列表失败", OutputType.WARNING)
|
26
|
+
|
42
27
|
PrettyOutput.print("使用OYI_MODEL环境变量配置模型", OutputType.SUCCESS)
|
43
28
|
|
44
|
-
|
45
29
|
self.messages = []
|
46
30
|
self.system_message = ""
|
47
31
|
self.conversation = None
|
48
32
|
self.upload_files = []
|
49
33
|
self.first_chat = True
|
50
|
-
|
34
|
+
|
51
35
|
self.token = os.getenv("OYI_API_KEY")
|
52
|
-
if not
|
53
|
-
raise Exception("
|
36
|
+
if not self.token:
|
37
|
+
raise Exception("OYI_API_KEY is not set")
|
38
|
+
|
39
|
+
self.model_name = os.getenv("OYI_MODEL") or "deepseek-chat"
|
40
|
+
if self.model_name not in [m.split()[0] for m in available_models]:
|
41
|
+
PrettyOutput.print(f"警告: 当前选择的模型 {self.model_name} 不在可用列表中", OutputType.WARNING)
|
42
|
+
|
54
43
|
PrettyOutput.print(f"当前使用模型: {self.model_name}", OutputType.SYSTEM)
|
55
44
|
|
56
45
|
def set_model_name(self, model_name: str):
|
@@ -265,6 +254,12 @@ class OyiModel(BasePlatform):
|
|
265
254
|
Dict: Upload response data
|
266
255
|
"""
|
267
256
|
try:
|
257
|
+
# 检查当前模型是否支持文件上传
|
258
|
+
model_info = self.models.get(self.model_name)
|
259
|
+
if not model_info or not model_info.get('uploadFile', False):
|
260
|
+
PrettyOutput.print(f"当前模型 {self.model_name} 不支持文件上传", OutputType.WARNING)
|
261
|
+
return None
|
262
|
+
|
268
263
|
headers = {
|
269
264
|
'Authorization': f'Bearer {self.token}',
|
270
265
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
|
@@ -276,7 +271,7 @@ class OyiModel(BasePlatform):
|
|
276
271
|
|
277
272
|
with open(file_path, 'rb') as f:
|
278
273
|
files = {
|
279
|
-
'file': (os.path.basename(file_path), f, mimetypes.guess_type(file_path)[0])
|
274
|
+
'file': (os.path.basename(file_path), f, mimetypes.guess_type(file_path)[0])
|
280
275
|
}
|
281
276
|
|
282
277
|
response = requests.post(
|
@@ -302,3 +297,70 @@ class OyiModel(BasePlatform):
|
|
302
297
|
except Exception as e:
|
303
298
|
PrettyOutput.print(f"文件上传异常: {str(e)}", OutputType.ERROR)
|
304
299
|
return None
|
300
|
+
|
301
|
+
def get_available_models(self) -> List[str]:
|
302
|
+
"""获取可用的模型列表
|
303
|
+
|
304
|
+
Returns:
|
305
|
+
List[str]: 可用模型名称列表
|
306
|
+
"""
|
307
|
+
try:
|
308
|
+
headers = {
|
309
|
+
'Content-Type': 'application/json',
|
310
|
+
'Accept': 'application/json, text/plain, */*',
|
311
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
|
312
|
+
'Origin': 'https://ai.rcouyi.com',
|
313
|
+
'Referer': 'https://ai.rcouyi.com/'
|
314
|
+
}
|
315
|
+
|
316
|
+
response = requests.get(
|
317
|
+
"https://ai.rcouyi.com/config/system.json",
|
318
|
+
headers=headers
|
319
|
+
)
|
320
|
+
|
321
|
+
if response.status_code != 200:
|
322
|
+
PrettyOutput.print(f"获取模型列表失败: {response.status_code}", OutputType.ERROR)
|
323
|
+
return []
|
324
|
+
|
325
|
+
data = response.json()
|
326
|
+
|
327
|
+
# 保存模型信息
|
328
|
+
self.models = {
|
329
|
+
model['value']: model
|
330
|
+
for model in data.get('model', [])
|
331
|
+
if model.get('enable', False) # 只保存启用的模型
|
332
|
+
}
|
333
|
+
|
334
|
+
# 格式化显示
|
335
|
+
models = []
|
336
|
+
for model in self.models.values():
|
337
|
+
# 基本信息
|
338
|
+
model_str = f"{model['value']:<30} {model['label']}"
|
339
|
+
|
340
|
+
# 添加后缀标签
|
341
|
+
suffix = model.get('suffix', [])
|
342
|
+
if suffix:
|
343
|
+
# 处理新格式的suffix (字典列表)
|
344
|
+
if suffix and isinstance(suffix[0], dict):
|
345
|
+
suffix_str = ', '.join(s.get('tag', '') for s in suffix)
|
346
|
+
# 处理旧格式的suffix (字符串列表)
|
347
|
+
else:
|
348
|
+
suffix_str = ', '.join(str(s) for s in suffix)
|
349
|
+
model_str += f" ({suffix_str})"
|
350
|
+
|
351
|
+
# 添加描述或提示
|
352
|
+
info = model.get('tooltip') or model.get('description', '')
|
353
|
+
if info:
|
354
|
+
model_str += f" - {info}"
|
355
|
+
|
356
|
+
# 添加文件上传支持标记
|
357
|
+
if model.get('uploadFile'):
|
358
|
+
model_str += " [支持文件上传]"
|
359
|
+
|
360
|
+
models.append(model_str)
|
361
|
+
|
362
|
+
return sorted(models)
|
363
|
+
|
364
|
+
except Exception as e:
|
365
|
+
PrettyOutput.print(f"获取模型列表异常: {str(e)}", OutputType.ERROR)
|
366
|
+
return []
|
@@ -0,0 +1,30 @@
|
|
1
|
+
LICENSE
|
2
|
+
MANIFEST.in
|
3
|
+
README.md
|
4
|
+
pyproject.toml
|
5
|
+
setup.py
|
6
|
+
src/jarvis/__init__.py
|
7
|
+
src/jarvis/agent.py
|
8
|
+
src/jarvis/main.py
|
9
|
+
src/jarvis/utils.py
|
10
|
+
src/jarvis/models/__init__.py
|
11
|
+
src/jarvis/models/ai8.py
|
12
|
+
src/jarvis/models/base.py
|
13
|
+
src/jarvis/models/kimi.py
|
14
|
+
src/jarvis/models/openai.py
|
15
|
+
src/jarvis/models/oyi.py
|
16
|
+
src/jarvis/models/registry.py
|
17
|
+
src/jarvis/tools/__init__.py
|
18
|
+
src/jarvis/tools/base.py
|
19
|
+
src/jarvis/tools/file_ops.py
|
20
|
+
src/jarvis/tools/generator.py
|
21
|
+
src/jarvis/tools/methodology.py
|
22
|
+
src/jarvis/tools/registry.py
|
23
|
+
src/jarvis/tools/shell.py
|
24
|
+
src/jarvis/tools/sub_agent.py
|
25
|
+
src/jarvis_ai_assistant.egg-info/PKG-INFO
|
26
|
+
src/jarvis_ai_assistant.egg-info/SOURCES.txt
|
27
|
+
src/jarvis_ai_assistant.egg-info/dependency_links.txt
|
28
|
+
src/jarvis_ai_assistant.egg-info/entry_points.txt
|
29
|
+
src/jarvis_ai_assistant.egg-info/requires.txt
|
30
|
+
src/jarvis_ai_assistant.egg-info/top_level.txt
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,62 +0,0 @@
|
|
1
|
-
LICENSE
|
2
|
-
MANIFEST.in
|
3
|
-
README.md
|
4
|
-
pyproject.toml
|
5
|
-
setup.py
|
6
|
-
src/jarvis/__init__.py
|
7
|
-
src/jarvis/agent.py
|
8
|
-
src/jarvis/main.py
|
9
|
-
src/jarvis/utils.py
|
10
|
-
src/jarvis/__pycache__/__init__.cpython-313.pyc
|
11
|
-
src/jarvis/__pycache__/agent.cpython-313.pyc
|
12
|
-
src/jarvis/__pycache__/main.cpython-313.pyc
|
13
|
-
src/jarvis/__pycache__/models.cpython-313.pyc
|
14
|
-
src/jarvis/__pycache__/tools.cpython-313.pyc
|
15
|
-
src/jarvis/__pycache__/utils.cpython-313.pyc
|
16
|
-
src/jarvis/__pycache__/zte_llm.cpython-313.pyc
|
17
|
-
src/jarvis/models/__init__.py
|
18
|
-
src/jarvis/models/ai8.py
|
19
|
-
src/jarvis/models/base.py
|
20
|
-
src/jarvis/models/kimi.py
|
21
|
-
src/jarvis/models/openai.py
|
22
|
-
src/jarvis/models/oyi.py
|
23
|
-
src/jarvis/models/registry.py
|
24
|
-
src/jarvis/models/__pycache__/__init__.cpython-313.pyc
|
25
|
-
src/jarvis/models/__pycache__/ai8.cpython-313.pyc
|
26
|
-
src/jarvis/models/__pycache__/base.cpython-313.pyc
|
27
|
-
src/jarvis/models/__pycache__/kimi.cpython-313.pyc
|
28
|
-
src/jarvis/models/__pycache__/openai.cpython-313.pyc
|
29
|
-
src/jarvis/models/__pycache__/oyi.cpython-313.pyc
|
30
|
-
src/jarvis/models/__pycache__/registry.cpython-313.pyc
|
31
|
-
src/jarvis/tools/__init__.py
|
32
|
-
src/jarvis/tools/base.py
|
33
|
-
src/jarvis/tools/file_ops.py
|
34
|
-
src/jarvis/tools/generator.py
|
35
|
-
src/jarvis/tools/methodology.py
|
36
|
-
src/jarvis/tools/registry.py
|
37
|
-
src/jarvis/tools/shell.py
|
38
|
-
src/jarvis/tools/sub_agent.py
|
39
|
-
src/jarvis/tools/__pycache__/__init__.cpython-313.pyc
|
40
|
-
src/jarvis/tools/__pycache__/base.cpython-313.pyc
|
41
|
-
src/jarvis/tools/__pycache__/bing_search.cpython-313.pyc
|
42
|
-
src/jarvis/tools/__pycache__/calculator.cpython-313.pyc
|
43
|
-
src/jarvis/tools/__pycache__/calculator_tool.cpython-313.pyc
|
44
|
-
src/jarvis/tools/__pycache__/file_ops.cpython-313.pyc
|
45
|
-
src/jarvis/tools/__pycache__/generator.cpython-313.pyc
|
46
|
-
src/jarvis/tools/__pycache__/methodology.cpython-313.pyc
|
47
|
-
src/jarvis/tools/__pycache__/python_script.cpython-313.pyc
|
48
|
-
src/jarvis/tools/__pycache__/rag.cpython-313.pyc
|
49
|
-
src/jarvis/tools/__pycache__/registry.cpython-313.pyc
|
50
|
-
src/jarvis/tools/__pycache__/search.cpython-313.pyc
|
51
|
-
src/jarvis/tools/__pycache__/shell.cpython-313.pyc
|
52
|
-
src/jarvis/tools/__pycache__/sub_agent.cpython-313.pyc
|
53
|
-
src/jarvis/tools/__pycache__/user_confirmation.cpython-313.pyc
|
54
|
-
src/jarvis/tools/__pycache__/user_input.cpython-313.pyc
|
55
|
-
src/jarvis/tools/__pycache__/user_interaction.cpython-313.pyc
|
56
|
-
src/jarvis/tools/__pycache__/webpage.cpython-313.pyc
|
57
|
-
src/jarvis_ai_assistant.egg-info/PKG-INFO
|
58
|
-
src/jarvis_ai_assistant.egg-info/SOURCES.txt
|
59
|
-
src/jarvis_ai_assistant.egg-info/dependency_links.txt
|
60
|
-
src/jarvis_ai_assistant.egg-info/entry_points.txt
|
61
|
-
src/jarvis_ai_assistant.egg-info/requires.txt
|
62
|
-
src/jarvis_ai_assistant.egg-info/top_level.txt
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|