adam-community 1.0.6__tar.gz → 1.0.7__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.
Files changed (33) hide show
  1. {adam_community-1.0.6 → adam_community-1.0.7}/PKG-INFO +1 -1
  2. adam_community-1.0.7/adam_community/__version__.py +1 -0
  3. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/parser.py +29 -0
  4. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community.egg-info/PKG-INFO +1 -1
  5. adam_community-1.0.6/adam_community/__version__.py +0 -1
  6. {adam_community-1.0.6 → adam_community-1.0.7}/README.md +0 -0
  7. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/__init__.py +0 -0
  8. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/__init__.py +0 -0
  9. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/build.py +0 -0
  10. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/cli.py +0 -0
  11. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/init.py +0 -0
  12. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/Makefile.j2 +0 -0
  13. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/README_kit.md.j2 +0 -0
  14. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/README_toolbox.md.j2 +0 -0
  15. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/__init__.py +0 -0
  16. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/configure.json.j2 +0 -0
  17. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/initial_assistant_message.md.j2 +0 -0
  18. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/initial_system_prompt.md.j2 +0 -0
  19. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/input.json.j2 +0 -0
  20. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/kit_python.py.j2 +0 -0
  21. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/long_description.md.j2 +0 -0
  22. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/templates/toolbox_python.py.j2 +0 -0
  23. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/cli/updater.py +0 -0
  24. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/tool.py +0 -0
  25. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community/util.py +0 -0
  26. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community.egg-info/SOURCES.txt +0 -0
  27. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community.egg-info/dependency_links.txt +0 -0
  28. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community.egg-info/entry_points.txt +0 -0
  29. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community.egg-info/requires.txt +0 -0
  30. {adam_community-1.0.6 → adam_community-1.0.7}/adam_community.egg-info/top_level.txt +0 -0
  31. {adam_community-1.0.6 → adam_community-1.0.7}/setup.cfg +0 -0
  32. {adam_community-1.0.6 → adam_community-1.0.7}/setup.py +0 -0
  33. {adam_community-1.0.6 → adam_community-1.0.7}/test/test_util_tool.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: adam_community
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: Adam Community Tools and Utilities
5
5
  Home-page: https://github.com/yourusername/adam-community
6
6
  Author: Adam Community
@@ -0,0 +1 @@
1
+ __version__ = "1.0.7"
@@ -263,6 +263,31 @@ def validate_description_length(description: str, function_name: str, file_path:
263
263
  f"超过了1024字符限制。请缩短描述长度。"
264
264
  )
265
265
 
266
+ def _inherits_from_tool(class_node: ast.ClassDef) -> bool:
267
+ """检查类是否继承了 adam_community.Tool
268
+
269
+ Args:
270
+ class_node: AST 类定义节点
271
+
272
+ Returns:
273
+ bool: 如果类继承了 adam_community.Tool 则返回 True,否则返回 False
274
+ """
275
+ for base in class_node.bases:
276
+ if isinstance(base, ast.Name):
277
+ # 直接继承 Tool 类
278
+ if base.id == 'Tool':
279
+ return True
280
+ elif isinstance(base, ast.Attribute):
281
+ # 继承 adam_community.Tool 或类似的形式
282
+ if (isinstance(base.value, ast.Name) and
283
+ base.value.id == 'adam_community' and
284
+ base.attr == 'Tool'):
285
+ return True
286
+ # 继承 Tool 类(可能是通过 from adam_community import Tool 导入的)
287
+ if base.attr == 'Tool':
288
+ return True
289
+ return False
290
+
266
291
  def parse_python_file(file_path: Path) -> List[Dict[str, Any]]:
267
292
  """解析单个 Python 文件,提取类信息
268
293
 
@@ -281,6 +306,10 @@ def parse_python_file(file_path: Path) -> List[Dict[str, Any]]:
281
306
 
282
307
  for node in ast.walk(tree):
283
308
  if isinstance(node, ast.ClassDef):
309
+ # 检查类是否继承了 adam_community.Tool
310
+ if not _inherits_from_tool(node):
311
+ continue
312
+
284
313
  # 获取类的文档字符串
285
314
  docstring = ast.get_docstring(node) or ""
286
315
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: adam_community
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: Adam Community Tools and Utilities
5
5
  Home-page: https://github.com/yourusername/adam-community
6
6
  Author: Adam Community
@@ -1 +0,0 @@
1
- __version__ = "1.0.6"
File without changes
File without changes
File without changes