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