jarvis-ai-assistant 0.1.47__tar.gz → 0.1.48__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {jarvis_ai_assistant-0.1.47/src/jarvis_ai_assistant.egg-info → jarvis_ai_assistant-0.1.48}/PKG-INFO +1 -1
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/pyproject.toml +1 -1
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/setup.py +1 -1
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/__init__.py +1 -1
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/main.py +7 -1
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/models/oyi.py +28 -22
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48/src/jarvis_ai_assistant.egg-info}/PKG-INFO +1 -1
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/MANIFEST.in +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/README.md +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/setup.cfg +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/agent.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/models/__init__.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/models/ai8.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/models/base.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/models/kimi.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/models/openai.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/models/registry.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/tools/__init__.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/tools/base.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/tools/file_ops.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/tools/generator.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/tools/methodology.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/tools/registry.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/tools/shell.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/tools/sub_agent.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis/utils.py +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis_ai_assistant.egg-info/SOURCES.txt +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis_ai_assistant.egg-info/dependency_links.txt +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis_ai_assistant.egg-info/entry_points.txt +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/src/jarvis_ai_assistant.egg-info/requires.txt +0 -0
- {jarvis_ai_assistant-0.1.47 → jarvis_ai_assistant-0.1.48}/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.48"
|
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.48",
|
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",
|
@@ -104,6 +104,7 @@ def main():
|
|
104
104
|
parser.add_argument('-f', '--files', nargs='*', help='要处理的文件列表')
|
105
105
|
parser.add_argument('--keep-history', action='store_true', help='保持聊天历史(不删除会话)')
|
106
106
|
parser.add_argument('-p', '--platform', default='', help='选择AI平台')
|
107
|
+
parser.add_argument('-m', '--model', default='', help='模型') # 用于指定使用的模型名称,默认使用环境变量或平台默认模型
|
107
108
|
args = parser.parse_args()
|
108
109
|
|
109
110
|
load_env_from_file()
|
@@ -120,6 +121,11 @@ def main():
|
|
120
121
|
# 获取全局模型实例
|
121
122
|
agent = Agent()
|
122
123
|
|
124
|
+
# 如果用户传入了模型参数,则更换当前模型为用户指定的模型
|
125
|
+
if args.model:
|
126
|
+
PrettyOutput.print(f"用户传入了模型参数,更换模型: {args.model}", OutputType.USER)
|
127
|
+
agent.model.set_model_name(args.model)
|
128
|
+
|
123
129
|
# 欢迎信息
|
124
130
|
PrettyOutput.print(f"Jarvis 已初始化 - With {platform} 平台,模型: {agent.model.name()}", OutputType.SYSTEM)
|
125
131
|
if args.keep_history:
|
@@ -151,4 +157,4 @@ def main():
|
|
151
157
|
return 0
|
152
158
|
|
153
159
|
if __name__ == "__main__":
|
154
|
-
exit(main())
|
160
|
+
exit(main())
|
@@ -29,7 +29,7 @@ class OyiModel(BasePlatform):
|
|
29
29
|
self.messages = []
|
30
30
|
self.system_message = ""
|
31
31
|
self.conversation = None
|
32
|
-
self.upload_files = []
|
32
|
+
self.upload_files = [] # 重命名 files 为 upload_files
|
33
33
|
self.first_chat = True
|
34
34
|
|
35
35
|
self.token = os.getenv("OYI_API_KEY")
|
@@ -244,7 +244,7 @@ class OyiModel(BasePlatform):
|
|
244
244
|
PrettyOutput.print(f"删除会话异常: {str(e)}", OutputType.ERROR)
|
245
245
|
return False
|
246
246
|
|
247
|
-
def
|
247
|
+
def upload_files(self, file_list: List[str]) -> List[Dict]:
|
248
248
|
"""Upload a file to OYI API
|
249
249
|
|
250
250
|
Args:
|
@@ -269,30 +269,36 @@ class OyiModel(BasePlatform):
|
|
269
269
|
'Referer': 'https://ai.rcouyi.com/'
|
270
270
|
}
|
271
271
|
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
272
|
+
for file_path in file_list:
|
273
|
+
# 检查文件类型
|
274
|
+
file_type = mimetypes.guess_type(file_path)[0]
|
275
|
+
if not file_type or not file_type.startswith(('image/', 'text/', 'application/')):
|
276
|
+
PrettyOutput.print(f"文件类型不支持: {file_type}", OutputType.ERROR)
|
277
|
+
continue
|
276
278
|
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
)
|
279
|
+
with open(file_path, 'rb') as f:
|
280
|
+
files = {
|
281
|
+
'file': (os.path.basename(file_path), f, file_type)
|
282
|
+
}
|
282
283
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
284
|
+
response = requests.post(
|
285
|
+
f"{self.BASE_URL}/chatapi/m_file/uploadfile",
|
286
|
+
headers=headers,
|
287
|
+
files=files
|
288
|
+
)
|
289
|
+
|
290
|
+
if response.status_code == 200:
|
291
|
+
data = response.json()
|
292
|
+
if data.get('code') == 200:
|
293
|
+
PrettyOutput.print("文件上传成功", OutputType.SUCCESS)
|
294
|
+
self.upload_files.append(data)
|
295
|
+
return data
|
296
|
+
else:
|
297
|
+
PrettyOutput.print(f"文件上传失败: {data.get('message')}", OutputType.ERROR)
|
298
|
+
return None
|
290
299
|
else:
|
291
|
-
PrettyOutput.print(f"文件上传失败: {
|
300
|
+
PrettyOutput.print(f"文件上传失败: {response.status_code}", OutputType.ERROR)
|
292
301
|
return None
|
293
|
-
else:
|
294
|
-
PrettyOutput.print(f"文件上传失败: {response.status_code}", OutputType.ERROR)
|
295
|
-
return None
|
296
302
|
|
297
303
|
except Exception as e:
|
298
304
|
PrettyOutput.print(f"文件上传异常: {str(e)}", OutputType.ERROR)
|
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
|
File without changes
|
File without changes
|
File without changes
|