jarvis-ai-assistant 0.1.32__tar.gz → 0.1.34__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. {jarvis_ai_assistant-0.1.32/src/jarvis_ai_assistant.egg-info → jarvis_ai_assistant-0.1.34}/PKG-INFO +1 -1
  2. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/pyproject.toml +1 -1
  3. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/setup.py +1 -1
  4. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/__init__.py +1 -1
  5. jarvis_ai_assistant-0.1.34/src/jarvis/__pycache__/__init__.cpython-313.pyc +0 -0
  6. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/__pycache__/agent.cpython-313.pyc +0 -0
  7. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/__pycache__/main.cpython-313.pyc +0 -0
  8. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/agent.py +1 -1
  9. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/main.py +9 -3
  10. jarvis_ai_assistant-0.1.34/src/jarvis/models/__pycache__/ai8.cpython-313.pyc +0 -0
  11. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/__pycache__/oyi.cpython-313.pyc +0 -0
  12. jarvis_ai_assistant-0.1.34/src/jarvis/models/ai8.py +277 -0
  13. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/oyi.py +28 -0
  14. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34/src/jarvis_ai_assistant.egg-info}/PKG-INFO +1 -1
  15. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis_ai_assistant.egg-info/SOURCES.txt +2 -0
  16. jarvis_ai_assistant-0.1.32/src/jarvis/__pycache__/__init__.cpython-313.pyc +0 -0
  17. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/LICENSE +0 -0
  18. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/MANIFEST.in +0 -0
  19. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/README.md +0 -0
  20. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/setup.cfg +0 -0
  21. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/__pycache__/models.cpython-313.pyc +0 -0
  22. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/__pycache__/tools.cpython-313.pyc +0 -0
  23. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/__pycache__/utils.cpython-313.pyc +0 -0
  24. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/__pycache__/zte_llm.cpython-313.pyc +0 -0
  25. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/__init__.py +0 -0
  26. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/__pycache__/__init__.cpython-313.pyc +0 -0
  27. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/__pycache__/base.cpython-313.pyc +0 -0
  28. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/__pycache__/kimi.cpython-313.pyc +0 -0
  29. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/__pycache__/openai.cpython-313.pyc +0 -0
  30. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/__pycache__/registry.cpython-313.pyc +0 -0
  31. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/base.py +0 -0
  32. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/kimi.py +0 -0
  33. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/openai.py +0 -0
  34. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/models/registry.py +0 -0
  35. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__init__.py +0 -0
  36. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/__init__.cpython-313.pyc +0 -0
  37. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/base.cpython-313.pyc +0 -0
  38. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/bing_search.cpython-313.pyc +0 -0
  39. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/calculator.cpython-313.pyc +0 -0
  40. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/calculator_tool.cpython-313.pyc +0 -0
  41. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/file_ops.cpython-313.pyc +0 -0
  42. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/generator.cpython-313.pyc +0 -0
  43. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/methodology.cpython-313.pyc +0 -0
  44. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/python_script.cpython-313.pyc +0 -0
  45. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/rag.cpython-313.pyc +0 -0
  46. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/registry.cpython-313.pyc +0 -0
  47. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/search.cpython-313.pyc +0 -0
  48. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/shell.cpython-313.pyc +0 -0
  49. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/sub_agent.cpython-313.pyc +0 -0
  50. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/user_confirmation.cpython-313.pyc +0 -0
  51. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/user_input.cpython-313.pyc +0 -0
  52. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/user_interaction.cpython-313.pyc +0 -0
  53. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/__pycache__/webpage.cpython-313.pyc +0 -0
  54. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/base.py +0 -0
  55. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/file_ops.py +0 -0
  56. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/generator.py +0 -0
  57. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/methodology.py +0 -0
  58. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/registry.py +0 -0
  59. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/shell.py +0 -0
  60. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/tools/sub_agent.py +0 -0
  61. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis/utils.py +0 -0
  62. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis_ai_assistant.egg-info/dependency_links.txt +0 -0
  63. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis_ai_assistant.egg-info/entry_points.txt +0 -0
  64. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis_ai_assistant.egg-info/requires.txt +0 -0
  65. {jarvis_ai_assistant-0.1.32 → jarvis_ai_assistant-0.1.34}/src/jarvis_ai_assistant.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.32
3
+ Version: 0.1.34
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "jarvis-ai-assistant"
7
- version = "0.1.32"
7
+ version = "0.1.34"
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.32",
5
+ version="0.1.34",
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",
@@ -1,3 +1,3 @@
1
1
  """Jarvis AI Assistant"""
2
2
 
3
- __version__ = "0.1.32"
3
+ __version__ = "0.1.34"
@@ -223,7 +223,7 @@ arguments:
223
223
 
224
224
  if not user_input:
225
225
  while True:
226
- choice = prompt("是否需要为此任务生成方法论以提升Jarvis对类似任务的处理能力?(y/n), 回车跳过: ")
226
+ choice = prompt("是否需要手动为此任务生成方法论以提升Jarvis对类似任务的处理能力?(y/n), 回车跳过: ")
227
227
  if choice == "y":
228
228
  self._make_methodology()
229
229
  break
@@ -103,19 +103,25 @@ def main():
103
103
  parser = argparse.ArgumentParser(description='Jarvis AI Assistant')
104
104
  parser.add_argument('-f', '--files', nargs='*', help='List of files to process')
105
105
  parser.add_argument('--keep-history', action='store_true', help='Keep chat history (do not delete chat session)')
106
- parser.add_argument('-m', '--model', default='kimi', help='选择模型')
106
+ parser.add_argument('-m', '--model', default='', help='选择模型')
107
107
  args = parser.parse_args()
108
108
 
109
109
  load_env_from_file()
110
110
 
111
- ModelRegistry.get_model_registry().set_global_model(args.model)
111
+ model = args.model if args.model else os.getenv('JARVIS_MODEL')
112
+
113
+ if not model:
114
+ PrettyOutput.print("未指定模型,请使用 -m 参数或者设置 JARVIS_MODEL 环境变量", OutputType.ERROR)
115
+ return 1
116
+
117
+ ModelRegistry.get_model_registry().set_global_model(model)
112
118
 
113
119
  try:
114
120
  # 获取全局模型实例
115
121
  agent = Agent()
116
122
 
117
123
  # 欢迎信息
118
- PrettyOutput.print(f"Jarvis 已初始化 - With {args.model}", OutputType.SYSTEM)
124
+ PrettyOutput.print(f"Jarvis 已初始化 - With {model}", OutputType.SYSTEM)
119
125
  if args.keep_history:
120
126
  PrettyOutput.print("已启用历史保留模式", OutputType.INFO)
121
127
 
@@ -0,0 +1,277 @@
1
+ import os
2
+ from typing import Dict, List
3
+ from jarvis.models.base import BaseModel
4
+ from jarvis.utils import PrettyOutput, OutputType
5
+ import requests
6
+ import json
7
+ import base64
8
+
9
+ class AI8Model(BaseModel):
10
+ """AI8 model implementation"""
11
+
12
+ model_name = "ai8"
13
+ BASE_URL = "https://ai8.rcouyi.com"
14
+
15
+ def __init__(self):
16
+ """Initialize model"""
17
+ PrettyOutput.section("支持的模型", OutputType.SUCCESS)
18
+
19
+ PrettyOutput.print("gpt-3.5-turbo", OutputType.INFO)
20
+ PrettyOutput.print("gpt-4-turbo", OutputType.INFO)
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("moonshot-v1-32k", OutputType.INFO)
57
+ PrettyOutput.print("moonshot-v1-128k", OutputType.INFO)
58
+ PrettyOutput.print("ERNIE-Speed-128K", OutputType.INFO)
59
+ PrettyOutput.print("ERNIE-3.5-128K", OutputType.INFO)
60
+
61
+
62
+ PrettyOutput.print("使用AI8_MODEL配置模型", OutputType.SUCCESS)
63
+
64
+ self.system_message = ""
65
+ self.conversation = None
66
+ self.files = []
67
+ self.model = os.getenv("AI8_MODEL") or "deepseek-chat"
68
+ self.token = os.getenv("AI8_API_KEY")
69
+ if not all([self.model, self.token]):
70
+ raise Exception("AI8_MODEL or AI8_API_KEY is not set")
71
+
72
+ def create_conversation(self) -> bool:
73
+ """Create a new conversation"""
74
+ try:
75
+ headers = {
76
+ 'Authorization': self.token,
77
+ 'Content-Type': 'application/json',
78
+ 'Accept': 'application/json, text/plain, */*',
79
+ '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',
80
+ 'X-APP-VERSION': '2.2.2',
81
+ 'Origin': self.BASE_URL,
82
+ 'Referer': f'{self.BASE_URL}/chat?_userMenuKey=chat'
83
+ }
84
+
85
+ # 1. 创建会话
86
+ response = requests.post(
87
+ f"{self.BASE_URL}/api/chat/session",
88
+ headers=headers
89
+ )
90
+
91
+ if response.status_code != 200:
92
+ PrettyOutput.print(f"创建会话失败: {response.status_code}", OutputType.ERROR)
93
+ return False
94
+
95
+ data = response.json()
96
+ if data['code'] != 0:
97
+ PrettyOutput.print(f"创建会话失败: {data.get('msg', '未知错误')}", OutputType.ERROR)
98
+ return False
99
+
100
+ self.conversation = data['data']
101
+ PrettyOutput.print(f"创建会话成功: {data['data']['id']}", OutputType.SUCCESS)
102
+
103
+ # 2. 更新会话设置
104
+ session_data = {
105
+ **self.conversation,
106
+ "contextCount": 1024,
107
+ "prompt": self.system_message,
108
+ "plugins": ["tavily_search"],
109
+ "localPlugins": None,
110
+ "useAppId": 0
111
+ }
112
+
113
+ response = requests.put(
114
+ f"{self.BASE_URL}/api/chat/session/{self.conversation['id']}",
115
+ headers=headers,
116
+ json=session_data
117
+ )
118
+
119
+ if response.status_code == 200:
120
+ data = response.json()
121
+ if data['code'] == 0:
122
+ self.conversation = data['data']
123
+ PrettyOutput.print("会话设置更新成功", OutputType.SUCCESS)
124
+ return True
125
+ else:
126
+ PrettyOutput.print(f"更新会话设置失败: {data.get('msg', '未知错误')}", OutputType.ERROR)
127
+ return False
128
+ else:
129
+ PrettyOutput.print(f"更新会话设置失败: {response.status_code}", OutputType.ERROR)
130
+ return False
131
+
132
+ except Exception as e:
133
+ PrettyOutput.print(f"创建会话异常: {str(e)}", OutputType.ERROR)
134
+ return False
135
+
136
+ def upload_files(self, file_list: List[str]) -> List[Dict]:
137
+ for file_path in file_list:
138
+ name = os.path.basename(file_path)
139
+ with open(file_path, 'rb') as f:
140
+ file_data = f.read()
141
+ base64_data = base64.b64encode(file_data).decode('utf-8')
142
+ self.files.append({
143
+ "name": name,
144
+ "data": f"data:image/png;base64,{base64_data}"
145
+ })
146
+ PrettyOutput.print(f"文件 {name} 已准备好发送", OutputType.SUCCESS)
147
+
148
+ def set_system_message(self, message: str):
149
+ """Set system message"""
150
+ self.system_message = message
151
+
152
+ def chat(self, message: str) -> str:
153
+ """Execute chat with the model
154
+
155
+ Args:
156
+ message: User input message
157
+
158
+ Returns:
159
+ str: Model response
160
+ """
161
+ try:
162
+ # 确保有会话ID
163
+ if not self.conversation:
164
+ if not self.create_conversation():
165
+ raise Exception("Failed to create conversation")
166
+
167
+ headers = {
168
+ 'Authorization': self.token,
169
+ 'Content-Type': 'application/json',
170
+ 'Accept': 'text/event-stream',
171
+ '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',
172
+ 'X-APP-VERSION': '2.2.2',
173
+ 'Origin': self.BASE_URL,
174
+ 'Referer': f'{self.BASE_URL}/chat?_userMenuKey=chat'
175
+ }
176
+
177
+ payload = {
178
+ "text": message,
179
+ "sessionId": self.conversation['id'],
180
+ "files": []
181
+ }
182
+
183
+ # 如果有文件需要发送
184
+ if self.files:
185
+ for file_data in self.files:
186
+ payload["files"].append({
187
+ "name": file_data["name"],
188
+ "data": file_data["data"]
189
+ })
190
+ self.files = [] # 清空已使用的文件
191
+
192
+ response = requests.post(
193
+ f"{self.BASE_URL}/api/chat/completions",
194
+ headers=headers,
195
+ json=payload,
196
+ stream=True
197
+ )
198
+
199
+ if response.status_code != 200:
200
+ error_msg = f"聊天请求失败: {response.status_code}"
201
+ PrettyOutput.print(error_msg, OutputType.ERROR)
202
+ raise Exception(error_msg)
203
+
204
+ # 处理流式响应
205
+ full_response = ""
206
+ for line in response.iter_lines():
207
+ if line:
208
+ line = line.decode('utf-8')
209
+ if line.startswith('data: '):
210
+ try:
211
+ data = json.loads(line[6:])
212
+ if data.get('type') == 'string':
213
+ chunk = data.get('data', '')
214
+ if chunk:
215
+ full_response += chunk
216
+ PrettyOutput.print_stream(chunk)
217
+
218
+ except json.JSONDecodeError:
219
+ continue
220
+
221
+ PrettyOutput.print_stream_end()
222
+
223
+ return full_response
224
+
225
+ except Exception as e:
226
+ PrettyOutput.print(f"聊天异常: {str(e)}", OutputType.ERROR)
227
+ raise e
228
+
229
+ def name(self) -> str:
230
+ """Return model name"""
231
+ return self.model_name
232
+
233
+ def reset(self):
234
+ """Reset model state"""
235
+ self.conversation = None
236
+ self.files = [] # 清空文件列表
237
+
238
+ def delete_chat(self) -> bool:
239
+ """Delete current chat session"""
240
+ try:
241
+ if not self.conversation:
242
+ return True
243
+
244
+ headers = {
245
+ 'Authorization': self.token,
246
+ 'Content-Type': 'application/json',
247
+ 'Accept': 'application/json, text/plain, */*',
248
+ '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',
249
+ 'X-APP-VERSION': '2.2.2',
250
+ 'Origin': self.BASE_URL,
251
+ 'Referer': f'{self.BASE_URL}/chat?_userMenuKey=chat'
252
+ }
253
+
254
+ response = requests.delete(
255
+ f"{self.BASE_URL}/api/chat/session/{self.conversation['id']}",
256
+ headers=headers
257
+ )
258
+
259
+ if response.status_code == 200:
260
+ data = response.json()
261
+ if data['code'] == 0:
262
+ PrettyOutput.print("会话删除成功", OutputType.SUCCESS)
263
+ self.reset()
264
+ return True
265
+ else:
266
+ error_msg = f"删除会话失败: {data.get('msg', '未知错误')}"
267
+ PrettyOutput.print(error_msg, OutputType.ERROR)
268
+ return False
269
+ else:
270
+ error_msg = f"删除会话请求失败: {response.status_code}"
271
+ PrettyOutput.print(error_msg, OutputType.ERROR)
272
+ return False
273
+
274
+ except Exception as e:
275
+ PrettyOutput.print(f"删除会话异常: {str(e)}", OutputType.ERROR)
276
+ return False
277
+
@@ -14,6 +14,34 @@ class OyiModel(BaseModel):
14
14
 
15
15
  def __init__(self):
16
16
  """Initialize model"""
17
+ PrettyOutput.section("支持的模型", OutputType.SUCCESS)
18
+ PrettyOutput.print("gpt-4o-mini", OutputType.INFO)
19
+ PrettyOutput.print("gpt-3.5-turbo", OutputType.INFO)
20
+ PrettyOutput.print("gpt-4o", OutputType.INFO)
21
+ PrettyOutput.print("gpt-4o-2024-11-20", OutputType.INFO)
22
+ PrettyOutput.print("o1-mini", OutputType.INFO)
23
+ PrettyOutput.print("o1-mini-2024-09-12", OutputType.INFO)
24
+ PrettyOutput.print("gpt-4o-all", OutputType.INFO)
25
+ PrettyOutput.print("claude-3-5-sonnet-20240620", OutputType.INFO)
26
+ PrettyOutput.print("claude-3-opus-20240229", OutputType.INFO)
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)
42
+ PrettyOutput.print("使用OYI_MODEL配置模型", OutputType.SUCCESS)
43
+
44
+
17
45
  self.messages = []
18
46
  self.system_message = ""
19
47
  self.conversation = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.32
3
+ Version: 0.1.34
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
@@ -15,12 +15,14 @@ src/jarvis/__pycache__/tools.cpython-313.pyc
15
15
  src/jarvis/__pycache__/utils.cpython-313.pyc
16
16
  src/jarvis/__pycache__/zte_llm.cpython-313.pyc
17
17
  src/jarvis/models/__init__.py
18
+ src/jarvis/models/ai8.py
18
19
  src/jarvis/models/base.py
19
20
  src/jarvis/models/kimi.py
20
21
  src/jarvis/models/openai.py
21
22
  src/jarvis/models/oyi.py
22
23
  src/jarvis/models/registry.py
23
24
  src/jarvis/models/__pycache__/__init__.cpython-313.pyc
25
+ src/jarvis/models/__pycache__/ai8.cpython-313.pyc
24
26
  src/jarvis/models/__pycache__/base.cpython-313.pyc
25
27
  src/jarvis/models/__pycache__/kimi.cpython-313.pyc
26
28
  src/jarvis/models/__pycache__/openai.cpython-313.pyc