jarvis-ai-assistant 0.1.157__py3-none-any.whl → 0.1.158__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 CHANGED
@@ -1,3 +1,3 @@
1
1
  """Jarvis AI Assistant"""
2
2
 
3
- __version__ = "0.1.157"
3
+ __version__ = "0.1.158"
@@ -180,6 +180,8 @@ def extract_methodology_from_url(url):
180
180
  try:
181
181
  # 获取平台实例
182
182
  platform = PlatformRegistry().get_normal_platform()
183
+
184
+ platform.web = True
183
185
 
184
186
  # 构建提取提示
185
187
  prompt = f"""请从以下URL内容中提取方法论:
@@ -13,6 +13,7 @@ class BasePlatform(ABC):
13
13
  def __init__(self):
14
14
  """Initialize model"""
15
15
  self.suppress_output = True # 添加输出控制标志
16
+ self.web = False # 添加web属性,默认false
16
17
 
17
18
  def __del__(self):
18
19
  """Destroy model"""
@@ -92,3 +93,7 @@ class BasePlatform(ABC):
92
93
  def set_suppress_output(self, suppress: bool):
93
94
  """Set whether to suppress output"""
94
95
  self.suppress_output = suppress
96
+
97
+ def set_web(self, web: bool):
98
+ """Set web flag"""
99
+ self.web = web
@@ -54,7 +54,6 @@ class KimiModel(BasePlatform):
54
54
  self.first_chat = True # 添加标记,用于判断是否是第一次对话
55
55
  self.system_message = ""
56
56
  self.model_name = "kimi"
57
- self.web = os.getenv("KIMI_WEB", "false") == "true"
58
57
 
59
58
  def set_system_message(self, message: str):
60
59
  """Set system message"""
@@ -33,7 +33,6 @@ class YuanbaoPlatform(BasePlatform):
33
33
  # 从环境变量中获取必要参数
34
34
  self.cookies = os.getenv("YUANBAO_COOKIES") # 认证cookies
35
35
  self.agent_id = os.getenv("YUANBAO_AGENT_ID") # 代理ID
36
- self.web = os.getenv("YUANBAO_WEB", "false") == "true" # 是否启用网页功能
37
36
 
38
37
  if not self.cookies:
39
38
  message = (
@@ -23,11 +23,6 @@ class ScriptTool:
23
23
  "type": "string",
24
24
  "description": "脚本解释器: 如bash, python3, expect, perl, ruby等任意解释器。如需直接执行shell命令, 可使用bash作为解释器"
25
25
  },
26
- "script_type": {
27
- "type": "string",
28
- "enum": ["shell_command", "shell_script", "python_script"],
29
- "description": "已废弃,请使用interpreter参数。脚本类型: shell_command (Shell命令), shell_script (Shell脚本), python_script (Python脚本)"
30
- },
31
26
  "script_content": {
32
27
  "type": "string",
33
28
  "description": "要执行的脚本内容"
@@ -142,23 +137,8 @@ class ScriptTool:
142
137
  "stderr": "Missing or empty script_content parameter"
143
138
  }
144
139
 
145
- # Get interpreter, with fallback to script_type for backward compatibility
146
- interpreter = args.get("interpreter")
147
- script_type = args.get("script_type")
148
-
149
- # Handle backward compatibility
150
- if interpreter is None and script_type is not None:
151
- if script_type == "shell_command":
152
- # For direct shell commands, use bash -c
153
- return self._execute_script_with_interpreter("bash -c", script_content)
154
- elif script_type == "shell_script":
155
- interpreter = "bash"
156
- elif script_type == "python_script":
157
- interpreter = "python"
158
-
159
- # Default to bash if nothing specified
160
- if interpreter is None:
161
- interpreter = "bash"
140
+ # Get interpreter, default to bash if not specified
141
+ interpreter = args.get("interpreter", "bash")
162
142
 
163
143
  # Execute the script with the specified interpreter
164
144
  return self._execute_script_with_interpreter(interpreter, script_content)
@@ -22,19 +22,6 @@ class WebpageTool:
22
22
  "required": ["url"]
23
23
  }
24
24
 
25
- def __init__(self):
26
- if os.getenv("YUANBAO_COOKIES", "") != "" and os.getenv("YUANBAO_AGENT_ID", "") != "":
27
- self.platform = "yuanbao"
28
- self.model = "deep_seek"
29
- elif os.getenv("KIMI_API_KEY", "") != "":
30
- self.platform = "kimi"
31
- self.model = "k1"
32
- else:
33
- self.platform = ""
34
-
35
- @staticmethod
36
- def check() -> bool:
37
- return os.getenv("YUANBAO_COOKIES", "") != "" and os.getenv("YUANBAO_AGENT_ID", "") != "" or os.getenv("KIMI_API_KEY", "") != ""
38
25
 
39
26
  def execute(self, args: Dict[str, Any]) -> Dict[str, Any]:
40
27
  """Read webpage content using Yuanbao model"""
@@ -43,9 +30,9 @@ class WebpageTool:
43
30
  want = args.get("want", "请总结这个网页的主要内容")
44
31
 
45
32
  # Create Yuanbao model instance
46
- model = PlatformRegistry().create_platform(self.platform)
33
+ model = PlatformRegistry().get_normal_platform()
34
+ model.web = True
47
35
  model.set_suppress_output(False) # type: ignore
48
- model.set_model_name(self.model) # type: ignore
49
36
 
50
37
  # Construct prompt based on want parameter
51
38
  prompt = f"""请帮我处理这个网页:{url}
@@ -13,26 +13,11 @@ class SearchWebTool:
13
13
  }
14
14
  }
15
15
 
16
- def __init__(self):
17
- if os.getenv("YUANBAO_COOKIES", "") != "" and os.getenv("YUANBAO_AGENT_ID", "") != "":
18
- self.platform = "yuanbao"
19
- self.model = "deep_seek"
20
- elif os.getenv("KIMI_API_KEY", "") != "":
21
- self.platform = "kimi"
22
- self.model = "k1"
23
- else:
24
- self.platform = ""
25
-
26
-
27
- @staticmethod
28
- def check() -> bool:
29
- return os.getenv("YUANBAO_COOKIES", "") != "" and os.getenv("YUANBAO_AGENT_ID", "") != "" or os.getenv("KIMI_API_KEY", "") != ""
30
-
31
16
  def execute(self, args: Dict[str, Any]) -> Dict[str, Any]: # type: ignore
32
17
  query = args.get("query")
33
- model = PlatformRegistry().create_platform(self.platform)
18
+ model = PlatformRegistry().get_normal_platform()
19
+ model.web = True
34
20
  model.set_suppress_output(False) # type: ignore
35
- model.set_model_name(self.model) # type: ignore
36
21
  return {
37
22
  "stdout": model.chat_until_success(query), # type: ignore
38
23
  "stderr": "",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.157
3
+ Version: 0.1.158
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=G3q-Eq-Sc7_tQqFt7Wy1LscfH-HPPqGIAGkniVU5bXA,50
1
+ jarvis/__init__.py,sha256=fJj9Z5D55H1onkVpg4D1Cvjzfk9M_sYvzmzi4v5NZGY,50
2
2
  jarvis/jarvis_agent/__init__.py,sha256=tii6khwfG971MJiMfKSLwlKTjB3iEv8ITE3JqYSkfQA,24824
3
3
  jarvis/jarvis_agent/builtin_input_handler.py,sha256=3rRA-7v_VUSFG1s7tTKhriq9vv0nsa3t69ReV0xH5gs,1505
4
4
  jarvis/jarvis_agent/file_input_handler.py,sha256=auBbBfS4Ux5ksczeRe9LtsmMm4hKrPxinW5leE9Rtyc,3575
@@ -45,15 +45,15 @@ jarvis/jarvis_lsp/rust.py,sha256=ICmQs5UVdMZwn5KjaF1YRXBCLUMtGF8Z9IwE5rqWkrU,368
45
45
  jarvis/jarvis_mcp/__init__.py,sha256=gi74_Yz5nsEFhrAyCg1Ovxsj-hLweLjMGoOaceL2yx4,2090
46
46
  jarvis/jarvis_mcp/sse_mcp_client.py,sha256=Qd09ymgZmxQvaFUzz8I3AI46v6AqmMbGaF0iBbExAGY,23459
47
47
  jarvis/jarvis_mcp/stdio_mcp_client.py,sha256=DtRO4dqBoxI8W0H0rVR5zxZLR0theKxRAQ-qzQE9qPg,11806
48
- jarvis/jarvis_methodology/main.py,sha256=5PXHX_UmoAFWWxCZqY-iNt8cg8FkWa1CcXcRGPo_DUg,11753
48
+ jarvis/jarvis_methodology/main.py,sha256=i0sOKeGf9-87M0jY4q6sgw4dAPt800PHiZjseLAQmO0,11782
49
49
  jarvis/jarvis_multi_agent/__init__.py,sha256=SX8lBErhltKyYRM-rymrMz3sJ0Zl3hBXrpsPdFgzkQc,4399
50
50
  jarvis/jarvis_multi_agent/main.py,sha256=aGuUC3YQmahabqwDwZXJjfQLYsZ3KIZdf8DZDlVNMe4,1543
51
51
  jarvis/jarvis_platform/__init__.py,sha256=oD9i4ugZ2q6Hys3noLOvzPUUHqE2PJ_Je1r2dLLTscw,80
52
- jarvis/jarvis_platform/base.py,sha256=AKsqWU7K4LdVw5JldFKpgTUyQc28mnWoRDQAUnDbihE,3263
52
+ jarvis/jarvis_platform/base.py,sha256=um9_BZgOJSg0nlmywYGAxwFRL-8409OnlvfgQkh5RUo,3406
53
53
  jarvis/jarvis_platform/human.py,sha256=WCzvBtQUMN7ys4rQl6UT7Zdp4x5RaGv1U4vBx7ROxfo,2438
54
- jarvis/jarvis_platform/kimi.py,sha256=h1BP0vey30upZ9g-b8pU87rQGd3fHcgAQo_51Nv9DZY,16697
54
+ jarvis/jarvis_platform/kimi.py,sha256=GgUekusFzx2842K-PrES3c2oprLbPCjQhbyjU0UKycg,16637
55
55
  jarvis/jarvis_platform/registry.py,sha256=wvXTKXqAoW6GPaLKCPYhRB9QhVe1xfoVbVPBZAxl_uA,7716
56
- jarvis/jarvis_platform/yuanbao.py,sha256=X2lYZ3SxBzdaCwd5ooq9fxYbu14RUpeDILYg0W5W7Xc,21902
56
+ jarvis/jarvis_platform/yuanbao.py,sha256=9nIyg5Xx9rdUaJAK_Tj8HumOT5mwpa-V907dZGot-4E,21811
57
57
  jarvis/jarvis_platform_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
58
  jarvis/jarvis_platform_manager/main.py,sha256=xJM86DQFyYDysMyQEJDAwB2oSYcWg_zi1mFld0zyquM,22572
59
59
  jarvis/jarvis_smart_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -66,16 +66,16 @@ jarvis/jarvis_tools/chdir.py,sha256=do_OdtabiH3lZcT_ynjSAX66XgH2gPl9mYiS7dMMDa8,
66
66
  jarvis/jarvis_tools/code_plan.py,sha256=jNa2rs4J3Fam8Q_RHE2_QvVch21TPp-Zfv-W6iQ3D_0,7729
67
67
  jarvis/jarvis_tools/create_code_agent.py,sha256=SRiQXZf57ViIDh6YSEmJkcoSKft0-y3iDfWF8f1bvZU,3387
68
68
  jarvis/jarvis_tools/create_sub_agent.py,sha256=wGiHukvi58wb1AKW5beP7R8VvApOn8TOeGmtXsmcETE,3001
69
- jarvis/jarvis_tools/execute_script.py,sha256=3sR_u6-SLbzmcUbXjHLN-rGjoelIj4uAefys5la_x7o,6759
69
+ jarvis/jarvis_tools/execute_script.py,sha256=AeuC3yZIg-nBq_LTIyqxu-lG_uLG63lvwO28A6dRDYA,5715
70
70
  jarvis/jarvis_tools/file_analyzer.py,sha256=XCsFB4dZ9qy2q929hqi1rTngj6AtRtIaPx_W7lJAcpQ,4814
71
71
  jarvis/jarvis_tools/file_operation.py,sha256=sB1x0zI1dULXV7FG17wkiMQ7mQAEnXVd_5rakQ0Thik,9109
72
72
  jarvis/jarvis_tools/find_methodology.py,sha256=TIUrezAql6wY3-wqnOPfGrO0tqS5N_-eU6YimCzaepM,2268
73
73
  jarvis/jarvis_tools/lsp_get_diagnostics.py,sha256=IYqv8jQwSK71sZpDBRolSDnYii8t0M7fzLthhMYTeGk,5322
74
74
  jarvis/jarvis_tools/methodology.py,sha256=gnlJojY4Dg5v9AAB5xcpKqpPIHs0tOYVtzTHkwOrWk0,5214
75
75
  jarvis/jarvis_tools/read_code.py,sha256=_X6D3AIgRD9YplSDnFhXOm8wQAZMA3pkkXy31SG33l0,6041
76
- jarvis/jarvis_tools/read_webpage.py,sha256=2QF0zAyApl0bOr9604aml_uuqBZcPefVuHvRfWzrnzk,2598
76
+ jarvis/jarvis_tools/read_webpage.py,sha256=1AXXEX69fPJsPL7PBZDM1G4Z-MM13pUt34JXitsAFM4,2022
77
77
  jarvis/jarvis_tools/registry.py,sha256=l1wHR76TQWB1iUKh9MGKIIMNKUpSLk3GfYH8rhD1N90,26322
78
- jarvis/jarvis_tools/search_web.py,sha256=kWW9K2QUR2AxPq6gcyx4Bgy-0Y4gzcdErq1DNT1EYM4,1333
78
+ jarvis/jarvis_tools/search_web.py,sha256=hMrcSnKcjH6YcV8WY4tangEid7y1L-QbyeXDlBofoy8,756
79
79
  jarvis/jarvis_tools/virtual_tty.py,sha256=Rpn9VXUG17LQsY87F_O6UCjN_opXB05mpwozxYf-xVI,16372
80
80
  jarvis/jarvis_utils/__init__.py,sha256=KMg-KY5rZIhGTeOD5e2Xo5CU7DX1DUz4ULWAaTQ-ZNw,825
81
81
  jarvis/jarvis_utils/builtin_replace_map.py,sha256=Dt8YL4Sk5uALTMPT_n-lhshRWvFWPRPwV4stASOecQ8,4290
@@ -89,9 +89,9 @@ jarvis/jarvis_utils/methodology.py,sha256=XayEVGXP5RfDBWj4bMOVFWplyrSp4GsXHwOTWo
89
89
  jarvis/jarvis_utils/output.py,sha256=BmWdB1bmizv0xfU4Z___9p_xQodorriIcEgADVq9fk0,8416
90
90
  jarvis/jarvis_utils/tag.py,sha256=YtXBYuZWy8j8YbeQX2qRrHRQl6Gp2Vt7W4p-2yjo0a4,405
91
91
  jarvis/jarvis_utils/utils.py,sha256=fNZjDj-qP0cum1RfWmI8D5VVgqT-tBUPsc8n_XPGLQY,4246
92
- jarvis_ai_assistant-0.1.157.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
93
- jarvis_ai_assistant-0.1.157.dist-info/METADATA,sha256=_dp4387zyCbUoj15sZ4OfJR9txTvI_E-d3au1jSyZjM,12669
94
- jarvis_ai_assistant-0.1.157.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
95
- jarvis_ai_assistant-0.1.157.dist-info/entry_points.txt,sha256=cKz_9SEpOvElTubKPMZMAdskD4GHz-NyKWRNssIVAWE,973
96
- jarvis_ai_assistant-0.1.157.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
97
- jarvis_ai_assistant-0.1.157.dist-info/RECORD,,
92
+ jarvis_ai_assistant-0.1.158.dist-info/licenses/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
93
+ jarvis_ai_assistant-0.1.158.dist-info/METADATA,sha256=u0gWbBvTrAsaE7KhFHwOgrWwBZntpU62UGPqOx10dyM,12669
94
+ jarvis_ai_assistant-0.1.158.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
95
+ jarvis_ai_assistant-0.1.158.dist-info/entry_points.txt,sha256=cKz_9SEpOvElTubKPMZMAdskD4GHz-NyKWRNssIVAWE,973
96
+ jarvis_ai_assistant-0.1.158.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
97
+ jarvis_ai_assistant-0.1.158.dist-info/RECORD,,