adam-community 1.0.8__tar.gz → 1.0.10__tar.gz
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.
- {adam_community-1.0.8 → adam_community-1.0.10}/PKG-INFO +1 -1
- adam_community-1.0.10/adam_community/__version__.py +1 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/build.py +12 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/util.py +27 -12
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community.egg-info/PKG-INFO +1 -1
- adam_community-1.0.8/adam_community/__version__.py +0 -1
- {adam_community-1.0.8 → adam_community-1.0.10}/README.md +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/__init__.py +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/__init__.py +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/cli.py +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/init.py +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/parser.py +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/Makefile.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/README_kit.md.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/README_toolbox.md.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/__init__.py +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/configure.json.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/initial_assistant_message.md.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/initial_system_prompt.md.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/input.json.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/kit_python.py.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/long_description.md.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/toolbox_python.py.j2 +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/updater.py +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community/tool.py +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community.egg-info/SOURCES.txt +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community.egg-info/dependency_links.txt +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community.egg-info/entry_points.txt +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community.egg-info/requires.txt +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/adam_community.egg-info/top_level.txt +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/setup.cfg +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/setup.py +0 -0
- {adam_community-1.0.8 → adam_community-1.0.10}/test/test_util_tool.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.10"
|
|
@@ -221,6 +221,16 @@ def create_zip_package(directory: Path) -> str:
|
|
|
221
221
|
file_count += 1
|
|
222
222
|
demos_files += 1
|
|
223
223
|
|
|
224
|
+
# 检测并添加图标文件
|
|
225
|
+
icon_files = []
|
|
226
|
+
icon_extensions = ['.svg', '.png', '.jpg', '.jpeg']
|
|
227
|
+
for ext in icon_extensions:
|
|
228
|
+
icon_file = directory / "config" / f"icon{ext}"
|
|
229
|
+
if icon_file.exists():
|
|
230
|
+
zipf.write(icon_file, f"config/icon{ext}")
|
|
231
|
+
file_count += 1
|
|
232
|
+
icon_files.append(f"icon{ext}")
|
|
233
|
+
|
|
224
234
|
# 根据类型添加不同的文件
|
|
225
235
|
if config_type == "kit":
|
|
226
236
|
other_files = ["long_description.md", "input.json"]
|
|
@@ -237,6 +247,8 @@ def create_zip_package(directory: Path) -> str:
|
|
|
237
247
|
console.print(f" ✓ 配置文件: 1 个")
|
|
238
248
|
if demos_files > 0:
|
|
239
249
|
console.print(f" ✓ 演示文件: {demos_files} 个")
|
|
250
|
+
if icon_files:
|
|
251
|
+
console.print(f" ✓ 图标文件: {len(icon_files)} 个 ({', '.join(icon_files)})")
|
|
240
252
|
console.print(f" ✓ 总计: {file_count} 个文件")
|
|
241
253
|
|
|
242
254
|
return zip_name
|
|
@@ -19,8 +19,31 @@ ADAM_TASK_ID = os.getenv('ADAM_TASK_ID')
|
|
|
19
19
|
ADAM_USER_ID = os.getenv('ADAM_USER_ID')
|
|
20
20
|
CONDA_ENV = os.getenv('CONDA_ENV')
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
|
|
23
|
+
def _build_akb_query_command(query: str, collection: str) -> str:
|
|
24
|
+
"""
|
|
25
|
+
构建 akb 查询命令,包含目录存在性检查
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
query: 查询字符串
|
|
29
|
+
collection: 知识库名称
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
完整的 bash 命令字符串
|
|
33
|
+
"""
|
|
34
|
+
collection_dir = f"/share/programs/akb/database/{collection}"
|
|
35
|
+
|
|
36
|
+
return f"""if [ ! -d "{collection_dir}" ]; then
|
|
37
|
+
echo "知识库目录不存在: {collection_dir}"
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
akb simple-query \\
|
|
41
|
+
-i {collection_dir}/{collection}.index \\
|
|
42
|
+
-m /share/programs/BAAI/bge-m3 \\
|
|
43
|
+
-p {collection_dir}/{collection}.parquet \\
|
|
44
|
+
-l 5 \\
|
|
45
|
+
-f json -q "{query}\""""
|
|
46
|
+
|
|
24
47
|
|
|
25
48
|
class RAG:
|
|
26
49
|
"""
|
|
@@ -31,17 +54,9 @@ class RAG:
|
|
|
31
54
|
"""
|
|
32
55
|
|
|
33
56
|
def call(self, query: str, collection: str):
|
|
34
|
-
|
|
35
|
-
if collection not in collections:
|
|
36
|
-
raise ValueError(f"知识库名称必须是下面之一:{collections}")
|
|
37
|
-
|
|
38
|
-
cmd = f"""akb simple-query \
|
|
39
|
-
-i /share/programs/akb/database/{collection}/{collection}.index \
|
|
40
|
-
-m /share/programs/BAAI/bge-m3 \
|
|
41
|
-
-p /share/programs/akb/database/{collection}/{collection}.parquet \
|
|
42
|
-
-l 5 \
|
|
43
|
-
-f json -q \"{query}\""""
|
|
57
|
+
cmd = _build_akb_query_command(query, collection)
|
|
44
58
|
logger.info(f"搜索知识库 {collection}: {query}")
|
|
59
|
+
|
|
45
60
|
try:
|
|
46
61
|
result = run(cmd, shell='/bin/bash', check=True, text=True, capture_output=True)
|
|
47
62
|
except CalledProcessError as e:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.0.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/README_kit.md.j2
RENAMED
|
File without changes
|
{adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/README_toolbox.md.j2
RENAMED
|
File without changes
|
|
File without changes
|
{adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/configure.json.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/kit_python.py.j2
RENAMED
|
File without changes
|
{adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/long_description.md.j2
RENAMED
|
File without changes
|
{adam_community-1.0.8 → adam_community-1.0.10}/adam_community/cli/templates/toolbox_python.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|