rootengine-core 0.5.0__tar.gz → 0.5.1__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.
- {rootengine_core-0.5.0/rootengine_core.egg-info → rootengine_core-0.5.1}/PKG-INFO +1 -1
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/pyproject.toml +2 -2
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/__init__.py +1 -1
- rootengine_core-0.5.1/rootengine_core/conversation/__init__.py +1 -0
- rootengine_core-0.5.0/rootengine_core/conversation/no_tool_conversation.py → rootengine_core-0.5.1/rootengine_core/conversation/base_conversation.py +7 -7
- {rootengine_core-0.5.0/rootengine_core/schema_runtime → rootengine_core-0.5.1/rootengine_core/schema/runtime}/reif_schema.py +2 -2
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/tool/adapter.py +1 -1
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/tool/tool.py +1 -1
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/utils/generate_json_dict.py +3 -3
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/utils/reif_func.py +1 -1
- {rootengine_core-0.5.0 → rootengine_core-0.5.1/rootengine_core.egg-info}/PKG-INFO +1 -1
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core.egg-info/SOURCES.txt +3 -3
- rootengine_core-0.5.0/rootengine_core/conversation/__init__.py +0 -1
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/LICENSE +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/README.md +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/constants/__init__.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/constants/conversation.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/constants/framework.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/constants/tool.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/llm/__init__.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/llm/llm.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/llm/openai_adapter.py +0 -0
- /rootengine_core-0.5.0/rootengine_core/schema/source/conversation/no_tool_conversation.json → /rootengine_core-0.5.1/rootengine_core/schema/source/conversation/base_conversation.json +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/llm/llm_message.json +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/llm/llm_output.json +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/llm/tool_choice.json +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/reif_entry.json +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/tool/tool_call.json +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/tool/tool_func_map.json +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/tool/tool_registry.json +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/tool/tool_result.json +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/tool/__init__.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/utils/__init__.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/utils/helpers.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/utils/path.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/utils/registrar.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/utils/reif_adapter.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/utils/time.py +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core.egg-info/dependency_links.txt +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core.egg-info/requires.txt +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core.egg-info/top_level.txt +0 -0
- {rootengine_core-0.5.0 → rootengine_core-0.5.1}/setup.cfg +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "rootengine-core"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.1"
|
|
8
8
|
description = "RootEngine AI Agent Framework Core"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -34,5 +34,5 @@ exclude = ["rootengine_core.test*"]
|
|
|
34
34
|
[tool.setuptools.package-data]
|
|
35
35
|
rootengine_core = [
|
|
36
36
|
"schema/source/**/*.json",
|
|
37
|
-
"
|
|
37
|
+
"schema/runtime/*.py",
|
|
38
38
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .base_conversation import BaseConversation
|
|
@@ -8,10 +8,10 @@ from ..utils.time import get_iso_timestamp
|
|
|
8
8
|
from jsonschema import validate
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
from ..
|
|
12
|
-
SCHEMA = get_json("conversation.
|
|
11
|
+
from ..schema.runtime.reif_schema import get_json
|
|
12
|
+
SCHEMA = get_json("conversation.base_conversation")
|
|
13
13
|
|
|
14
|
-
class
|
|
14
|
+
class BaseConversation:
|
|
15
15
|
def __init__(self, conversation_entry: dict = None):
|
|
16
16
|
# 如果未传自动创建新的
|
|
17
17
|
if conversation_entry is None:
|
|
@@ -22,7 +22,7 @@ class NoToolConversation:
|
|
|
22
22
|
self.messages = self.entry["reif_content"]
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
def create(self) ->
|
|
25
|
+
def create(self) -> BaseConversation:
|
|
26
26
|
"""创建新会话"""
|
|
27
27
|
self.entry = reif_create({"category": "conversation"})
|
|
28
28
|
# 确保 reif_content 存在且为空列表
|
|
@@ -38,7 +38,7 @@ class NoToolConversation:
|
|
|
38
38
|
content: str = None,
|
|
39
39
|
created_at: str = None,
|
|
40
40
|
extra: dict = None,
|
|
41
|
-
) ->
|
|
41
|
+
) -> BaseConversation :
|
|
42
42
|
|
|
43
43
|
"""
|
|
44
44
|
向会话添加一条消息。
|
|
@@ -87,12 +87,12 @@ class NoToolConversation:
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
def load_entry(self,entry: dict) ->
|
|
90
|
+
def load_entry(self,entry: dict) -> BaseConversation :
|
|
91
91
|
"""加载整个 conversation 条目"""
|
|
92
92
|
self.entry = entry
|
|
93
93
|
self.messages = self.entry["reif_content"]
|
|
94
94
|
return self
|
|
95
|
-
def load_messages(self,messages: list) ->
|
|
95
|
+
def load_messages(self,messages: list) -> BaseConversation :
|
|
96
96
|
self.messages = messages
|
|
97
97
|
self.entry["reif_content"] = self.messages
|
|
98
98
|
return self
|
|
@@ -6,7 +6,7 @@ JSON文件加载器
|
|
|
6
6
|
import json
|
|
7
7
|
|
|
8
8
|
# JSON字典
|
|
9
|
-
JSON_DICT = { 'conversation.
|
|
9
|
+
JSON_DICT = { 'conversation.base_conversation': { '$schema': 'http://json-schema.org/draft-07/schema#',
|
|
10
10
|
'description': '基础对话消息列表(无工具字段)',
|
|
11
11
|
'items': { 'properties': { 'content': { 'type': [ 'string',
|
|
12
12
|
'null']},
|
|
@@ -307,7 +307,7 @@ def get_json(key: str):
|
|
|
307
307
|
"""根据键名获取JSON数据
|
|
308
308
|
|
|
309
309
|
Args:
|
|
310
|
-
key: JSON键名,如 'reif_entry', 'conversation.
|
|
310
|
+
key: JSON键名,如 'reif_entry', 'conversation.base_conversation'
|
|
311
311
|
|
|
312
312
|
Returns:
|
|
313
313
|
JSON字典或None(如果不存在)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
4
|
from jsonschema import validate
|
|
5
|
-
from ..
|
|
5
|
+
from ..schema.runtime.reif_schema import get_json
|
|
6
6
|
TOOL_REGISTRY_SCHEMA = get_json("tool.tool_registry")
|
|
7
7
|
TOOL_CALL_SCHEMA = get_json("tool.tool_call")
|
|
8
8
|
TOOL_RESULT_SCHEMA = get_json("tool.tool_result")
|
|
@@ -55,7 +55,7 @@ def scan_jsons_to_dict(root_dir: Path, ignore_errors: bool = False) -> Dict[str,
|
|
|
55
55
|
结构示例:
|
|
56
56
|
{
|
|
57
57
|
'reif_entry': {...JSON内容...},
|
|
58
|
-
'conversation.
|
|
58
|
+
'conversation.base_conversation': {...JSON内容...},
|
|
59
59
|
'tool.tool_call': {...JSON内容...},
|
|
60
60
|
...
|
|
61
61
|
}
|
|
@@ -76,7 +76,7 @@ def scan_jsons_to_dict(root_dir: Path, ignore_errors: bool = False) -> Dict[str,
|
|
|
76
76
|
rel_path = json_file.relative_to(root_dir)
|
|
77
77
|
|
|
78
78
|
# 将路径转换为点分隔的键名
|
|
79
|
-
# 例如: conversation/
|
|
79
|
+
# 例如: conversation/base_conversation.json -> conversation.base_conversation
|
|
80
80
|
key_parts = []
|
|
81
81
|
for part in rel_path.parts:
|
|
82
82
|
if part.endswith('.json'):
|
|
@@ -122,7 +122,7 @@ def get_json(key: str):
|
|
|
122
122
|
"""根据键名获取JSON数据
|
|
123
123
|
|
|
124
124
|
Args:
|
|
125
|
-
key: JSON键名,如 'reif_entry', 'conversation.
|
|
125
|
+
key: JSON键名,如 'reif_entry', 'conversation.base_conversation'
|
|
126
126
|
|
|
127
127
|
Returns:
|
|
128
128
|
JSON字典或None(如果不存在)
|
|
@@ -12,12 +12,13 @@ rootengine_core/constants/conversation.py
|
|
|
12
12
|
rootengine_core/constants/framework.py
|
|
13
13
|
rootengine_core/constants/tool.py
|
|
14
14
|
rootengine_core/conversation/__init__.py
|
|
15
|
-
rootengine_core/conversation/
|
|
15
|
+
rootengine_core/conversation/base_conversation.py
|
|
16
16
|
rootengine_core/llm/__init__.py
|
|
17
17
|
rootengine_core/llm/llm.py
|
|
18
18
|
rootengine_core/llm/openai_adapter.py
|
|
19
|
+
rootengine_core/schema/runtime/reif_schema.py
|
|
19
20
|
rootengine_core/schema/source/reif_entry.json
|
|
20
|
-
rootengine_core/schema/source/conversation/
|
|
21
|
+
rootengine_core/schema/source/conversation/base_conversation.json
|
|
21
22
|
rootengine_core/schema/source/llm/llm_message.json
|
|
22
23
|
rootengine_core/schema/source/llm/llm_output.json
|
|
23
24
|
rootengine_core/schema/source/llm/tool_choice.json
|
|
@@ -25,7 +26,6 @@ rootengine_core/schema/source/tool/tool_call.json
|
|
|
25
26
|
rootengine_core/schema/source/tool/tool_func_map.json
|
|
26
27
|
rootengine_core/schema/source/tool/tool_registry.json
|
|
27
28
|
rootengine_core/schema/source/tool/tool_result.json
|
|
28
|
-
rootengine_core/schema_runtime/reif_schema.py
|
|
29
29
|
rootengine_core/tool/__init__.py
|
|
30
30
|
rootengine_core/tool/adapter.py
|
|
31
31
|
rootengine_core/tool/tool.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .no_tool_conversation import NoToolConversation
|
|
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
|
{rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/llm/llm_message.json
RENAMED
|
File without changes
|
{rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/llm/llm_output.json
RENAMED
|
File without changes
|
{rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/llm/tool_choice.json
RENAMED
|
File without changes
|
{rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/reif_entry.json
RENAMED
|
File without changes
|
{rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/tool/tool_call.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core/schema/source/tool/tool_result.json
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
|
{rootengine_core-0.5.0 → rootengine_core-0.5.1}/rootengine_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|