adam-community 1.0.10__tar.gz → 1.0.11__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.10 → adam_community-1.0.11}/PKG-INFO +1 -1
- adam_community-1.0.11/adam_community/__version__.py +1 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/parser.py +11 -4
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community.egg-info/PKG-INFO +1 -1
- adam_community-1.0.10/adam_community/__version__.py +0 -1
- {adam_community-1.0.10 → adam_community-1.0.11}/README.md +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/__init__.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/__init__.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/build.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/cli.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/init.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/Makefile.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/README_kit.md.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/README_toolbox.md.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/__init__.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/configure.json.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/initial_assistant_message.md.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/initial_system_prompt.md.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/input.json.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/kit_python.py.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/long_description.md.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/toolbox_python.py.j2 +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/updater.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/tool.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community/util.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community.egg-info/SOURCES.txt +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community.egg-info/dependency_links.txt +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community.egg-info/entry_points.txt +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community.egg-info/requires.txt +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/adam_community.egg-info/top_level.txt +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/setup.cfg +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/setup.py +0 -0
- {adam_community-1.0.10 → adam_community-1.0.11}/test/test_util_tool.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.11"
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import ast
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
from typing import List, Dict, Any
|
|
4
|
-
from docstring_parser import parse as dsp
|
|
5
|
-
import jsonschema
|
|
6
4
|
|
|
7
5
|
def convert_python_type_to_json_schema(python_type: str) -> Dict[str, Any]:
|
|
8
6
|
"""将 Python 类型转换为 JSON Schema 类型
|
|
@@ -196,6 +194,8 @@ def validate_json_schema(schema: Dict[str, Any], context: str = "") -> None:
|
|
|
196
194
|
ValueError: 当 schema 不符合规范时抛出异常
|
|
197
195
|
"""
|
|
198
196
|
try:
|
|
197
|
+
# 延迟导入 jsonschema 避免模块级别的依赖问题
|
|
198
|
+
import jsonschema
|
|
199
199
|
# 使用 JSON Schema Draft 7 验证器
|
|
200
200
|
jsonschema.Draft7Validator.check_schema(schema)
|
|
201
201
|
|
|
@@ -217,8 +217,12 @@ def validate_json_schema(schema: Dict[str, Any], context: str = "") -> None:
|
|
|
217
217
|
if "items" in schema:
|
|
218
218
|
validate_json_schema(schema["items"], f"{context}.items" if context else "items")
|
|
219
219
|
|
|
220
|
-
except
|
|
221
|
-
|
|
220
|
+
except Exception as e:
|
|
221
|
+
# 检查是否是 jsonschema.SchemaError
|
|
222
|
+
if e.__class__.__name__ == 'SchemaError':
|
|
223
|
+
raise ValueError(f"Invalid JSON Schema{f' in {context}' if context else ''}: {str(e)}")
|
|
224
|
+
else:
|
|
225
|
+
raise e
|
|
222
226
|
|
|
223
227
|
def convert_union_types(types: List[str]) -> Dict[str, Any]:
|
|
224
228
|
"""转换联合类型为 JSON Schema
|
|
@@ -359,6 +363,9 @@ def parse_python_file(file_path: Path) -> List[Dict[str, Any]]:
|
|
|
359
363
|
"required": []
|
|
360
364
|
}
|
|
361
365
|
|
|
366
|
+
# 延迟导入 docstring_parser 避免模块级别的依赖问题
|
|
367
|
+
from docstring_parser import parse as dsp
|
|
368
|
+
|
|
362
369
|
# 使用 docstring_parser 解析类的文档字符串
|
|
363
370
|
docs = dsp(docstring)
|
|
364
371
|
if docs:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.0.10"
|
|
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.10 → adam_community-1.0.11}/adam_community/cli/templates/README_kit.md.j2
RENAMED
|
File without changes
|
{adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/README_toolbox.md.j2
RENAMED
|
File without changes
|
|
File without changes
|
{adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/configure.json.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/kit_python.py.j2
RENAMED
|
File without changes
|
{adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/long_description.md.j2
RENAMED
|
File without changes
|
{adam_community-1.0.10 → adam_community-1.0.11}/adam_community/cli/templates/toolbox_python.py.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{adam_community-1.0.10 → adam_community-1.0.11}/adam_community.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|