jarvis-ai-assistant 0.1.115__py3-none-any.whl → 0.1.116__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 +1 -1
- jarvis/{agent.py → jarvis_agent/__init__.py} +35 -159
- jarvis/jarvis_agent/output_handler.py +23 -0
- jarvis/jarvis_code_agent/code_agent.py +11 -11
- jarvis/jarvis_code_agent/file_select.py +28 -7
- jarvis/jarvis_code_agent/patch.py +25 -2
- jarvis/jarvis_code_agent/relevant_files.py +1 -1
- jarvis/jarvis_codebase/main.py +2 -2
- jarvis/jarvis_lsp/cpp.py +1 -1
- jarvis/jarvis_lsp/go.py +1 -1
- jarvis/jarvis_lsp/registry.py +1 -1
- jarvis/jarvis_lsp/rust.py +1 -1
- jarvis/jarvis_multi_agent/__init__.py +147 -0
- jarvis/jarvis_platform/ai8.py +2 -2
- jarvis/jarvis_platform/base.py +14 -4
- jarvis/jarvis_platform/kimi.py +2 -2
- jarvis/jarvis_platform/ollama.py +1 -1
- jarvis/jarvis_platform/openai.py +1 -1
- jarvis/jarvis_platform/oyi.py +1 -1
- jarvis/jarvis_platform/registry.py +1 -1
- jarvis/jarvis_platform_manager/main.py +422 -6
- jarvis/jarvis_platform_manager/openai_test.py +139 -0
- jarvis/jarvis_rag/main.py +2 -2
- jarvis/jarvis_smart_shell/main.py +17 -16
- jarvis/jarvis_tools/ask_codebase.py +1 -1
- jarvis/jarvis_tools/ask_user.py +1 -1
- jarvis/jarvis_tools/chdir.py +1 -1
- jarvis/jarvis_tools/code_review.py +3 -3
- jarvis/jarvis_tools/create_code_agent.py +1 -1
- jarvis/jarvis_tools/create_sub_agent.py +2 -2
- jarvis/jarvis_tools/execute_shell.py +1 -1
- jarvis/jarvis_tools/file_operation.py +16 -14
- jarvis/jarvis_tools/git_commiter.py +2 -2
- jarvis/jarvis_tools/methodology.py +1 -1
- jarvis/jarvis_tools/rag.py +1 -1
- jarvis/jarvis_tools/read_code.py +19 -8
- jarvis/jarvis_tools/read_webpage.py +1 -1
- jarvis/jarvis_tools/registry.py +53 -6
- jarvis/jarvis_tools/search.py +1 -1
- jarvis/jarvis_tools/select_code_files.py +1 -1
- jarvis/{utils.py → jarvis_utils/__init__.py} +69 -53
- {jarvis_ai_assistant-0.1.115.dist-info → jarvis_ai_assistant-0.1.116.dist-info}/METADATA +1 -1
- jarvis_ai_assistant-0.1.116.dist-info/RECORD +64 -0
- {jarvis_ai_assistant-0.1.115.dist-info → jarvis_ai_assistant-0.1.116.dist-info}/WHEEL +1 -1
- {jarvis_ai_assistant-0.1.115.dist-info → jarvis_ai_assistant-0.1.116.dist-info}/entry_points.txt +1 -2
- jarvis/jarvis_dev/main.py +0 -664
- jarvis/multi_agent.py +0 -76
- jarvis/utils/date_utils.py +0 -19
- jarvis_ai_assistant-0.1.115.dist-info/RECORD +0 -64
- {jarvis_ai_assistant-0.1.115.dist-info → jarvis_ai_assistant-0.1.116.dist-info}/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.115.dist-info → jarvis_ai_assistant-0.1.116.dist-info}/top_level.txt +0 -0
jarvis/multi_agent.py
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
from typing import Dict, List, Optional
|
|
4
|
-
|
|
5
|
-
from jarvis.agent import Agent
|
|
6
|
-
from jarvis.utils import OutputType, PrettyOutput
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class AgentConfig:
|
|
10
|
-
def __init__(self, **config):
|
|
11
|
-
self.system_prompt = config.get('system_prompt', '')
|
|
12
|
-
self.name = config.get('name', 'Jarvis')
|
|
13
|
-
self.description = config.get('description', '')
|
|
14
|
-
self.is_sub_agent = config.get('is_sub_agent', False)
|
|
15
|
-
self.tool_registry = config.get('tool_registry', [])
|
|
16
|
-
self.platform = config.get('platform')
|
|
17
|
-
self.model_name = config.get('model_name')
|
|
18
|
-
self.summary_prompt = config.get('summary_prompt')
|
|
19
|
-
self.auto_complete = config.get('auto_complete', False)
|
|
20
|
-
self.output_handler_before_tool = config.get('output_handler_before_tool')
|
|
21
|
-
self.output_handler_after_tool = config.get('output_handler_after_tool')
|
|
22
|
-
self.input_handler = config.get('input_handler')
|
|
23
|
-
self.max_context_length = config.get('max_context_length')
|
|
24
|
-
self.execute_tool_confirm = config.get('execute_tool_confirm')
|
|
25
|
-
|
|
26
|
-
class MultiAgent:
|
|
27
|
-
def __init__(self, configs: List[AgentConfig], main_agent_name: str):
|
|
28
|
-
self.agents_config = configs
|
|
29
|
-
self.agents = {}
|
|
30
|
-
self.init_agents()
|
|
31
|
-
self.main_agent_name = main_agent_name
|
|
32
|
-
|
|
33
|
-
def init_agents(self):
|
|
34
|
-
for agent_config in self.agents_config:
|
|
35
|
-
agent = Agent(system_prompt=agent_config.system_prompt,
|
|
36
|
-
name=agent_config.name,
|
|
37
|
-
description=agent_config.description,
|
|
38
|
-
model_name=agent_config.model_name,
|
|
39
|
-
platform=agent_config.platform,
|
|
40
|
-
max_context_length=agent_config.max_context_length,
|
|
41
|
-
support_send_msg=True,
|
|
42
|
-
execute_tool_confirm=agent_config.execute_tool_confirm,
|
|
43
|
-
input_handler=agent_config.input_handler,
|
|
44
|
-
output_handler_before_tool=agent_config.output_handler_before_tool,
|
|
45
|
-
output_handler_after_tool=agent_config.output_handler_after_tool,
|
|
46
|
-
use_methodology=False,
|
|
47
|
-
record_methodology=False,
|
|
48
|
-
need_summary=False,
|
|
49
|
-
auto_complete=agent_config.auto_complete,
|
|
50
|
-
summary_prompt=agent_config.summary_prompt,
|
|
51
|
-
is_sub_agent=agent_config.is_sub_agent,
|
|
52
|
-
tool_registry=agent_config.tool_registry,
|
|
53
|
-
)
|
|
54
|
-
agent.system_prompt += "You can send message to following agents: " + "\n".join([f"{c.name}: {c.description}" for c in self.agents_config])
|
|
55
|
-
self.agents[agent_config.name] = agent
|
|
56
|
-
|
|
57
|
-
def run(self, user_input: str, file_list: Optional[List[str]] = None) -> str:
|
|
58
|
-
last_agent = self.main_agent_name
|
|
59
|
-
msg = self.agents[self.main_agent_name].run(user_input, file_list)
|
|
60
|
-
while msg:
|
|
61
|
-
if isinstance(msg, str):
|
|
62
|
-
return msg
|
|
63
|
-
elif isinstance(msg, Dict):
|
|
64
|
-
prompt = f"""
|
|
65
|
-
Please handle this message:
|
|
66
|
-
from: {last_agent}
|
|
67
|
-
content: {msg['content']}
|
|
68
|
-
"""
|
|
69
|
-
if msg['to'] not in self.agents:
|
|
70
|
-
PrettyOutput.print(f"没有找到{msg['to']},重试...", OutputType.WARNING)
|
|
71
|
-
msg = self.agents[last_agent].run(f"The agent {msg['to']} is not found, agent list: {self.agents.keys()}")
|
|
72
|
-
continue
|
|
73
|
-
PrettyOutput.print(f"{last_agent} 发送消息给 {msg['to']}...", OutputType.INFO)
|
|
74
|
-
last_agent = self.agents[msg['to']]
|
|
75
|
-
msg = self.agents[msg['to']].run(prompt)
|
|
76
|
-
return ""
|
jarvis/utils/date_utils.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
|
-
|
|
3
|
-
class DateValidator:
|
|
4
|
-
@staticmethod
|
|
5
|
-
def validate_iso_date(date_str: str) -> bool:
|
|
6
|
-
try:
|
|
7
|
-
datetime.fromisoformat(date_str)
|
|
8
|
-
return True
|
|
9
|
-
except ValueError:
|
|
10
|
-
return False
|
|
11
|
-
|
|
12
|
-
@staticmethod
|
|
13
|
-
def validate_date_range(start: str, end: str) -> bool:
|
|
14
|
-
try:
|
|
15
|
-
start_dt = datetime.fromisoformat(start)
|
|
16
|
-
end_dt = datetime.fromisoformat(end)
|
|
17
|
-
return start_dt <= end_dt
|
|
18
|
-
except ValueError:
|
|
19
|
-
return False
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
jarvis/__init__.py,sha256=_kxXN4-IKZFsVJbHvukjoGhLg-OpYcf0FOvqSr7gPzU,51
|
|
2
|
-
jarvis/agent.py,sha256=AEBsAtQTuhPa7KMwFiucTcItpqBtvKoe3n_5LSBmHwI,27060
|
|
3
|
-
jarvis/multi_agent.py,sha256=3cNX3jGyir_qJIsurIgkLiLXWt-L6yAoa_udhZrJ-dE,3731
|
|
4
|
-
jarvis/utils.py,sha256=QPjwlcbdSMpPL9uPB0Enq3ROAnxDl1b0XqCw7VD-jGc,29075
|
|
5
|
-
jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
jarvis/jarvis_code_agent/code_agent.py,sha256=598ym4LR4hshM9hSvxd1MetPV10HjhvCWeI5b1woNYc,7494
|
|
7
|
-
jarvis/jarvis_code_agent/file_select.py,sha256=KOIdJfroNc21GuPc-DAjmh4LvO0T8lESfaw6Wh_Jzss,8160
|
|
8
|
-
jarvis/jarvis_code_agent/patch.py,sha256=sG4DL7rBRY4SvkfNCTtLkg38MIUGAGt4OeGw60sZhKE,4861
|
|
9
|
-
jarvis/jarvis_code_agent/relevant_files.py,sha256=ljrnwbOnrM1GY8NielgpS3a7KeWFnK0UwbXzlQFcKFE,3323
|
|
10
|
-
jarvis/jarvis_codebase/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
jarvis/jarvis_codebase/main.py,sha256=hmb2Z0Q2fi-uY2fNDIfAgYddJ6ZDM0kRtEWeZ1fKeJ4,39322
|
|
12
|
-
jarvis/jarvis_dev/main.py,sha256=zjg-GVoOY8A09E0sFb88TMQuONMJme1IdyocCURIiys,19544
|
|
13
|
-
jarvis/jarvis_lsp/base.py,sha256=_7pdbMKjdtYBW0DsRbjIodDHM3J7df-YgXHejN_WIrU,4490
|
|
14
|
-
jarvis/jarvis_lsp/cpp.py,sha256=AZfcVPx7llZodhCJnuoxAi8tzSnhliJVTf1OU_GUIQk,4979
|
|
15
|
-
jarvis/jarvis_lsp/go.py,sha256=AArJrssA36gbxNrflzMfpDMN5YjXl1nVUo2uj1cBNJg,5304
|
|
16
|
-
jarvis/jarvis_lsp/python.py,sha256=_Vo2pPwVh_vAsyS0XowXMbT4Syd78naPEZj586bi004,4747
|
|
17
|
-
jarvis/jarvis_lsp/registry.py,sha256=iBsyXlISQYbAxXw-VWfZhoDocVxoer0rhg6mdYbl2Dc,9926
|
|
18
|
-
jarvis/jarvis_lsp/rust.py,sha256=TFXx84KGCkhdvFD9BEgdoz70dOP9ouKJa9ml3F9R2T4,5535
|
|
19
|
-
jarvis/jarvis_platform/__init__.py,sha256=mrOt67nselz_H1gX9wdAO4y2DY5WPXzABqJbr5Des8k,63
|
|
20
|
-
jarvis/jarvis_platform/ai8.py,sha256=yhr04sTEyjmKodUWMpoAugQ-z0lWxrev3apOGmZF56c,11945
|
|
21
|
-
jarvis/jarvis_platform/base.py,sha256=JsaLlOrrhm1W4fD2J5ZhdtPxbmbzdE2ZEKckv5Q0cQc,2155
|
|
22
|
-
jarvis/jarvis_platform/kimi.py,sha256=KPctPysshPNC-i1W0G3DwjXJD5CYoZjxuUNZytypt20,15747
|
|
23
|
-
jarvis/jarvis_platform/ollama.py,sha256=NF2INX3i7HffESUPI40yoUB9U3jupfI3EXgmD_B3fFo,5606
|
|
24
|
-
jarvis/jarvis_platform/openai.py,sha256=ZxZXCFpbcXKozthxo3NScYZZHGqhgYRckJLf_PHfnUE,4438
|
|
25
|
-
jarvis/jarvis_platform/oyi.py,sha256=bz7fzglefr2UfbDammtI-8rJSRY0ulldt-5TrL-JPrg,14987
|
|
26
|
-
jarvis/jarvis_platform/registry.py,sha256=VoY7FCp79AaE0-1t5CU0ezsq9naSoX9XF43ll_0Lfv8,8501
|
|
27
|
-
jarvis/jarvis_platform_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
-
jarvis/jarvis_platform_manager/main.py,sha256=lpuADK79mqn232bnZ2u9-pJq1ho-592RfRT5tR00lnA,4916
|
|
29
|
-
jarvis/jarvis_rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
jarvis/jarvis_rag/main.py,sha256=i_53CTY-fWzDDJZodNWwiBl3gpRsGGJE45SHZF28bMo,31312
|
|
31
|
-
jarvis/jarvis_smart_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
|
-
jarvis/jarvis_smart_shell/main.py,sha256=ZbY1E5tZsIVHK_9AZCiWoncTngb8WWxz-oQKQrPvZV8,3932
|
|
33
|
-
jarvis/jarvis_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
-
jarvis/jarvis_tools/ask_codebase.py,sha256=DJfu_wwmN08UeiiM4RNrLdyXe9yyZ_Jl2xIhqK78cjk,2996
|
|
35
|
-
jarvis/jarvis_tools/ask_user.py,sha256=Y5BNOgePikrTbARgjS_IjxMkRDDZ-tKcKSSYecaVi9Q,1820
|
|
36
|
-
jarvis/jarvis_tools/base.py,sha256=c0DMoDDPxmsqUYJR989zgUs7nIYRY6GWBrAdusIZKjc,656
|
|
37
|
-
jarvis/jarvis_tools/chdir.py,sha256=A53BNXFB9tvwoV_cxW_LpF_DfxANgAEJ8rjikTaTa-I,1813
|
|
38
|
-
jarvis/jarvis_tools/code_review.py,sha256=SY6Xw1VhAmmNVCJZsgd6ItDBmth4bgjnpd0T0afGVSA,8581
|
|
39
|
-
jarvis/jarvis_tools/create_code_agent.py,sha256=yWrQqSp2jaUq2iueqiaNFTh8lXQnFbJWE6ekJKgKmOw,3899
|
|
40
|
-
jarvis/jarvis_tools/create_sub_agent.py,sha256=Kq4PG3mKlr9fZKZwrR9HVA3YA4Io5-wblpXe3e8O7Po,2855
|
|
41
|
-
jarvis/jarvis_tools/execute_shell.py,sha256=W8K-LUfQiGvXfqfToajGc8YsZ2OUpQpbwbab8mKm-nA,2559
|
|
42
|
-
jarvis/jarvis_tools/file_operation.py,sha256=ODij6MNonkb3JuuWVxubnW-m2HQ--5KGzfgzrxRI_Vw,5385
|
|
43
|
-
jarvis/jarvis_tools/git_commiter.py,sha256=tWmV-vI1hCf2qkjfnF9BV2qRWt-k47cTku5mdnO0LSs,2727
|
|
44
|
-
jarvis/jarvis_tools/lsp_find_definition.py,sha256=xV8YeN1RJfwd2F3gE6OnDeTwl-AnCmrxueHocbXkQOc,4800
|
|
45
|
-
jarvis/jarvis_tools/lsp_find_references.py,sha256=FohlJeLfTxcMUASfbjOT93hQGtI2WeyTpMGwRwShW_I,4043
|
|
46
|
-
jarvis/jarvis_tools/lsp_get_diagnostics.py,sha256=bEvbDk8TnKg9TTFFxMrYOJm5TBDgz5gO04WJFQUwQQE,4490
|
|
47
|
-
jarvis/jarvis_tools/lsp_get_document_symbols.py,sha256=dspL6r9HYnXL5TpARSApFY3IQLm2kcYVNVWCff2xoXI,3080
|
|
48
|
-
jarvis/jarvis_tools/lsp_prepare_rename.py,sha256=RxUyIef4awtp-jgupcD1LcPlno9P3mOE8AS3_Fm71Ys,4832
|
|
49
|
-
jarvis/jarvis_tools/lsp_validate_edit.py,sha256=M0iglK2QbnIEFv0RYK6o2iAYnv259jB6EU7To-rc51E,5247
|
|
50
|
-
jarvis/jarvis_tools/methodology.py,sha256=5BhfcZuRFhr5vtegXCRL6YNFa7iiFqhft7nvBTnPFk4,5751
|
|
51
|
-
jarvis/jarvis_tools/rag.py,sha256=9QtRL51PqZvqy6tCxszpNbjDvEtEJknOL_A-5ZT65F0,4935
|
|
52
|
-
jarvis/jarvis_tools/read_code.py,sha256=dxtBQBhOaaJzU-nonchC08R3FpcClDJUXrHDY_b-dkQ,6045
|
|
53
|
-
jarvis/jarvis_tools/read_webpage.py,sha256=dgOjztOZRqvK_SpaUR7IJVOtfgZNJ8ZCOdd7aKb4ZL4,3056
|
|
54
|
-
jarvis/jarvis_tools/registry.py,sha256=Gu9dDGRBdRtpP-kOWeF6JKuwmihJpkeR3RPZ2P-k2HM,11498
|
|
55
|
-
jarvis/jarvis_tools/search.py,sha256=6IqVIUzliR23t3SlJrg4ZT1JaCHNk5zkJAOnu2VCMHE,11430
|
|
56
|
-
jarvis/jarvis_tools/select_code_files.py,sha256=kUnNyi8vpmo1gmQDYg7N6bIUSsrElLzKRbi-1OftckA,1882
|
|
57
|
-
jarvis/jarvis_tools/tool_generator.py,sha256=jdniHyKcEyF9KyouudrCoZBH3czZmQXc3ns0_trZ3yU,6332
|
|
58
|
-
jarvis/utils/date_utils.py,sha256=DZCQ91FBC4dnQRKCqNnACTg3HuqzQ7R1DRYqH59tON4,537
|
|
59
|
-
jarvis_ai_assistant-0.1.115.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
|
|
60
|
-
jarvis_ai_assistant-0.1.115.dist-info/METADATA,sha256=L1rPAXohbIG4ckja2MzmptZA5s2L7JEwdjg7yr6RpYE,13701
|
|
61
|
-
jarvis_ai_assistant-0.1.115.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
62
|
-
jarvis_ai_assistant-0.1.115.dist-info/entry_points.txt,sha256=FpzVanGik4QFekIGDi4T6eI7WZypFuGjZUPwhAbuIIo,521
|
|
63
|
-
jarvis_ai_assistant-0.1.115.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
|
|
64
|
-
jarvis_ai_assistant-0.1.115.dist-info/RECORD,,
|
|
File without changes
|
{jarvis_ai_assistant-0.1.115.dist-info → jarvis_ai_assistant-0.1.116.dist-info}/top_level.txt
RENAMED
|
File without changes
|