jarvis-ai-assistant 0.1.6__py3-none-any.whl → 0.1.8__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 +1 -1
- jarvis/__pycache__/__init__.cpython-313.pyc +0 -0
- jarvis/__pycache__/agent.cpython-313.pyc +0 -0
- jarvis/__pycache__/main.cpython-313.pyc +0 -0
- jarvis/__pycache__/models.cpython-313.pyc +0 -0
- jarvis/__pycache__/zte_llm.cpython-313.pyc +0 -0
- jarvis/agent.py +203 -100
- jarvis/main.py +22 -6
- jarvis/models.py +58 -66
- jarvis/tools/__init__.py +0 -2
- jarvis/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- jarvis/tools/__pycache__/base.cpython-313.pyc +0 -0
- jarvis/tools/__pycache__/bing_search.cpython-313.pyc +0 -0
- jarvis/tools/__pycache__/file_ops.cpython-313.pyc +0 -0
- jarvis/tools/__pycache__/search.cpython-313.pyc +0 -0
- jarvis/tools/__pycache__/shell.cpython-313.pyc +0 -0
- jarvis/tools/__pycache__/sub_agent.cpython-313.pyc +0 -0
- jarvis/tools/__pycache__/webpage.cpython-313.pyc +0 -0
- jarvis/tools/base.py +8 -19
- jarvis/tools/file_ops.py +1 -1
- jarvis/tools/search.py +112 -16
- jarvis/tools/shell.py +1 -20
- jarvis/tools/sub_agent.py +17 -75
- jarvis/tools/webpage.py +12 -26
- jarvis/zte_llm.py +26 -27
- {jarvis_ai_assistant-0.1.6.dist-info → jarvis_ai_assistant-0.1.8.dist-info}/METADATA +2 -1
- jarvis_ai_assistant-0.1.8.dist-info/RECORD +38 -0
- jarvis/tools/user_input.py +0 -74
- jarvis_ai_assistant-0.1.6.dist-info/RECORD +0 -38
- {jarvis_ai_assistant-0.1.6.dist-info → jarvis_ai_assistant-0.1.8.dist-info}/WHEEL +0 -0
- {jarvis_ai_assistant-0.1.6.dist-info → jarvis_ai_assistant-0.1.8.dist-info}/entry_points.txt +0 -0
- {jarvis_ai_assistant-0.1.6.dist-info → jarvis_ai_assistant-0.1.8.dist-info}/top_level.txt +0 -0
jarvis/tools/user_input.py
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any
|
|
2
|
-
from ..utils import PrettyOutput, OutputType, get_multiline_input
|
|
3
|
-
|
|
4
|
-
class UserInputTool:
|
|
5
|
-
name = "ask_user"
|
|
6
|
-
description = """Ask user for information or confirmation.
|
|
7
|
-
|
|
8
|
-
Use this tool when you need:
|
|
9
|
-
1. Additional information
|
|
10
|
-
2. Confirmation before critical actions
|
|
11
|
-
3. User preferences or choices"""
|
|
12
|
-
|
|
13
|
-
parameters = {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {
|
|
16
|
-
"question": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "Clear question for the user"
|
|
19
|
-
},
|
|
20
|
-
"options": {
|
|
21
|
-
"type": "string",
|
|
22
|
-
"description": "Optional: Numbered list of choices",
|
|
23
|
-
"default": ""
|
|
24
|
-
},
|
|
25
|
-
"context": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"description": "Optional: Additional context to help user understand",
|
|
28
|
-
"default": ""
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"required": ["question"]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
def execute(self, args: Dict) -> Dict[str, Any]:
|
|
35
|
-
"""向用户询问信息并返回响应"""
|
|
36
|
-
try:
|
|
37
|
-
question = args["question"]
|
|
38
|
-
options = args.get("options", "")
|
|
39
|
-
context = args.get("context", "")
|
|
40
|
-
|
|
41
|
-
# 显示问题
|
|
42
|
-
PrettyOutput.section("用户确认", OutputType.USER)
|
|
43
|
-
|
|
44
|
-
# 显示上下文(如果有)
|
|
45
|
-
if context:
|
|
46
|
-
PrettyOutput.print(f"背景: {context}", OutputType.INFO)
|
|
47
|
-
|
|
48
|
-
# 显示问题
|
|
49
|
-
PrettyOutput.print(f"问题: {question}", OutputType.USER)
|
|
50
|
-
|
|
51
|
-
# 显示选项(如果有)
|
|
52
|
-
if options:
|
|
53
|
-
PrettyOutput.print("\n选项:\n" + options, OutputType.INFO)
|
|
54
|
-
|
|
55
|
-
# 获取用户输入
|
|
56
|
-
response = get_multiline_input("请输入您的回答:")
|
|
57
|
-
|
|
58
|
-
if response == "__interrupt__":
|
|
59
|
-
return {
|
|
60
|
-
"success": False,
|
|
61
|
-
"error": "User cancelled the input"
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
"success": True,
|
|
66
|
-
"stdout": response,
|
|
67
|
-
"stderr": ""
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
except Exception as e:
|
|
71
|
-
return {
|
|
72
|
-
"success": False,
|
|
73
|
-
"error": f"Failed to get user input: {str(e)}"
|
|
74
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
jarvis/__init__.py,sha256=IB2q6sPGefOsNYLmp5aaOnkS9qWc9ZMY1HQ6V-l-xaY,49
|
|
2
|
-
jarvis/agent.py,sha256=KLeC4oWUYMRXg4QgjyVbfSaJwaIghfJ6KE4JpIS2blI,7225
|
|
3
|
-
jarvis/main.py,sha256=pRwtXWRnbBC3J-xbtuYTxQ0e9JuwU5XxCzbS5SsQESU,6118
|
|
4
|
-
jarvis/models.py,sha256=ZSdUEdVb3aFgvvMtNZuDh3kVXAlA_0CPWv-BzTsLdv8,4508
|
|
5
|
-
jarvis/utils.py,sha256=3hLtv-HcBL8Ngw69cowhARuIFrjcQ6yRP3Y1o9CvtsI,5992
|
|
6
|
-
jarvis/zte_llm.py,sha256=fACFyhEX2ssGC-VOJucBDF_khCFZtyQEC9r9FChae-Q,4631
|
|
7
|
-
jarvis/__pycache__/__init__.cpython-313.pyc,sha256=---ccXWtkwpa6rJNXmjP8vCpz9eCZLk6M1yN3clIrbk,208
|
|
8
|
-
jarvis/__pycache__/agent.cpython-313.pyc,sha256=_i8Bj7p2cBi8G6y8s-7LF-cLO05V3c8AVDoEGbmZbgg,8362
|
|
9
|
-
jarvis/__pycache__/main.cpython-313.pyc,sha256=gJ8eJXVTDuNplc_yjMOxuM17xHwLi6jMtYlB9yiABBc,7963
|
|
10
|
-
jarvis/__pycache__/models.cpython-313.pyc,sha256=7ofJ31hdS9H_VHVpAi_gQGxIcl25i4VWZUpXOinRAnQ,5548
|
|
11
|
-
jarvis/__pycache__/tools.cpython-313.pyc,sha256=lAD4LrnnWzNZQmHXGfZ_2l7oskOpr2_2OC-gdFhxQY8,33933
|
|
12
|
-
jarvis/__pycache__/utils.cpython-313.pyc,sha256=k4jyAlx4tlW0MKLMLzV7OOH9zsKrK0H955kY6M2SuFU,8772
|
|
13
|
-
jarvis/__pycache__/zte_llm.cpython-313.pyc,sha256=OHFPd1MiNkqoncDIFlCj592Y9bQZ8c0Gq6JKJ0enyPA,5553
|
|
14
|
-
jarvis/tools/__init__.py,sha256=Bv3Djt_To60p248ECO2H_LqsTmUriLsq9MDb1Q-uuzA,356
|
|
15
|
-
jarvis/tools/base.py,sha256=rYLrNEpIdmrDm1WavOTyldXZ5dZWVRAmukiMcX40UZU,4436
|
|
16
|
-
jarvis/tools/file_ops.py,sha256=05Vc4u-NGMjLD15WI52eL_nt_RyYt-Z_cXJnnBepf-c,3781
|
|
17
|
-
jarvis/tools/search.py,sha256=dyJmeP_s2tWv5KQejOl-TuVF12B6SXViiXEyTemD1Wo,1412
|
|
18
|
-
jarvis/tools/shell.py,sha256=P0rSaXt-GOXX_-XwkpiLpOXt8Thou4835xGAedxGoGA,2926
|
|
19
|
-
jarvis/tools/sub_agent.py,sha256=t4Lb61_rLyjrbpL4p17Fd1-Or_K12zsNGkAXbXmZPic,3756
|
|
20
|
-
jarvis/tools/user_input.py,sha256=ux3-FE4m5LJIQaoR4qYWeabBK2t0Dk0Irt6_96qUMIc,2313
|
|
21
|
-
jarvis/tools/webpage.py,sha256=UTEomu5j7jbOw8c5az2jsjv5E7LeokWKj1QahvZO7xc,3077
|
|
22
|
-
jarvis/tools/__pycache__/__init__.cpython-313.pyc,sha256=aptY-PF6DpP4xXXHRVfjPV1jQGXAhqcBaTv_ZNei2FA,497
|
|
23
|
-
jarvis/tools/__pycache__/base.cpython-313.pyc,sha256=fEj3a31NMJpaZug4nohtE9OnSCfM3YtzclYYTJvNYJg,6632
|
|
24
|
-
jarvis/tools/__pycache__/file_ops.cpython-313.pyc,sha256=bawv11xhWSj5wCtW0QeJLI-InhUBUXaSkogq6rZzvTQ,3636
|
|
25
|
-
jarvis/tools/__pycache__/python_script.cpython-313.pyc,sha256=8JpryqTovEiTvBlWAK1KjZmPvHUuPc9GT9rTXBEQoJc,6693
|
|
26
|
-
jarvis/tools/__pycache__/rag.cpython-313.pyc,sha256=JH6-PSZRMKAvTZqCwlRXJGClxYXNMs-vetU0q7hBLz0,6064
|
|
27
|
-
jarvis/tools/__pycache__/search.cpython-313.pyc,sha256=VX9zztOwIsPCkYwev0A0XJGyu4Tr0PQcQkbbqx8vfB0,1870
|
|
28
|
-
jarvis/tools/__pycache__/shell.cpython-313.pyc,sha256=0B-mfYwkkZCCCfBQV6Mut0S2ZtW2W4Cykh4rP2W6LJM,3652
|
|
29
|
-
jarvis/tools/__pycache__/sub_agent.cpython-313.pyc,sha256=vkTS0oWAU-We7j7tPs7IbvDcsLh2QNJVQ9Kv_LiMnUs,4021
|
|
30
|
-
jarvis/tools/__pycache__/user_confirmation.cpython-313.pyc,sha256=wK3Ev10lHSUSRvoYmi7A0GzxYkzU-C4Wfhs5qW_HBqs,2271
|
|
31
|
-
jarvis/tools/__pycache__/user_input.cpython-313.pyc,sha256=JjTFOhObKsKF4Pn8KBRuKfV1_Ssj083fjU7Mfc_5z7c,2531
|
|
32
|
-
jarvis/tools/__pycache__/user_interaction.cpython-313.pyc,sha256=RuVZ-pmiPBDywY3efgXSfohMAciC1avMGPmBK5qlnew,3305
|
|
33
|
-
jarvis/tools/__pycache__/webpage.cpython-313.pyc,sha256=VcpkaV8IyOOtebedXjn8ybjr8AglU-3-Cs80yzE4FYo,3628
|
|
34
|
-
jarvis_ai_assistant-0.1.6.dist-info/METADATA,sha256=3ACjmVA3LVSxIHOWf5hHlm5kEvy9mSOqeSgVgIcYJ7s,3690
|
|
35
|
-
jarvis_ai_assistant-0.1.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
36
|
-
jarvis_ai_assistant-0.1.6.dist-info/entry_points.txt,sha256=iKu7OMfew9dtfGhW71gIMTg4wvafuPqKb4wyQOnMAGU,44
|
|
37
|
-
jarvis_ai_assistant-0.1.6.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
|
|
38
|
-
jarvis_ai_assistant-0.1.6.dist-info/RECORD,,
|
|
File without changes
|
{jarvis_ai_assistant-0.1.6.dist-info → jarvis_ai_assistant-0.1.8.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|