daita-agents 0.1.0__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 daita-agents might be problematic. Click here for more details.
- daita/__init__.py +208 -0
- daita/agents/__init__.py +33 -0
- daita/agents/base.py +722 -0
- daita/agents/substrate.py +895 -0
- daita/cli/__init__.py +145 -0
- daita/cli/__main__.py +7 -0
- daita/cli/ascii_art.py +44 -0
- daita/cli/core/__init__.py +0 -0
- daita/cli/core/create.py +254 -0
- daita/cli/core/deploy.py +473 -0
- daita/cli/core/deployments.py +309 -0
- daita/cli/core/import_detector.py +219 -0
- daita/cli/core/init.py +382 -0
- daita/cli/core/logs.py +239 -0
- daita/cli/core/managed_deploy.py +709 -0
- daita/cli/core/run.py +648 -0
- daita/cli/core/status.py +421 -0
- daita/cli/core/test.py +239 -0
- daita/cli/core/webhooks.py +172 -0
- daita/cli/main.py +588 -0
- daita/cli/utils.py +541 -0
- daita/config/__init__.py +62 -0
- daita/config/base.py +159 -0
- daita/config/settings.py +184 -0
- daita/core/__init__.py +262 -0
- daita/core/decision_tracing.py +701 -0
- daita/core/exceptions.py +480 -0
- daita/core/focus.py +251 -0
- daita/core/interfaces.py +76 -0
- daita/core/plugin_tracing.py +550 -0
- daita/core/relay.py +695 -0
- daita/core/reliability.py +381 -0
- daita/core/scaling.py +444 -0
- daita/core/tools.py +402 -0
- daita/core/tracing.py +770 -0
- daita/core/workflow.py +1084 -0
- daita/display/__init__.py +1 -0
- daita/display/console.py +160 -0
- daita/execution/__init__.py +58 -0
- daita/execution/client.py +856 -0
- daita/execution/exceptions.py +92 -0
- daita/execution/models.py +317 -0
- daita/llm/__init__.py +60 -0
- daita/llm/anthropic.py +166 -0
- daita/llm/base.py +373 -0
- daita/llm/factory.py +101 -0
- daita/llm/gemini.py +152 -0
- daita/llm/grok.py +114 -0
- daita/llm/mock.py +135 -0
- daita/llm/openai.py +109 -0
- daita/plugins/__init__.py +141 -0
- daita/plugins/base.py +37 -0
- daita/plugins/base_db.py +167 -0
- daita/plugins/elasticsearch.py +844 -0
- daita/plugins/mcp.py +481 -0
- daita/plugins/mongodb.py +510 -0
- daita/plugins/mysql.py +351 -0
- daita/plugins/postgresql.py +331 -0
- daita/plugins/redis_messaging.py +500 -0
- daita/plugins/rest.py +529 -0
- daita/plugins/s3.py +761 -0
- daita/plugins/slack.py +729 -0
- daita/utils/__init__.py +18 -0
- daita_agents-0.1.0.dist-info/METADATA +350 -0
- daita_agents-0.1.0.dist-info/RECORD +69 -0
- daita_agents-0.1.0.dist-info/WHEEL +5 -0
- daita_agents-0.1.0.dist-info/entry_points.txt +2 -0
- daita_agents-0.1.0.dist-info/licenses/LICENSE +56 -0
- daita_agents-0.1.0.dist-info/top_level.txt +1 -0
daita/__init__.py
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Daita Agents - A flexible framework for AI agent creation and orchestration.
|
|
3
|
+
|
|
4
|
+
This module provides the main entry point for the Daita framework with
|
|
5
|
+
automatic tracing and observability built-in.
|
|
6
|
+
|
|
7
|
+
Key Components:
|
|
8
|
+
- Agent framework with BaseAgent and SubstrateAgent
|
|
9
|
+
- LLM provider abstractions for OpenAI, Anthropic, Grok, and Gemini
|
|
10
|
+
- Plugin system for database and API integrations
|
|
11
|
+
- Workflow orchestration for multi-agent systems
|
|
12
|
+
- Unified tracing system for automatic observability
|
|
13
|
+
- Decision tracing for agent reasoning capture
|
|
14
|
+
- Plugin execution monitoring
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
# Version info
|
|
18
|
+
__version__ = "0.3.2"
|
|
19
|
+
|
|
20
|
+
# PRIMARY INTERFACE - Direct classes
|
|
21
|
+
from .agents.substrate import SubstrateAgent
|
|
22
|
+
from .agents.base import BaseAgent
|
|
23
|
+
|
|
24
|
+
# Plugin system - Direct imports
|
|
25
|
+
from .plugins import postgresql, mysql, mongodb, rest, s3, slack, elasticsearch
|
|
26
|
+
from .plugins import PluginAccess
|
|
27
|
+
|
|
28
|
+
# Configuration classes
|
|
29
|
+
from .config.base import AgentConfig, DaitaConfig, AgentType, RetryPolicy, RetryStrategy
|
|
30
|
+
|
|
31
|
+
# Reliability components - NEW: Production-grade reliability features
|
|
32
|
+
from .core.reliability import (
|
|
33
|
+
TaskManager,
|
|
34
|
+
TaskStatus,
|
|
35
|
+
BackpressureController,
|
|
36
|
+
CircuitBreaker,
|
|
37
|
+
CircuitState
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# Core interfaces - For advanced users who want to implement custom components
|
|
41
|
+
from .core.interfaces import (
|
|
42
|
+
Agent,
|
|
43
|
+
LLMProvider,
|
|
44
|
+
DatabaseBackend,
|
|
45
|
+
DataProcessor
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# Core workflow components - For multi-agent systems
|
|
49
|
+
from .core.workflow import Workflow, ReliabilityConfig
|
|
50
|
+
from .core.relay import RelayManager
|
|
51
|
+
|
|
52
|
+
# Scaling components - For horizontal scaling
|
|
53
|
+
from .core.scaling import AgentPool, LoadBalancer, PoolStatus, create_agent_pool
|
|
54
|
+
|
|
55
|
+
# Exception hierarchy - For error handling
|
|
56
|
+
from .core.exceptions import (
|
|
57
|
+
DaitaError,
|
|
58
|
+
AgentError,
|
|
59
|
+
LLMError,
|
|
60
|
+
ConfigError,
|
|
61
|
+
PluginError,
|
|
62
|
+
WorkflowError,
|
|
63
|
+
# Retry-specific exceptions
|
|
64
|
+
TransientError,
|
|
65
|
+
RetryableError,
|
|
66
|
+
PermanentError,
|
|
67
|
+
# Specific error types
|
|
68
|
+
RateLimitError,
|
|
69
|
+
TimeoutError,
|
|
70
|
+
AuthenticationError,
|
|
71
|
+
ValidationError,
|
|
72
|
+
# Reliability-specific exceptions
|
|
73
|
+
BackpressureError,
|
|
74
|
+
TaskTimeoutError,
|
|
75
|
+
AcknowledgmentTimeoutError,
|
|
76
|
+
TaskNotFoundError,
|
|
77
|
+
ReliabilityConfigurationError,
|
|
78
|
+
CircuitBreakerOpenError
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# LLM providers - For direct LLM access
|
|
82
|
+
from .llm.factory import create_llm_provider
|
|
83
|
+
from .llm.openai import OpenAIProvider
|
|
84
|
+
from .llm.anthropic import AnthropicProvider
|
|
85
|
+
from .llm.grok import GrokProvider
|
|
86
|
+
from .llm.gemini import GeminiProvider
|
|
87
|
+
from .llm.mock import MockLLMProvider
|
|
88
|
+
|
|
89
|
+
# Plugin system - For database and API integrations
|
|
90
|
+
from .plugins import PluginAccess
|
|
91
|
+
from .plugins.redis_messaging import RedisMessagingPlugin, redis_messaging
|
|
92
|
+
|
|
93
|
+
# Automatic Tracing System - NEW: Zero-configuration observability
|
|
94
|
+
from .core.tracing import (
|
|
95
|
+
get_trace_manager,
|
|
96
|
+
TraceType,
|
|
97
|
+
TraceStatus
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
# Plugin Tracing - NEW: Automatic tool execution monitoring
|
|
101
|
+
from .core.plugin_tracing import (
|
|
102
|
+
trace_plugin,
|
|
103
|
+
traced_postgresql,
|
|
104
|
+
traced_mysql,
|
|
105
|
+
traced_mongodb,
|
|
106
|
+
traced_rest
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
# Decision Tracing - NEW: Agent reasoning and confidence capture
|
|
110
|
+
from .core.decision_tracing import (
|
|
111
|
+
record_decision_point,
|
|
112
|
+
trace_decision,
|
|
113
|
+
DecisionType
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
# Autonomous Execution - NEW: Programmatic agent execution
|
|
117
|
+
from .execution.client import DaitaClient
|
|
118
|
+
from .execution.models import ExecutionResult, ScheduledTask, WebhookTrigger
|
|
119
|
+
from .execution.exceptions import ExecutionError
|
|
120
|
+
|
|
121
|
+
# MAIN EXPORTS
|
|
122
|
+
__all__ = [
|
|
123
|
+
# PRIMARY INTERFACES - Direct classes (what users need most)
|
|
124
|
+
"SubstrateAgent",
|
|
125
|
+
"BaseAgent",
|
|
126
|
+
"Workflow",
|
|
127
|
+
"DaitaClient",
|
|
128
|
+
|
|
129
|
+
# PLUGIN FUNCTIONS - Direct imports (new primary way)
|
|
130
|
+
"postgresql", "mysql", "mongodb", "rest", "s3", "slack", "elasticsearch",
|
|
131
|
+
|
|
132
|
+
# CORE UTILITIES - Essential framework features
|
|
133
|
+
"RelayManager",
|
|
134
|
+
"create_llm_provider",
|
|
135
|
+
"DaitaError",
|
|
136
|
+
"get_trace_manager",
|
|
137
|
+
|
|
138
|
+
# CONFIGURATION - Optional advanced usage
|
|
139
|
+
"AgentConfig",
|
|
140
|
+
"DaitaConfig",
|
|
141
|
+
"AgentType",
|
|
142
|
+
"RetryPolicy",
|
|
143
|
+
"RetryStrategy",
|
|
144
|
+
|
|
145
|
+
# LEGACY COMPONENTS - Advanced/internal usage
|
|
146
|
+
"PluginAccess",
|
|
147
|
+
|
|
148
|
+
# Advanced workflow components
|
|
149
|
+
"ReliabilityConfig",
|
|
150
|
+
"AgentPool",
|
|
151
|
+
"LoadBalancer",
|
|
152
|
+
"create_agent_pool",
|
|
153
|
+
|
|
154
|
+
# Exception hierarchy
|
|
155
|
+
"AgentError",
|
|
156
|
+
"LLMError",
|
|
157
|
+
"ConfigError",
|
|
158
|
+
"PluginError",
|
|
159
|
+
"WorkflowError",
|
|
160
|
+
|
|
161
|
+
# LLM providers (optional - auto-created by agents)
|
|
162
|
+
"OpenAIProvider",
|
|
163
|
+
"AnthropicProvider",
|
|
164
|
+
"GrokProvider",
|
|
165
|
+
"GeminiProvider",
|
|
166
|
+
|
|
167
|
+
# Advanced interfaces
|
|
168
|
+
"Agent",
|
|
169
|
+
"LLMProvider",
|
|
170
|
+
|
|
171
|
+
# Tracing (automatic - optional direct access)
|
|
172
|
+
"TraceType",
|
|
173
|
+
"record_decision_point",
|
|
174
|
+
"trace_decision",
|
|
175
|
+
|
|
176
|
+
# Autonomous execution models and exceptions
|
|
177
|
+
"ExecutionResult",
|
|
178
|
+
"ScheduledTask",
|
|
179
|
+
"WebhookTrigger",
|
|
180
|
+
"ExecutionError"
|
|
181
|
+
]
|
|
182
|
+
|
|
183
|
+
# Framework metadata
|
|
184
|
+
FRAMEWORK_INFO = {
|
|
185
|
+
"name": "Daita Agents",
|
|
186
|
+
"version": __version__,
|
|
187
|
+
"description": "A flexible framework for AI agent creation and orchestration with automatic tracing",
|
|
188
|
+
"features": [
|
|
189
|
+
"Zero-configuration automatic tracing",
|
|
190
|
+
"Production-grade reliability features",
|
|
191
|
+
"Message acknowledgments and task tracking",
|
|
192
|
+
"Backpressure control and circuit breakers",
|
|
193
|
+
"Agent operation monitoring",
|
|
194
|
+
"LLM call tracking with costs",
|
|
195
|
+
"Plugin/tool execution tracing",
|
|
196
|
+
"Decision reasoning capture",
|
|
197
|
+
"Workflow communication tracking",
|
|
198
|
+
"Dashboard integration"
|
|
199
|
+
],
|
|
200
|
+
"tracing_enabled": True
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
def get_framework_info() -> dict:
|
|
204
|
+
"""Get framework information and metadata."""
|
|
205
|
+
return FRAMEWORK_INFO.copy()
|
|
206
|
+
|
|
207
|
+
# Add to exports
|
|
208
|
+
__all__.append("get_framework_info")
|
daita/agents/__init__.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Agent implementations for Daita Agents.
|
|
3
|
+
|
|
4
|
+
This module provides the core agent implementations:
|
|
5
|
+
- BaseAgent: Foundation class with retry logic and error handling
|
|
6
|
+
- SubstrateAgent: Flexible agent that can be customized with handlers and presets
|
|
7
|
+
|
|
8
|
+
The agent system is designed around the SubstrateAgent as the primary interface,
|
|
9
|
+
with preset configurations for common patterns like analysis and transformation.
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
```python
|
|
13
|
+
from daita.agents import SubstrateAgent
|
|
14
|
+
|
|
15
|
+
# Direct instantiation (recommended)
|
|
16
|
+
agent = SubstrateAgent(name="My Agent", llm_provider="openai", model="gpt-4")
|
|
17
|
+
|
|
18
|
+
# Or with configuration object (backward compatibility)
|
|
19
|
+
from daita.config.base import AgentConfig
|
|
20
|
+
config = AgentConfig(name="My Agent")
|
|
21
|
+
agent = SubstrateAgent(config=config)
|
|
22
|
+
```
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
# Core agent classes
|
|
26
|
+
from .base import BaseAgent
|
|
27
|
+
from .substrate import SubstrateAgent
|
|
28
|
+
|
|
29
|
+
# Export all agent functionality
|
|
30
|
+
__all__ = [
|
|
31
|
+
"BaseAgent",
|
|
32
|
+
"SubstrateAgent",
|
|
33
|
+
]
|