jarvis-ai-assistant 0.1.126__py3-none-any.whl → 0.1.128__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/jarvis_agent/__init__.py +105 -87
- jarvis/jarvis_code_agent/code_agent.py +21 -10
- jarvis/jarvis_code_agent/patch.py +139 -112
- jarvis/jarvis_codebase/main.py +240 -213
- jarvis/jarvis_dev/main.py +4 -3
- jarvis/jarvis_platform/base.py +6 -5
- jarvis/jarvis_platform_manager/main.py +1 -1
- jarvis/jarvis_rag/main.py +250 -186
- jarvis/jarvis_smart_shell/main.py +0 -1
- jarvis/jarvis_tools/ask_codebase.py +4 -3
- jarvis/jarvis_tools/chdir.py +22 -22
- jarvis/jarvis_tools/code_review.py +38 -33
- jarvis/jarvis_tools/execute_shell.py +0 -3
- jarvis/jarvis_tools/file_operation.py +56 -55
- jarvis/jarvis_tools/git_commiter.py +60 -50
- jarvis/jarvis_tools/read_webpage.py +50 -30
- jarvis/jarvis_tools/registry.py +40 -53
- jarvis/jarvis_tools/search_web.py +61 -36
- jarvis/jarvis_tools/tool_generator.py +35 -21
- jarvis/jarvis_utils/methodology.py +72 -54
- jarvis/jarvis_utils/output.py +1 -0
- {jarvis_ai_assistant-0.1.126.dist-info → jarvis_ai_assistant-0.1.128.dist-info}/METADATA +1 -1
- {jarvis_ai_assistant-0.1.126.dist-info → jarvis_ai_assistant-0.1.128.dist-info}/RECORD +28 -28
- {jarvis_ai_assistant-0.1.126.dist-info → jarvis_ai_assistant-0.1.128.dist-info}/LICENSE +0 -0
- {jarvis_ai_assistant-0.1.126.dist-info → jarvis_ai_assistant-0.1.128.dist-info}/WHEEL +0 -0
- {jarvis_ai_assistant-0.1.126.dist-info → jarvis_ai_assistant-0.1.128.dist-info}/entry_points.txt +0 -0
- {jarvis_ai_assistant-0.1.126.dist-info → jarvis_ai_assistant-0.1.128.dist-info}/top_level.txt +0 -0
jarvis/jarvis_tools/registry.py
CHANGED
|
@@ -5,6 +5,7 @@ import sys
|
|
|
5
5
|
from typing import Any, Callable, Dict, List, Optional, Tuple
|
|
6
6
|
|
|
7
7
|
import yaml
|
|
8
|
+
from yaspin import yaspin
|
|
8
9
|
|
|
9
10
|
from jarvis.jarvis_agent.output_handler import OutputHandler
|
|
10
11
|
from jarvis.jarvis_platform.registry import PlatformRegistry
|
|
@@ -335,17 +336,6 @@ arguments:
|
|
|
335
336
|
except json.JSONDecodeError:
|
|
336
337
|
PrettyOutput.print(f"工具参数格式无效: {name} {tool_call_help}", OutputType.ERROR)
|
|
337
338
|
return ""
|
|
338
|
-
|
|
339
|
-
# Display tool call information
|
|
340
|
-
PrettyOutput.section(f"执行工具: {name}", OutputType.TOOL)
|
|
341
|
-
params = "参数:\n"
|
|
342
|
-
if isinstance(args, dict):
|
|
343
|
-
for key, value in args.items():
|
|
344
|
-
params += f"{key} = {value}\n"
|
|
345
|
-
else:
|
|
346
|
-
params += f"{args}"
|
|
347
|
-
|
|
348
|
-
PrettyOutput.print(params, OutputType.INFO)
|
|
349
339
|
|
|
350
340
|
# Execute tool call
|
|
351
341
|
result = self.execute_tool(name, args)
|
|
@@ -362,50 +352,47 @@ arguments:
|
|
|
362
352
|
|
|
363
353
|
# Process the result
|
|
364
354
|
if result["success"]:
|
|
365
|
-
|
|
366
|
-
PrettyOutput.section("执行成功", OutputType.SUCCESS)
|
|
367
|
-
|
|
368
355
|
# If the output exceeds 4k characters, use a large model to summarize
|
|
369
356
|
if get_context_token_count(output) > self.max_token_count:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
357
|
+
with yaspin(text="正在总结输出...", color="yellow") as spinner:
|
|
358
|
+
try:
|
|
359
|
+
|
|
360
|
+
model = PlatformRegistry.get_global_platform_registry().get_normal_platform()
|
|
361
|
+
|
|
362
|
+
# If the output exceeds the maximum context length, only take the last part
|
|
363
|
+
max_count = self.max_token_count
|
|
364
|
+
if get_context_token_count(output) > max_count:
|
|
365
|
+
output_to_summarize = output[-max_count:]
|
|
366
|
+
truncation_notice = f"\n(注意:由于输出过长,仅总结最后 {max_count} 个字符)"
|
|
367
|
+
else:
|
|
368
|
+
output_to_summarize = output
|
|
369
|
+
truncation_notice = ""
|
|
370
|
+
|
|
371
|
+
prompt = f"""请总结以下工具的执行结果,提取关键信息和重要结果。注意:
|
|
372
|
+
1. 保留所有重要的数值、路径、错误信息等
|
|
373
|
+
2. 保持结果的准确性
|
|
374
|
+
3. 用简洁的语言描述主要内容
|
|
375
|
+
4. 如果有错误信息,确保包含在总结中
|
|
376
|
+
|
|
377
|
+
工具名称: {name}
|
|
378
|
+
执行结果:
|
|
379
|
+
{output_to_summarize}
|
|
380
|
+
|
|
381
|
+
请提供总结:"""
|
|
382
|
+
|
|
383
|
+
summary = model.chat_until_success(prompt)
|
|
384
|
+
output = f"""--- 原始输出过长,以下是总结 ---{truncation_notice}
|
|
385
|
+
|
|
386
|
+
{summary}
|
|
387
|
+
|
|
388
|
+
--- 总结结束 ---"""
|
|
389
|
+
spinner.text = "总结完成"
|
|
390
|
+
spinner.ok("✅")
|
|
391
|
+
except Exception as e:
|
|
392
|
+
spinner.text = "总结失败"
|
|
393
|
+
spinner.fail("❌")
|
|
394
|
+
PrettyOutput.print(f"总结失败: {str(e)}", OutputType.ERROR)
|
|
395
|
+
output = f"输出过长 ({len(output)} 字符),建议查看原始输出。\n前300字符预览:\n{output[:300]}..."
|
|
409
396
|
return output
|
|
410
397
|
|
|
411
398
|
except Exception as e:
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
from typing import Dict, Any, List
|
|
2
|
+
|
|
3
|
+
from regex import W
|
|
4
|
+
from yaspin import yaspin
|
|
2
5
|
from jarvis.jarvis_platform.registry import PlatformRegistry
|
|
3
6
|
from jarvis.jarvis_tools.read_webpage import WebpageTool
|
|
4
7
|
from playwright.sync_api import sync_playwright
|
|
@@ -12,52 +15,72 @@ def bing_search(query):
|
|
|
12
15
|
try:
|
|
13
16
|
with sync_playwright() as p:
|
|
14
17
|
# Set parameters when starting the browser
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
with yaspin(text="正在启动浏览器...", color="cyan") as spinner:
|
|
19
|
+
browser = p.chromium.launch(
|
|
20
|
+
headless=True, # Headless mode
|
|
21
|
+
args=['--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage']
|
|
22
|
+
)
|
|
23
|
+
spinner.text = "浏览器启动完成"
|
|
24
|
+
spinner.ok("✅")
|
|
19
25
|
|
|
20
26
|
# Create a new page and set timeout
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
with yaspin(text="正在创建新页面...", color="cyan") as spinner:
|
|
28
|
+
page = browser.new_page(
|
|
29
|
+
user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
|
|
30
|
+
viewport={'width': 1920, 'height': 1080}
|
|
31
|
+
)
|
|
32
|
+
spinner.text = "新页面创建完成"
|
|
33
|
+
spinner.ok("✅")
|
|
25
34
|
|
|
26
35
|
# Set page timeout
|
|
27
|
-
|
|
36
|
+
with yaspin(text="正在设置页面超时...", color="cyan") as spinner:
|
|
37
|
+
page.set_default_timeout(60000)
|
|
38
|
+
spinner.text = "页面超时设置完成"
|
|
39
|
+
spinner.ok("✅")
|
|
28
40
|
|
|
29
41
|
# Visit search page
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
with yaspin(text=f"正在搜索 {query}...", color="cyan") as spinner:
|
|
43
|
+
url = f"https://www.bing.com/search?q={quote(query)}&form=QBLH&sp=-1"
|
|
44
|
+
page.goto(url, wait_until="networkidle")
|
|
45
|
+
spinner.text = "搜索完成"
|
|
46
|
+
spinner.ok("✅")
|
|
32
47
|
|
|
33
48
|
# Wait for search results to load
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
with yaspin(text="正在等待搜索结果加载...", color="cyan") as spinner:
|
|
50
|
+
page.wait_for_selector("#b_results", state="visible", timeout=30000)
|
|
51
|
+
# Wait for a moment to ensure the results are fully loaded
|
|
52
|
+
page.wait_for_timeout(1000)
|
|
53
|
+
spinner.text = "搜索结果加载完成"
|
|
54
|
+
spinner.ok("✅")
|
|
38
55
|
|
|
39
56
|
# Extract search results
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
for (const el of elements) {
|
|
45
|
-
const titleEl = el.querySelector("h2");
|
|
46
|
-
const linkEl = titleEl ? titleEl.querySelector("a") : null;
|
|
47
|
-
const abstractEl = el.querySelector(".b_caption p");
|
|
57
|
+
with yaspin(text="正在提取搜索结果...", color="cyan") as spinner:
|
|
58
|
+
summaries = page.evaluate("""() => {
|
|
59
|
+
const results = [];
|
|
60
|
+
const elements = document.querySelectorAll("#b_results > .b_algo");
|
|
48
61
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
for (const el of elements) {
|
|
63
|
+
const titleEl = el.querySelector("h2");
|
|
64
|
+
const linkEl = titleEl ? titleEl.querySelector("a") : null;
|
|
65
|
+
const abstractEl = el.querySelector(".b_caption p");
|
|
66
|
+
|
|
67
|
+
if (linkEl) {
|
|
68
|
+
results.push({
|
|
69
|
+
title: titleEl.innerText.trim(),
|
|
70
|
+
href: linkEl.href,
|
|
71
|
+
abstract: abstractEl ? abstractEl.innerText.trim() : ""
|
|
72
|
+
});
|
|
73
|
+
}
|
|
55
74
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
75
|
+
return results;
|
|
76
|
+
}""")
|
|
77
|
+
spinner.text = "搜索结果提取完成"
|
|
78
|
+
spinner.ok("✅")
|
|
79
|
+
|
|
80
|
+
with yaspin(text="正在关闭浏览器...", color="cyan") as spinner:
|
|
81
|
+
browser.close()
|
|
82
|
+
spinner.text = "浏览器关闭完成"
|
|
83
|
+
spinner.ok("✅")
|
|
61
84
|
return summaries
|
|
62
85
|
|
|
63
86
|
except Exception as error:
|
|
@@ -235,8 +258,10 @@ Please synthesize a final answer that:
|
|
|
235
258
|
}
|
|
236
259
|
|
|
237
260
|
# Extract information
|
|
238
|
-
|
|
239
|
-
|
|
261
|
+
with yaspin(text="正在提取信息...", color="cyan") as spinner:
|
|
262
|
+
analysis = self._extract_info(contents, question)
|
|
263
|
+
spinner.text = "信息提取完成"
|
|
264
|
+
spinner.ok("✅")
|
|
240
265
|
|
|
241
266
|
return {
|
|
242
267
|
"success": True,
|
|
@@ -4,6 +4,8 @@ Tool Generator Tool - Automatically creates new tools using LLM
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
import re
|
|
6
6
|
from typing import Dict, Any
|
|
7
|
+
|
|
8
|
+
from yaspin import yaspin
|
|
7
9
|
from jarvis.jarvis_platform.registry import PlatformRegistry
|
|
8
10
|
|
|
9
11
|
class ToolGenerator:
|
|
@@ -39,33 +41,45 @@ class ToolGenerator:
|
|
|
39
41
|
input_spec = arguments["input_spec"]
|
|
40
42
|
|
|
41
43
|
# Generate tool implementation using LLM
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
with yaspin(text="正在生成工具...", color="cyan") as spinner:
|
|
45
|
+
prompt = self._create_prompt(tool_name, description, input_spec)
|
|
46
|
+
llm_response = model.chat_until_success(prompt)
|
|
47
|
+
spinner.text = "工具生成完成"
|
|
48
|
+
spinner.ok("✅")
|
|
44
49
|
|
|
45
50
|
# Extract implementation with more flexible parsing
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
with yaspin(text="正在提取工具实现...", color="cyan") as spinner:
|
|
52
|
+
implementation = self._extract_code(llm_response)
|
|
53
|
+
if not implementation:
|
|
54
|
+
return {
|
|
55
|
+
"success": False,
|
|
56
|
+
"stdout": "",
|
|
57
|
+
"stderr": "Could not extract valid Python code from LLM response"
|
|
58
|
+
}
|
|
59
|
+
spinner.text = "工具实现提取完成"
|
|
60
|
+
spinner.ok("✅")
|
|
53
61
|
|
|
54
62
|
# Validate return value format
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
with yaspin(text="正在验证工具返回值格式...", color="cyan") as spinner:
|
|
64
|
+
if not self._validate_return_value_format(implementation):
|
|
65
|
+
return {
|
|
66
|
+
"success": False,
|
|
67
|
+
"stdout": "",
|
|
68
|
+
"stderr": "Generated tool does not follow required return value format"
|
|
69
|
+
}
|
|
70
|
+
spinner.text = "工具返回值格式验证完成"
|
|
71
|
+
spinner.ok("✅")
|
|
61
72
|
|
|
62
73
|
# Save the new tool
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
with yaspin(text="正在保存工具...", color="cyan") as spinner:
|
|
75
|
+
tools_dir = Path.home() / ".jarvis" / "tools"
|
|
76
|
+
tools_dir.mkdir(parents=True, exist_ok=True)
|
|
77
|
+
tool_file = tools_dir / f"{tool_name}.py"
|
|
78
|
+
|
|
79
|
+
with open(tool_file, "w") as f:
|
|
80
|
+
f.write(implementation)
|
|
81
|
+
spinner.text = "工具保存完成"
|
|
82
|
+
spinner.ok("✅")
|
|
69
83
|
|
|
70
84
|
return {
|
|
71
85
|
"success": True,
|
|
@@ -54,6 +54,7 @@ def make_methodology_prompt(data: Dict[str, str]) -> str:
|
|
|
54
54
|
for key, value in data.items():
|
|
55
55
|
ret += f"问题: {key}\n方法论: {value}\n"
|
|
56
56
|
return ret
|
|
57
|
+
|
|
57
58
|
def load_methodology(user_input: str) -> str:
|
|
58
59
|
"""
|
|
59
60
|
Load methodology and build vector index for similarity search.
|
|
@@ -64,65 +65,82 @@ def load_methodology(user_input: str) -> str:
|
|
|
64
65
|
Returns:
|
|
65
66
|
str: Relevant methodology prompt or empty string if no methodology found
|
|
66
67
|
"""
|
|
67
|
-
|
|
68
|
+
from yaspin import yaspin
|
|
68
69
|
user_jarvis_methodology = os.path.expanduser("~/.jarvis/methodology")
|
|
69
70
|
if not os.path.exists(user_jarvis_methodology):
|
|
70
71
|
return ""
|
|
71
72
|
|
|
72
73
|
try:
|
|
73
|
-
with
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
ids: List[int] = []
|
|
81
|
-
# Get embedding model
|
|
82
|
-
embedding_model = load_embedding_model()
|
|
74
|
+
with yaspin(text="加载方法论文件...", color="yellow") as spinner:
|
|
75
|
+
with open(user_jarvis_methodology, "r", encoding="utf-8") as f:
|
|
76
|
+
data = yaml.safe_load(f)
|
|
77
|
+
if dont_use_local_model():
|
|
78
|
+
spinner.text = "加载方法论文件完成"
|
|
79
|
+
spinner.ok("✅")
|
|
80
|
+
return make_methodology_prompt(data)
|
|
83
81
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
methodology_index.add_with_ids(vectors_array, np.array(ids)) # type: ignore
|
|
102
|
-
query_embedding = _create_methodology_embedding(embedding_model, user_input)
|
|
103
|
-
k = min(3, len(methodology_data))
|
|
104
|
-
PrettyOutput.print(f"检索方法论...", OutputType.INFO)
|
|
105
|
-
distances, indices = methodology_index.search(
|
|
106
|
-
query_embedding.reshape(1, -1), k
|
|
107
|
-
) # type: ignore
|
|
108
|
-
relevant_methodologies = {}
|
|
109
|
-
output_lines = []
|
|
110
|
-
for dist, idx in zip(distances[0], indices[0]):
|
|
111
|
-
if idx >= 0:
|
|
112
|
-
similarity = 1.0 / (1.0 + float(dist))
|
|
113
|
-
methodology = methodology_data[idx]
|
|
114
|
-
output_lines.append(
|
|
115
|
-
f"Methodology '{methodology['key']}' similarity: {similarity:.3f}"
|
|
116
|
-
)
|
|
117
|
-
if similarity >= 0.5:
|
|
118
|
-
relevant_methodologies[methodology["key"]] = methodology["value"]
|
|
82
|
+
with yaspin(text="初始化数据结构...", color="yellow") as spinner:
|
|
83
|
+
methodology_data: List[Dict[str, str]] = []
|
|
84
|
+
vectors: List[np.ndarray] = []
|
|
85
|
+
ids: List[int] = []
|
|
86
|
+
spinner.text = "初始化数据结构完成"
|
|
87
|
+
spinner.ok("✅")
|
|
88
|
+
|
|
89
|
+
with yaspin(text="加载嵌入模型...", color="yellow") as spinner:
|
|
90
|
+
embedding_model = load_embedding_model()
|
|
91
|
+
spinner.text = "加载嵌入模型完成"
|
|
92
|
+
spinner.ok("✅")
|
|
93
|
+
|
|
94
|
+
with yaspin(text="创建测试嵌入...", color="yellow") as spinner:
|
|
95
|
+
test_embedding = _create_methodology_embedding(embedding_model, "test")
|
|
96
|
+
embedding_dimension = len(test_embedding)
|
|
97
|
+
spinner.text = "创建测试嵌入完成"
|
|
98
|
+
spinner.ok("✅")
|
|
119
99
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
100
|
+
with yaspin(text="处理方法论数据...", color="yellow") as spinner:
|
|
101
|
+
for i, (key, value) in enumerate(data.items()):
|
|
102
|
+
methodology_text = f"{key}\n{value}"
|
|
103
|
+
embedding = _create_methodology_embedding(embedding_model, methodology_text)
|
|
104
|
+
vectors.append(embedding)
|
|
105
|
+
ids.append(i)
|
|
106
|
+
methodology_data.append({"key": key, "value": value})
|
|
107
|
+
spinner.text = "处理方法论数据完成"
|
|
108
|
+
spinner.ok("✅")
|
|
109
|
+
|
|
110
|
+
if vectors:
|
|
111
|
+
with yaspin(text="构建索引...", color="yellow") as spinner:
|
|
112
|
+
vectors_array = np.vstack(vectors)
|
|
113
|
+
hnsw_index = faiss.IndexHNSWFlat(embedding_dimension, 16)
|
|
114
|
+
hnsw_index.hnsw.efConstruction = 40
|
|
115
|
+
hnsw_index.hnsw.efSearch = 16
|
|
116
|
+
methodology_index = faiss.IndexIDMap(hnsw_index)
|
|
117
|
+
methodology_index.add_with_ids(vectors_array, np.array(ids)) # type: ignore
|
|
118
|
+
spinner.text = "构建索引完成"
|
|
119
|
+
spinner.ok("✅")
|
|
120
|
+
|
|
121
|
+
with yaspin(text="执行搜索...", color="yellow") as spinner:
|
|
122
|
+
query_embedding = _create_methodology_embedding(embedding_model, user_input)
|
|
123
|
+
k = min(3, len(methodology_data))
|
|
124
|
+
distances, indices = methodology_index.search(
|
|
125
|
+
query_embedding.reshape(1, -1), k
|
|
126
|
+
) # type: ignore
|
|
127
|
+
spinner.text = "执行搜索完成"
|
|
128
|
+
spinner.ok("✅")
|
|
129
|
+
|
|
130
|
+
with yaspin(text="处理搜索结果...", color="yellow") as spinner:
|
|
131
|
+
relevant_methodologies = {}
|
|
132
|
+
for dist, idx in zip(distances[0], indices[0]):
|
|
133
|
+
if idx >= 0:
|
|
134
|
+
similarity = 1.0 / (1.0 + float(dist))
|
|
135
|
+
methodology = methodology_data[idx]
|
|
136
|
+
if similarity >= 0.5:
|
|
137
|
+
relevant_methodologies[methodology["key"]] = methodology["value"]
|
|
138
|
+
spinner.text = "处理搜索结果完成"
|
|
139
|
+
spinner.ok("✅")
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
if relevant_methodologies:
|
|
143
|
+
return make_methodology_prompt(relevant_methodologies)
|
|
144
|
+
return make_methodology_prompt(data)
|
|
126
145
|
except Exception as e:
|
|
127
|
-
|
|
128
|
-
return ""
|
|
146
|
+
return ""
|
jarvis/jarvis_utils/output.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
jarvis/__init__.py,sha256=
|
|
2
|
-
jarvis/jarvis_agent/__init__.py,sha256=
|
|
1
|
+
jarvis/__init__.py,sha256=L8k8m9rzO09xkbiWM9WsgDo2WhYnz77jf-96COi8UyQ,51
|
|
2
|
+
jarvis/jarvis_agent/__init__.py,sha256=oyWOOGP8vYEG9ycRWRVNOL_Zfya9fC5Yvs6kk15rdD4,22942
|
|
3
3
|
jarvis/jarvis_agent/output_handler.py,sha256=kJeFTjjSu0K_2p0wyhq2veSZuhRXoaFC_8wVaoBKX0w,401
|
|
4
4
|
jarvis/jarvis_code_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
jarvis/jarvis_code_agent/code_agent.py,sha256=
|
|
5
|
+
jarvis/jarvis_code_agent/code_agent.py,sha256=IiIunonLsrHIunH96-1Q-B0WMXErVoi-aMzMglO8bF0,11026
|
|
6
6
|
jarvis/jarvis_code_agent/file_select.py,sha256=2nSy1FW-kK-wvtz0YbbgSbd4ZwXMlA7sBP0nC80FzLI,8160
|
|
7
|
-
jarvis/jarvis_code_agent/patch.py,sha256=
|
|
7
|
+
jarvis/jarvis_code_agent/patch.py,sha256=prYc3DkIOJMn-qkv4plusCiyZog7cN9W7E9o8Rgersw,10998
|
|
8
8
|
jarvis/jarvis_code_agent/shell_input_handler.py,sha256=UqR8oPVTmsPc1RAaOET4jPgbTGpz1otLkxhcIqT0r1c,790
|
|
9
9
|
jarvis/jarvis_codebase/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
jarvis/jarvis_codebase/main.py,sha256=
|
|
11
|
-
jarvis/jarvis_dev/main.py,sha256=
|
|
10
|
+
jarvis/jarvis_codebase/main.py,sha256=KSNf2RoPDn_jnfjUA5Sry7sh7iJ9Q267Z8k4dsQANRM,41325
|
|
11
|
+
jarvis/jarvis_dev/main.py,sha256=tDdv28nbcYlsy9wz1RbMNEModOdicNg4JfnBOYl4JnU,21414
|
|
12
12
|
jarvis/jarvis_git_squash/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
jarvis/jarvis_git_squash/main.py,sha256=g4csaRDYH3n3MCHc8aZb2N4wWVCVZ-pIgd0oanXDnD8,2798
|
|
14
14
|
jarvis/jarvis_lsp/base.py,sha256=ceJBQoOU7JHsvQEAA3agUTedh7_ki_HgK0re7-V9rqg,4119
|
|
@@ -20,31 +20,31 @@ jarvis/jarvis_lsp/rust.py,sha256=nV1EKtq5y57E47DbQlD2DsfvwFVE2JoUTs-9paxeyDo,516
|
|
|
20
20
|
jarvis/jarvis_multi_agent/__init__.py,sha256=aTLtKa4vbjT-eZzF1eab79vmghyA48wi6m9WVRltCw4,5991
|
|
21
21
|
jarvis/jarvis_platform/__init__.py,sha256=mrOt67nselz_H1gX9wdAO4y2DY5WPXzABqJbr5Des8k,63
|
|
22
22
|
jarvis/jarvis_platform/ai8.py,sha256=xjgoiF7QHx_5FHj-npTFVvZFYg8RBzkqTGAOQ-MJiL0,11972
|
|
23
|
-
jarvis/jarvis_platform/base.py,sha256=
|
|
23
|
+
jarvis/jarvis_platform/base.py,sha256=2chHt0pMx4rr0OFTeDpZcVqFUxF_q4YslUt30E5Augk,3277
|
|
24
24
|
jarvis/jarvis_platform/kimi.py,sha256=Qwb81flbKPvj-qZyJAMS_u0lQatRFQztYxUGDbj1keM,15713
|
|
25
25
|
jarvis/jarvis_platform/ollama.py,sha256=NHQMJSpC91WtSFuHKJuwD8qO-z4yDTF9mZX6BzWTKRU,5658
|
|
26
26
|
jarvis/jarvis_platform/openai.py,sha256=GSxTB69WitXJS3pL0sxCoB2F0EVHmvhrwLBC_JT8s34,4470
|
|
27
27
|
jarvis/jarvis_platform/oyi.py,sha256=pa72TtBYlhs3KPpqO4Y78a1Jvx4mN0pojBklu8X3F-k,15024
|
|
28
28
|
jarvis/jarvis_platform/registry.py,sha256=DrL6ZoIX9ZKAvFgDadiWPpVnO9GdWJMcXM8dsoNR3ds,8559
|
|
29
29
|
jarvis/jarvis_platform_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
jarvis/jarvis_platform_manager/main.py,sha256=
|
|
30
|
+
jarvis/jarvis_platform_manager/main.py,sha256=84j3voQDOVhvCqWxf-SGpdrYQPcf0pA5qUKe7b5oPUE,20898
|
|
31
31
|
jarvis/jarvis_platform_manager/openai_test.py,sha256=bkcVG6o2nNazj4zjkENgA4yOEzdTI9Qbm5dco-2MGYM,5190
|
|
32
32
|
jarvis/jarvis_rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
-
jarvis/jarvis_rag/main.py,sha256=
|
|
33
|
+
jarvis/jarvis_rag/main.py,sha256=yEvzQQZ4YQoOovQvH9MqQDbdnFw11bC_fyrNFo3QRq8,35873
|
|
34
34
|
jarvis/jarvis_smart_shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
-
jarvis/jarvis_smart_shell/main.py,sha256=
|
|
35
|
+
jarvis/jarvis_smart_shell/main.py,sha256=5gyBKgxuaTrDToE7Xy4DhsJPDOEviPi7ktm1vOZoIno,4618
|
|
36
36
|
jarvis/jarvis_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
-
jarvis/jarvis_tools/ask_codebase.py,sha256=
|
|
37
|
+
jarvis/jarvis_tools/ask_codebase.py,sha256=DyqOsVgVPefhGKC5L2bQqKj8KMFZE-PDgfdoHQ9ajH4,3300
|
|
38
38
|
jarvis/jarvis_tools/ask_user.py,sha256=kU6BOhFz_mKfqABd0l_00TL7Mqp_dhV3r0qkKLy8yRM,1745
|
|
39
39
|
jarvis/jarvis_tools/base.py,sha256=8gIgIx9LJAKOxdpPu7zMDItWqwXmXVTWAGfUkpQonzw,1196
|
|
40
|
-
jarvis/jarvis_tools/chdir.py,sha256=
|
|
41
|
-
jarvis/jarvis_tools/code_review.py,sha256=
|
|
40
|
+
jarvis/jarvis_tools/chdir.py,sha256=GLbH2fOKESUn3XYhNg0uOI5axTO2csC0B9HUL0bMZ5U,2790
|
|
41
|
+
jarvis/jarvis_tools/code_review.py,sha256=4TMsTehbIq3W-K-LvHjMwbaGtt66sbSM6nij30YsxlU,10039
|
|
42
42
|
jarvis/jarvis_tools/create_code_agent.py,sha256=lVnTP1Kq4q8aWOJ97YTf8POds-Hb3qeYS6MNOiM0wF4,3768
|
|
43
43
|
jarvis/jarvis_tools/create_sub_agent.py,sha256=lPiTXU0F8RZ-mEBB0ec9fdZ1UUtrpUQ2WoV8g-M5lHg,2774
|
|
44
|
-
jarvis/jarvis_tools/execute_shell.py,sha256=
|
|
44
|
+
jarvis/jarvis_tools/execute_shell.py,sha256=5LWWae8LKX4Qe3DIkSiLpcEvkCcF1ruvY0gbAIrT1Nw,3914
|
|
45
45
|
jarvis/jarvis_tools/execute_shell_script.py,sha256=JLs_4p3rXS_d0PdfS6lP_4ojFlD0SayAe0PNEGVfyzE,2030
|
|
46
|
-
jarvis/jarvis_tools/file_operation.py,sha256=
|
|
47
|
-
jarvis/jarvis_tools/git_commiter.py,sha256=
|
|
46
|
+
jarvis/jarvis_tools/file_operation.py,sha256=3dcbugrzSaXHV7m98k1E_CpEIK2v4DYqZNZQim-fuxM,6973
|
|
47
|
+
jarvis/jarvis_tools/git_commiter.py,sha256=mjGturix6uP6HmqzqX8APJuofaLWGQ4-D6DOk8jj7WI,5533
|
|
48
48
|
jarvis/jarvis_tools/lsp_find_definition.py,sha256=LqAOf6W4_WZR2GmtQXb7pMSduJzK_g3ysaOrgxu8CDE,4755
|
|
49
49
|
jarvis/jarvis_tools/lsp_find_references.py,sha256=IR1QcRi-p4zHS0YENb7vDNMUSuGQUTA4W9bPa9-VO-Y,4028
|
|
50
50
|
jarvis/jarvis_tools/lsp_get_diagnostics.py,sha256=_u2lsSFY7GkOlyKD2CFnvEpkZzAjNfEUMsM9dKGQz40,4754
|
|
@@ -52,23 +52,23 @@ jarvis/jarvis_tools/lsp_get_document_symbols.py,sha256=c7_9jP1toe_kepaTmZf1R1jn-
|
|
|
52
52
|
jarvis/jarvis_tools/lsp_prepare_rename.py,sha256=HIeJjup8luIH25XuLqTVdejWDT5vOn-IWSo-TKDFjZ4,4821
|
|
53
53
|
jarvis/jarvis_tools/methodology.py,sha256=jLYFji3hP7Gff7WFRuR-_VmPHI8Rqq0EGDIgackhqtc,5787
|
|
54
54
|
jarvis/jarvis_tools/rag.py,sha256=WuTlyGV5rgZTRxts9eJPC3QABrsoNYKratdO8UzUFDw,5132
|
|
55
|
-
jarvis/jarvis_tools/read_webpage.py,sha256=
|
|
56
|
-
jarvis/jarvis_tools/registry.py,sha256=
|
|
57
|
-
jarvis/jarvis_tools/search_web.py,sha256=
|
|
55
|
+
jarvis/jarvis_tools/read_webpage.py,sha256=TkVNgirvcjns8-MHaDXOmliOKWCYcq3WzcbVXBi0IxY,4173
|
|
56
|
+
jarvis/jarvis_tools/registry.py,sha256=q5-U_Pt7ACKG1jVFq14VU2fPEbJcBkWWrRrX1-5rR8s,14005
|
|
57
|
+
jarvis/jarvis_tools/search_web.py,sha256=yzu2EP63It2but0LFUR0x1hlCkyTyr1AwY4APvxmniE,12903
|
|
58
58
|
jarvis/jarvis_tools/select_code_files.py,sha256=xCqHTjIGju9Pb1Yh2C1Y7l6uT_3pfVB6ARU0VQmeRNI,1879
|
|
59
|
-
jarvis/jarvis_tools/tool_generator.py,sha256=
|
|
59
|
+
jarvis/jarvis_tools/tool_generator.py,sha256=LlNFIc-qWjDQULR2Vw95qf-KbuO8FtRNINcGjr4q7pQ,6992
|
|
60
60
|
jarvis/jarvis_utils/__init__.py,sha256=YQ4ZUGGIrjQj2nrYAHJxmCPbakcH5g01RWf1zmhBE4Y,953
|
|
61
61
|
jarvis/jarvis_utils/config.py,sha256=KxjJhqOuBYwK28gHAKyJ3joEascwsl9SIFJxO14c2Dg,4472
|
|
62
62
|
jarvis/jarvis_utils/embedding.py,sha256=sZofBOwLCsa4MLv4jSpTZ0bI05FZoYQpWrZXKwIsqM8,6200
|
|
63
63
|
jarvis/jarvis_utils/git_utils.py,sha256=1w3Tgas5JTfB5IM4aGioMJIL9dSpDt9PTSi_2w78oT4,4565
|
|
64
64
|
jarvis/jarvis_utils/globals.py,sha256=tVR3Z1h1scfSGgyYpVvUXILVjCBiG97fZuy4Ac6DLOY,2348
|
|
65
65
|
jarvis/jarvis_utils/input.py,sha256=U6SRkdiZvkpSA2vfw0EocayQvyjUOjtkSI05dsqZuIE,5985
|
|
66
|
-
jarvis/jarvis_utils/methodology.py,sha256=
|
|
67
|
-
jarvis/jarvis_utils/output.py,sha256
|
|
66
|
+
jarvis/jarvis_utils/methodology.py,sha256=qr7SHLusqc5BkDy6TcOj4rMKT2je_8DFTimXp11DXag,6418
|
|
67
|
+
jarvis/jarvis_utils/output.py,sha256=-7sRJjAJRSrbVeMO9HEDgKVvHNWxD56RLsbA8Xnf-Xk,8566
|
|
68
68
|
jarvis/jarvis_utils/utils.py,sha256=NZwbJWVC4cd30DEoVvfV4bcau2cU9k9ID07rpEvxZ-I,5578
|
|
69
|
-
jarvis_ai_assistant-0.1.
|
|
70
|
-
jarvis_ai_assistant-0.1.
|
|
71
|
-
jarvis_ai_assistant-0.1.
|
|
72
|
-
jarvis_ai_assistant-0.1.
|
|
73
|
-
jarvis_ai_assistant-0.1.
|
|
74
|
-
jarvis_ai_assistant-0.1.
|
|
69
|
+
jarvis_ai_assistant-0.1.128.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
|
|
70
|
+
jarvis_ai_assistant-0.1.128.dist-info/METADATA,sha256=soyyoOLcJqo7VOOgb-CSdKA1btnwx2ojiokmPUYdvNk,10519
|
|
71
|
+
jarvis_ai_assistant-0.1.128.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
72
|
+
jarvis_ai_assistant-0.1.128.dist-info/entry_points.txt,sha256=1oZg_a7zwEjnsFkOTkcGWcYfhA2-1-XTcqS1VS6sXgQ,674
|
|
73
|
+
jarvis_ai_assistant-0.1.128.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
|
|
74
|
+
jarvis_ai_assistant-0.1.128.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{jarvis_ai_assistant-0.1.126.dist-info → jarvis_ai_assistant-0.1.128.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{jarvis_ai_assistant-0.1.126.dist-info → jarvis_ai_assistant-0.1.128.dist-info}/top_level.txt
RENAMED
|
File without changes
|