jarvis-ai-assistant 0.3.10__py3-none-any.whl → 0.3.11__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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Jarvis AI Assistant"""
3
3
 
4
- __version__ = "0.3.10"
4
+ __version__ = "0.3.11"
@@ -136,6 +136,16 @@
136
136
  "description": "思考操作模型名称",
137
137
  "default": "deep_seek_v3"
138
138
  },
139
+ "JARVIS_WEB_SEARCH_PLATFORM": {
140
+ "type": "string",
141
+ "description": "Web搜索使用的平台名称",
142
+ "default": ""
143
+ },
144
+ "JARVIS_WEB_SEARCH_MODEL": {
145
+ "type": "string",
146
+ "description": "Web搜索使用的模型名称",
147
+ "default": ""
148
+ },
139
149
  "JARVIS_LLM_GROUP": {
140
150
  "type": "string",
141
151
  "description": "选择一个预定义的模型组",
@@ -12,6 +12,10 @@ from ddgs import DDGS # type: ignore[import-not-found]
12
12
 
13
13
  from jarvis.jarvis_agent import Agent
14
14
  from jarvis.jarvis_platform.registry import PlatformRegistry
15
+ from jarvis.jarvis_utils.config import (
16
+ get_web_search_platform_name,
17
+ get_web_search_model_name,
18
+ )
15
19
  from jarvis.jarvis_utils.http import get as http_get
16
20
  from jarvis.jarvis_utils.output import OutputType, PrettyOutput
17
21
 
@@ -136,6 +140,25 @@ class SearchWebTool:
136
140
  "success": False,
137
141
  }
138
142
 
143
+ # 检查是否配置了专门的 Web 搜索平台和模型
144
+ web_search_platform = get_web_search_platform_name()
145
+ web_search_model = get_web_search_model_name()
146
+
147
+ # 如果配置了专门的 Web 搜索平台和模型,优先使用
148
+ if web_search_platform and web_search_model:
149
+ model = PlatformRegistry().create_platform(web_search_platform)
150
+ if model:
151
+ model.set_model_name(web_search_model)
152
+ if model.support_web():
153
+ model.set_web(True)
154
+ model.set_suppress_output(False)
155
+ return {
156
+ "stdout": model.chat_until_success(query),
157
+ "stderr": "",
158
+ "success": True,
159
+ }
160
+
161
+ # 否则使用现有的模型选择流程
139
162
  if agent.model.support_web():
140
163
  model = PlatformRegistry().create_platform(agent.model.platform_name())
141
164
  if not model:
@@ -499,6 +499,31 @@ def get_rag_use_rerank() -> bool:
499
499
  return config.get("use_rerank", True) is True
500
500
 
501
501
 
502
+ # ==============================================================================
503
+ # Web Search Configuration
504
+ # ==============================================================================
505
+
506
+
507
+ def get_web_search_platform_name() -> Optional[str]:
508
+ """
509
+ 获取Web搜索使用的平台名称。
510
+
511
+ 返回:
512
+ Optional[str]: 平台名称,如果未配置则返回None
513
+ """
514
+ return GLOBAL_CONFIG_DATA.get("JARVIS_WEB_SEARCH_PLATFORM")
515
+
516
+
517
+ def get_web_search_model_name() -> Optional[str]:
518
+ """
519
+ 获取Web搜索使用的模型名称。
520
+
521
+ 返回:
522
+ Optional[str]: 模型名称,如果未配置则返回None
523
+ """
524
+ return GLOBAL_CONFIG_DATA.get("JARVIS_WEB_SEARCH_MODEL")
525
+
526
+
502
527
  # ==============================================================================
503
528
  # Tool Configuration
504
529
  # ==============================================================================
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.3.10
3
+ Version: 0.3.11
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
@@ -1,4 +1,4 @@
1
- jarvis/__init__.py,sha256=tk1ticxnbAOJGeyx5laAITBb3eg6KF7MxbYRsoDNBe0,74
1
+ jarvis/__init__.py,sha256=4eE4JJA0Fb7zUXTVi01_rPJMEyES6tv7MbD410hdOqw,74
2
2
  jarvis/jarvis_agent/__init__.py,sha256=NF_eUF85RRplGJyLmInIsTn-09aEPtjj4utYvEALvJw,31802
3
3
  jarvis/jarvis_agent/agent_manager.py,sha256=YzpMiF0H2-eyk2kn2o24Bkj3bXsQx7Pv2vfD4gWepo0,2893
4
4
  jarvis/jarvis_agent/builtin_input_handler.py,sha256=Qs4LAr4xdKLBJpQE81YP4CkucAop86ms0iVoKa1nnso,2468
@@ -44,7 +44,7 @@ jarvis/jarvis_code_analysis/checklists/shell.py,sha256=aRFYhQQvTgbYd-uY5pc8UHIUA
44
44
  jarvis/jarvis_code_analysis/checklists/sql.py,sha256=vR0T6qC7b4dURjJVAd7kSVxyvZEQXPG1Jqc2sNTGp5c,2355
45
45
  jarvis/jarvis_code_analysis/checklists/swift.py,sha256=TPx4I6Gupvs6tSerRKmTSKEPQpOLEbH2Y7LXg1uBgxc,2566
46
46
  jarvis/jarvis_code_analysis/checklists/web.py,sha256=25gGD7pDadZQybNFvALYxWvK0VRjGQb1NVJQElwjyk0,3943
47
- jarvis/jarvis_data/config_schema.json,sha256=xri_qfCrs2AJ-fPwvnV4oU7VJpIrUxddffQMoSaHZ2A,11419
47
+ jarvis/jarvis_data/config_schema.json,sha256=Mw8LveVXoyTaHEgn4d8HOuH-uUEbgjE0yuJJCnppEgo,11700
48
48
  jarvis/jarvis_data/tiktoken/9b5ad71b2ce5302211f9c61530b329a4922fc6a4,sha256=Ijkht27pm96ZW3_3OFE-7xAPtR0YyTWXoRO8_-hlsqc,1681126
49
49
  jarvis/jarvis_git_squash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  jarvis/jarvis_git_squash/main.py,sha256=6PECdAbTbrsJBRLK1pXBh4hdJ_LADh-XXSic1xJi97E,2255
@@ -101,14 +101,14 @@ jarvis/jarvis_tools/registry.py,sha256=TtZ415LUMfWqfcgn3G5V4e3QLLU2ILNRatkP10U0Y
101
101
  jarvis/jarvis_tools/retrieve_memory.py,sha256=0UBZm4wQTXLTj5WHXR9fjsiIDQh-Z2UINVu8cJ12YYg,9488
102
102
  jarvis/jarvis_tools/rewrite_file.py,sha256=eG_WKg6cVAXmuGwUqlWkcuyay5S8DOzEi8vZCmX3O8w,7255
103
103
  jarvis/jarvis_tools/save_memory.py,sha256=DjeFb38OtK9Y_RpWYHz8vL72JdauXZTlc_Y0FUQBtiM,7486
104
- jarvis/jarvis_tools/search_web.py,sha256=kDwC6fy4TFFyok5zFYZ4VCZXyLsbU9jAoxxy26--GIk,5809
104
+ jarvis/jarvis_tools/search_web.py,sha256=Ch11Pacxk83WDfhXUDfavL3S9JYl72HkZyFQjFZbSew,6764
105
105
  jarvis/jarvis_tools/virtual_tty.py,sha256=LTsg1PlsPvgaLShUaxpAKwTpyjXRr0l0qSREI7Q-fBc,26349
106
106
  jarvis/jarvis_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
107
  jarvis/jarvis_tools/cli/main.py,sha256=GsfZJ4OS4Hvxh0H2XiLkgbzm-ajBsb4c0LyjuIAAatE,7718
108
108
  jarvis/jarvis_utils/__init__.py,sha256=67h0ldisGlh3oK4DAeNEL2Bl_VsI3tSmfclasyVlueM,850
109
109
  jarvis/jarvis_utils/builtin_replace_map.py,sha256=4BurljGuiG_I93EBs7mlFlPm9wYC_4CmdTG5tQWpF6g,1712
110
110
  jarvis/jarvis_utils/clipboard.py,sha256=WgbQIQR2sh7_5ZzeX04eT3zXx_mxQbKyJOZXgGX_TcI,2907
111
- jarvis/jarvis_utils/config.py,sha256=HmQfPe05rLZ4e1R_qv40rTHsiCNYtPLzi12UndR01i0,15380
111
+ jarvis/jarvis_utils/config.py,sha256=HwMd5_JgdqubIo050BDG0kfQ_7ySzzZRPgiGEAWxT8s,16083
112
112
  jarvis/jarvis_utils/embedding.py,sha256=oEOEM2qf16DMYwPsQe6srET9BknyjOdY2ef0jsp3Or8,2714
113
113
  jarvis/jarvis_utils/file_processors.py,sha256=XiM248SHS7lLgQDCbORVFWqinbVDUawYxWDOsLXDxP8,3043
114
114
  jarvis/jarvis_utils/git_utils.py,sha256=AkczUiRcGcOnPfz2v3mdLwV1S41IopiAYD2tjeMTDrE,23586
@@ -119,9 +119,9 @@ jarvis/jarvis_utils/methodology.py,sha256=IIMU17WVSunsWXsnXROd4G77LxgYs4xEC_xm_0
119
119
  jarvis/jarvis_utils/output.py,sha256=QRLlKObQKT0KuRSeZRqYb7NlTQvsd1oZXZ41WxeWEuU,10894
120
120
  jarvis/jarvis_utils/tag.py,sha256=f211opbbbTcSyzCDwuIK_oCnKhXPNK-RknYyGzY1yD0,431
121
121
  jarvis/jarvis_utils/utils.py,sha256=LiVui9RMsbfUdzbvBBwbGNC4uniGnLp3LFsk7LXGrQE,47370
122
- jarvis_ai_assistant-0.3.10.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
123
- jarvis_ai_assistant-0.3.10.dist-info/METADATA,sha256=rp-slMeLj1Yk803AxEoLzwNSvSfH0QUSeja5zdq8_Vs,18216
124
- jarvis_ai_assistant-0.3.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
125
- jarvis_ai_assistant-0.3.10.dist-info/entry_points.txt,sha256=4GcWKFxRJD-QU14gw_3ZaW4KuEVxOcZK9i270rwPdjA,1395
126
- jarvis_ai_assistant-0.3.10.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
127
- jarvis_ai_assistant-0.3.10.dist-info/RECORD,,
122
+ jarvis_ai_assistant-0.3.11.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
123
+ jarvis_ai_assistant-0.3.11.dist-info/METADATA,sha256=oUuaxxRov1QSVuHlazfqRNpS5mZe3RU31xNJaD1kVTo,18216
124
+ jarvis_ai_assistant-0.3.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
125
+ jarvis_ai_assistant-0.3.11.dist-info/entry_points.txt,sha256=4GcWKFxRJD-QU14gw_3ZaW4KuEVxOcZK9i270rwPdjA,1395
126
+ jarvis_ai_assistant-0.3.11.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
127
+ jarvis_ai_assistant-0.3.11.dist-info/RECORD,,