aiecs 1.3.8__py3-none-any.whl → 1.4.1__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 aiecs might be problematic. Click here for more details.
- aiecs/__init__.py +1 -1
- aiecs/domain/__init__.py +120 -0
- aiecs/domain/agent/__init__.py +184 -0
- aiecs/domain/agent/base_agent.py +691 -0
- aiecs/domain/agent/exceptions.py +99 -0
- aiecs/domain/agent/hybrid_agent.py +495 -0
- aiecs/domain/agent/integration/__init__.py +23 -0
- aiecs/domain/agent/integration/context_compressor.py +219 -0
- aiecs/domain/agent/integration/context_engine_adapter.py +258 -0
- aiecs/domain/agent/integration/retry_policy.py +228 -0
- aiecs/domain/agent/integration/role_config.py +217 -0
- aiecs/domain/agent/lifecycle.py +298 -0
- aiecs/domain/agent/llm_agent.py +309 -0
- aiecs/domain/agent/memory/__init__.py +13 -0
- aiecs/domain/agent/memory/conversation.py +216 -0
- aiecs/domain/agent/migration/__init__.py +15 -0
- aiecs/domain/agent/migration/conversion.py +171 -0
- aiecs/domain/agent/migration/legacy_wrapper.py +97 -0
- aiecs/domain/agent/models.py +263 -0
- aiecs/domain/agent/observability.py +443 -0
- aiecs/domain/agent/persistence.py +287 -0
- aiecs/domain/agent/prompts/__init__.py +25 -0
- aiecs/domain/agent/prompts/builder.py +164 -0
- aiecs/domain/agent/prompts/formatters.py +192 -0
- aiecs/domain/agent/prompts/template.py +264 -0
- aiecs/domain/agent/registry.py +261 -0
- aiecs/domain/agent/tool_agent.py +267 -0
- aiecs/domain/agent/tools/__init__.py +13 -0
- aiecs/domain/agent/tools/schema_generator.py +222 -0
- aiecs/main.py +2 -2
- aiecs/tools/search_tool/__init__.py +1 -0
- {aiecs-1.3.8.dist-info → aiecs-1.4.1.dist-info}/METADATA +1 -1
- {aiecs-1.3.8.dist-info → aiecs-1.4.1.dist-info}/RECORD +37 -10
- {aiecs-1.3.8.dist-info → aiecs-1.4.1.dist-info}/WHEEL +0 -0
- {aiecs-1.3.8.dist-info → aiecs-1.4.1.dist-info}/entry_points.txt +0 -0
- {aiecs-1.3.8.dist-info → aiecs-1.4.1.dist-info}/licenses/LICENSE +0 -0
- {aiecs-1.3.8.dist-info → aiecs-1.4.1.dist-info}/top_level.txt +0 -0
aiecs/__init__.py
CHANGED
|
@@ -5,7 +5,7 @@ A powerful Python middleware framework for building AI-powered applications
|
|
|
5
5
|
with tool orchestration, task execution, and multi-provider LLM support.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "1.
|
|
8
|
+
__version__ = "1.4.1"
|
|
9
9
|
__author__ = "AIECS Team"
|
|
10
10
|
__email__ = "iretbl@gmail.com"
|
|
11
11
|
|
aiecs/domain/__init__.py
CHANGED
|
@@ -41,6 +41,50 @@ from .community import (
|
|
|
41
41
|
AgentAdapterError, CommunicationError, ContextError,
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
+
from .agent import (
|
|
45
|
+
# Exceptions
|
|
46
|
+
AgentException, AgentNotFoundError, AgentAlreadyRegisteredError,
|
|
47
|
+
InvalidStateTransitionError, ConfigurationError, TaskExecutionError,
|
|
48
|
+
ToolAccessDeniedError, SerializationError, AgentInitializationError,
|
|
49
|
+
|
|
50
|
+
# Enums
|
|
51
|
+
AgentState, AgentType, GoalStatus, GoalPriority, CapabilityLevel, MemoryType,
|
|
52
|
+
|
|
53
|
+
# Models
|
|
54
|
+
RetryPolicy, AgentConfiguration, AgentGoal, AgentCapabilityDeclaration,
|
|
55
|
+
AgentMetrics, AgentInteraction, AgentMemory,
|
|
56
|
+
|
|
57
|
+
# Base and Concrete Agents
|
|
58
|
+
BaseAIAgent, LLMAgent, ToolAgent, HybridAgent,
|
|
59
|
+
|
|
60
|
+
# Lifecycle Management
|
|
61
|
+
AgentRegistry, AgentLifecycleManager,
|
|
62
|
+
get_global_registry, get_global_lifecycle_manager,
|
|
63
|
+
|
|
64
|
+
# Persistence
|
|
65
|
+
InMemoryPersistence, FilePersistence,
|
|
66
|
+
get_global_persistence, set_global_persistence,
|
|
67
|
+
|
|
68
|
+
# Observability
|
|
69
|
+
AgentController, LoggingObserver, MetricsObserver,
|
|
70
|
+
|
|
71
|
+
# Prompts
|
|
72
|
+
PromptTemplate, ChatPromptTemplate, MessageBuilder,
|
|
73
|
+
|
|
74
|
+
# Tools
|
|
75
|
+
ToolSchemaGenerator, generate_tool_schema,
|
|
76
|
+
|
|
77
|
+
# Memory
|
|
78
|
+
ConversationMemory, Session,
|
|
79
|
+
|
|
80
|
+
# Integration
|
|
81
|
+
ContextEngineAdapter, EnhancedRetryPolicy, RoleConfiguration,
|
|
82
|
+
ContextCompressor, compress_messages,
|
|
83
|
+
|
|
84
|
+
# Migration
|
|
85
|
+
LegacyAgentWrapper, convert_langchain_prompt, convert_legacy_config,
|
|
86
|
+
)
|
|
87
|
+
|
|
44
88
|
__all__ = [
|
|
45
89
|
# Execution domain
|
|
46
90
|
"TaskStepResult",
|
|
@@ -127,4 +171,80 @@ __all__ = [
|
|
|
127
171
|
"AgentAdapterError",
|
|
128
172
|
"CommunicationError",
|
|
129
173
|
"ContextError",
|
|
174
|
+
|
|
175
|
+
# Agent domain - Exceptions
|
|
176
|
+
"AgentException",
|
|
177
|
+
"AgentNotFoundError",
|
|
178
|
+
"AgentAlreadyRegisteredError",
|
|
179
|
+
"InvalidStateTransitionError",
|
|
180
|
+
"ConfigurationError",
|
|
181
|
+
"TaskExecutionError",
|
|
182
|
+
"ToolAccessDeniedError",
|
|
183
|
+
"SerializationError",
|
|
184
|
+
"AgentInitializationError",
|
|
185
|
+
|
|
186
|
+
# Agent domain - Enums
|
|
187
|
+
"AgentState",
|
|
188
|
+
"AgentType",
|
|
189
|
+
"GoalStatus",
|
|
190
|
+
"GoalPriority",
|
|
191
|
+
"CapabilityLevel",
|
|
192
|
+
"MemoryType",
|
|
193
|
+
|
|
194
|
+
# Agent domain - Models
|
|
195
|
+
"RetryPolicy",
|
|
196
|
+
"AgentConfiguration",
|
|
197
|
+
"AgentGoal",
|
|
198
|
+
"AgentCapabilityDeclaration",
|
|
199
|
+
"AgentMetrics",
|
|
200
|
+
"AgentInteraction",
|
|
201
|
+
"AgentMemory",
|
|
202
|
+
|
|
203
|
+
# Agent domain - Base and Concrete Agents
|
|
204
|
+
"BaseAIAgent",
|
|
205
|
+
"LLMAgent",
|
|
206
|
+
"ToolAgent",
|
|
207
|
+
"HybridAgent",
|
|
208
|
+
|
|
209
|
+
# Agent domain - Lifecycle Management
|
|
210
|
+
"AgentRegistry",
|
|
211
|
+
"AgentLifecycleManager",
|
|
212
|
+
"get_global_registry",
|
|
213
|
+
"get_global_lifecycle_manager",
|
|
214
|
+
|
|
215
|
+
# Agent domain - Persistence
|
|
216
|
+
"InMemoryPersistence",
|
|
217
|
+
"FilePersistence",
|
|
218
|
+
"get_global_persistence",
|
|
219
|
+
"set_global_persistence",
|
|
220
|
+
|
|
221
|
+
# Agent domain - Observability
|
|
222
|
+
"AgentController",
|
|
223
|
+
"LoggingObserver",
|
|
224
|
+
"MetricsObserver",
|
|
225
|
+
|
|
226
|
+
# Agent domain - Prompts
|
|
227
|
+
"PromptTemplate",
|
|
228
|
+
"ChatPromptTemplate",
|
|
229
|
+
"MessageBuilder",
|
|
230
|
+
|
|
231
|
+
# Agent domain - Tools
|
|
232
|
+
"ToolSchemaGenerator",
|
|
233
|
+
"generate_tool_schema",
|
|
234
|
+
|
|
235
|
+
# Agent domain - Memory
|
|
236
|
+
"ConversationMemory",
|
|
237
|
+
"Session",
|
|
238
|
+
|
|
239
|
+
# Agent domain - Integration
|
|
240
|
+
"ContextEngineAdapter",
|
|
241
|
+
"EnhancedRetryPolicy",
|
|
242
|
+
"RoleConfiguration",
|
|
243
|
+
"ContextCompressor",
|
|
244
|
+
"compress_messages",
|
|
245
|
+
|
|
246
|
+
# Agent domain - Migration
|
|
247
|
+
"LegacyAgentWrapper",
|
|
248
|
+
"convert_langchain_prompt",
|
|
249
|
+
"convert_legacy_config",
|
|
130
250
|
]
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Agent Domain Module
|
|
3
|
+
|
|
4
|
+
Provides the base AI agent model and related components.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# Exceptions
|
|
8
|
+
from .exceptions import (
|
|
9
|
+
AgentException,
|
|
10
|
+
AgentNotFoundError,
|
|
11
|
+
AgentAlreadyRegisteredError,
|
|
12
|
+
InvalidStateTransitionError,
|
|
13
|
+
ConfigurationError,
|
|
14
|
+
TaskExecutionError,
|
|
15
|
+
ToolAccessDeniedError,
|
|
16
|
+
SerializationError,
|
|
17
|
+
AgentInitializationError,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
# Models and Enums
|
|
21
|
+
from .models import (
|
|
22
|
+
AgentState,
|
|
23
|
+
AgentType,
|
|
24
|
+
GoalStatus,
|
|
25
|
+
GoalPriority,
|
|
26
|
+
CapabilityLevel,
|
|
27
|
+
MemoryType,
|
|
28
|
+
RetryPolicy,
|
|
29
|
+
AgentConfiguration,
|
|
30
|
+
AgentGoal,
|
|
31
|
+
AgentCapabilityDeclaration,
|
|
32
|
+
AgentMetrics,
|
|
33
|
+
AgentInteraction,
|
|
34
|
+
AgentMemory,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# Base Agent
|
|
38
|
+
from .base_agent import BaseAIAgent
|
|
39
|
+
|
|
40
|
+
# Concrete Agents
|
|
41
|
+
from .llm_agent import LLMAgent
|
|
42
|
+
from .tool_agent import ToolAgent
|
|
43
|
+
from .hybrid_agent import HybridAgent
|
|
44
|
+
|
|
45
|
+
# Lifecycle Management
|
|
46
|
+
from .registry import AgentRegistry, get_global_registry, reset_global_registry
|
|
47
|
+
from .lifecycle import (
|
|
48
|
+
AgentLifecycleManager,
|
|
49
|
+
get_global_lifecycle_manager,
|
|
50
|
+
reset_global_lifecycle_manager,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# Persistence
|
|
54
|
+
from .persistence import (
|
|
55
|
+
AgentPersistence,
|
|
56
|
+
InMemoryPersistence,
|
|
57
|
+
FilePersistence,
|
|
58
|
+
AgentStateSerializer,
|
|
59
|
+
get_global_persistence,
|
|
60
|
+
set_global_persistence,
|
|
61
|
+
reset_global_persistence,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Observability
|
|
65
|
+
from .observability import (
|
|
66
|
+
AgentObserver,
|
|
67
|
+
LoggingObserver,
|
|
68
|
+
MetricsObserver,
|
|
69
|
+
AgentController,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# Prompts
|
|
73
|
+
from .prompts import (
|
|
74
|
+
PromptTemplate,
|
|
75
|
+
ChatPromptTemplate,
|
|
76
|
+
MessageBuilder,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Tools
|
|
80
|
+
from .tools import (
|
|
81
|
+
ToolSchemaGenerator,
|
|
82
|
+
generate_tool_schema,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
# Memory
|
|
86
|
+
from .memory import (
|
|
87
|
+
ConversationMemory,
|
|
88
|
+
Session,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
# Integration
|
|
92
|
+
from .integration import (
|
|
93
|
+
ContextEngineAdapter,
|
|
94
|
+
EnhancedRetryPolicy,
|
|
95
|
+
ErrorClassifier,
|
|
96
|
+
RoleConfiguration,
|
|
97
|
+
load_role_config,
|
|
98
|
+
ContextCompressor,
|
|
99
|
+
compress_messages,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
# Migration
|
|
103
|
+
from .migration import (
|
|
104
|
+
LegacyAgentWrapper,
|
|
105
|
+
convert_langchain_prompt,
|
|
106
|
+
convert_legacy_config,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
__all__ = [
|
|
110
|
+
# Exceptions
|
|
111
|
+
"AgentException",
|
|
112
|
+
"AgentNotFoundError",
|
|
113
|
+
"AgentAlreadyRegisteredError",
|
|
114
|
+
"InvalidStateTransitionError",
|
|
115
|
+
"ConfigurationError",
|
|
116
|
+
"TaskExecutionError",
|
|
117
|
+
"ToolAccessDeniedError",
|
|
118
|
+
"SerializationError",
|
|
119
|
+
"AgentInitializationError",
|
|
120
|
+
# Enums
|
|
121
|
+
"AgentState",
|
|
122
|
+
"AgentType",
|
|
123
|
+
"GoalStatus",
|
|
124
|
+
"GoalPriority",
|
|
125
|
+
"CapabilityLevel",
|
|
126
|
+
"MemoryType",
|
|
127
|
+
# Models
|
|
128
|
+
"RetryPolicy",
|
|
129
|
+
"AgentConfiguration",
|
|
130
|
+
"AgentGoal",
|
|
131
|
+
"AgentCapabilityDeclaration",
|
|
132
|
+
"AgentMetrics",
|
|
133
|
+
"AgentInteraction",
|
|
134
|
+
"AgentMemory",
|
|
135
|
+
# Base Agent
|
|
136
|
+
"BaseAIAgent",
|
|
137
|
+
# Concrete Agents
|
|
138
|
+
"LLMAgent",
|
|
139
|
+
"ToolAgent",
|
|
140
|
+
"HybridAgent",
|
|
141
|
+
# Lifecycle Management
|
|
142
|
+
"AgentRegistry",
|
|
143
|
+
"get_global_registry",
|
|
144
|
+
"reset_global_registry",
|
|
145
|
+
"AgentLifecycleManager",
|
|
146
|
+
"get_global_lifecycle_manager",
|
|
147
|
+
"reset_global_lifecycle_manager",
|
|
148
|
+
# Persistence
|
|
149
|
+
"AgentPersistence",
|
|
150
|
+
"InMemoryPersistence",
|
|
151
|
+
"FilePersistence",
|
|
152
|
+
"AgentStateSerializer",
|
|
153
|
+
"get_global_persistence",
|
|
154
|
+
"set_global_persistence",
|
|
155
|
+
"reset_global_persistence",
|
|
156
|
+
# Observability
|
|
157
|
+
"AgentObserver",
|
|
158
|
+
"LoggingObserver",
|
|
159
|
+
"MetricsObserver",
|
|
160
|
+
"AgentController",
|
|
161
|
+
# Prompts
|
|
162
|
+
"PromptTemplate",
|
|
163
|
+
"ChatPromptTemplate",
|
|
164
|
+
"MessageBuilder",
|
|
165
|
+
# Tools
|
|
166
|
+
"ToolSchemaGenerator",
|
|
167
|
+
"generate_tool_schema",
|
|
168
|
+
# Memory
|
|
169
|
+
"ConversationMemory",
|
|
170
|
+
"Session",
|
|
171
|
+
# Integration
|
|
172
|
+
"ContextEngineAdapter",
|
|
173
|
+
"EnhancedRetryPolicy",
|
|
174
|
+
"ErrorClassifier",
|
|
175
|
+
"RoleConfiguration",
|
|
176
|
+
"load_role_config",
|
|
177
|
+
"ContextCompressor",
|
|
178
|
+
"compress_messages",
|
|
179
|
+
# Migration
|
|
180
|
+
"LegacyAgentWrapper",
|
|
181
|
+
"convert_langchain_prompt",
|
|
182
|
+
"convert_legacy_config",
|
|
183
|
+
]
|
|
184
|
+
|