agentium 1.0.0__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.
- agentium-1.0.0/PKG-INFO +185 -0
- agentium-1.0.0/README.md +116 -0
- agentium-1.0.0/agentium/__init__.py +297 -0
- agentium-1.0.0/agentium/core/__init__.py +1 -0
- agentium-1.0.0/agentium/core/communicator.py +575 -0
- agentium-1.0.0/agentium/core/condenser.py +330 -0
- agentium-1.0.0/agentium/core/extractor.py +737 -0
- agentium-1.0.0/agentium/core/insight_generator.py +522 -0
- agentium-1.0.0/agentium/core/memory_helper.py +647 -0
- agentium-1.0.0/agentium/core/optimizer.py +502 -0
- agentium-1.0.0/agentium/core/rearranger.py +599 -0
- agentium-1.0.0/agentium/core/summarize_custom.py +689 -0
- agentium-1.0.0/agentium/core/template_manager.py +516 -0
- agentium-1.0.0/agentium/core/translator.py +524 -0
- agentium-1.0.0/agentium/core/workflow_helper.py +530 -0
- agentium-1.0.0/agentium/integrations/__init__.py +467 -0
- agentium-1.0.0/agentium/integrations/crewai.py +630 -0
- agentium-1.0.0/agentium/integrations/langchain.py +468 -0
- agentium-1.0.0/agentium/integrations/langgraph.py +601 -0
- agentium-1.0.0/agentium/utils/__init__.py +1 -0
- agentium-1.0.0/agentium/utils/logger_utils.py +392 -0
- agentium-1.0.0/agentium.egg-info/PKG-INFO +185 -0
- agentium-1.0.0/agentium.egg-info/SOURCES.txt +26 -0
- agentium-1.0.0/agentium.egg-info/dependency_links.txt +1 -0
- agentium-1.0.0/agentium.egg-info/requires.txt +40 -0
- agentium-1.0.0/agentium.egg-info/top_level.txt +1 -0
- agentium-1.0.0/setup.cfg +4 -0
- agentium-1.0.0/setup.py +73 -0
agentium-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentium
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A comprehensive toolkit for AI agent development and workflow orchestration
|
|
5
|
+
Home-page: https://github.com/RNSsanjay/Agentium-Python-Library
|
|
6
|
+
Author: Sanjay N
|
|
7
|
+
Author-email: 2005sanjaynrs@gmail.com
|
|
8
|
+
Keywords: ai,agents,langchain,langgraph,crewai,nlp,automation,workflow
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Requires-Python: >=3.8
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
Requires-Dist: numpy>=1.21.0
|
|
23
|
+
Requires-Dist: pandas>=1.3.0
|
|
24
|
+
Requires-Dist: requests>=2.25.0
|
|
25
|
+
Requires-Dist: pydantic>=2.0.0
|
|
26
|
+
Requires-Dist: typing-extensions>=4.0.0
|
|
27
|
+
Requires-Dist: python-dotenv>=0.19.0
|
|
28
|
+
Requires-Dist: asyncio-throttle>=1.0.0
|
|
29
|
+
Requires-Dist: aiohttp>=3.8.0
|
|
30
|
+
Requires-Dist: openai>=1.0.0
|
|
31
|
+
Requires-Dist: anthropic>=0.3.0
|
|
32
|
+
Requires-Dist: google-generativeai>=0.3.0
|
|
33
|
+
Requires-Dist: tiktoken>=0.4.0
|
|
34
|
+
Requires-Dist: beautifulsoup4>=4.9.0
|
|
35
|
+
Requires-Dist: lxml>=4.6.0
|
|
36
|
+
Requires-Dist: PyYAML>=6.0
|
|
37
|
+
Requires-Dist: Jinja2>=3.0.0
|
|
38
|
+
Requires-Dist: redis>=4.0.0
|
|
39
|
+
Requires-Dist: sqlite3
|
|
40
|
+
Requires-Dist: logging
|
|
41
|
+
Requires-Dist: json5>=0.9.0
|
|
42
|
+
Requires-Dist: dateutil>=2.8.0
|
|
43
|
+
Requires-Dist: textstat>=0.7.0
|
|
44
|
+
Requires-Dist: scikit-learn>=1.0.0
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
47
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
48
|
+
Requires-Dist: black>=22.0; extra == "dev"
|
|
49
|
+
Requires-Dist: flake8>=5.0; extra == "dev"
|
|
50
|
+
Requires-Dist: mypy>=0.991; extra == "dev"
|
|
51
|
+
Provides-Extra: langchain
|
|
52
|
+
Requires-Dist: langchain>=0.1.0; extra == "langchain"
|
|
53
|
+
Requires-Dist: langchain-community>=0.0.10; extra == "langchain"
|
|
54
|
+
Provides-Extra: langgraph
|
|
55
|
+
Requires-Dist: langgraph>=0.0.20; extra == "langgraph"
|
|
56
|
+
Provides-Extra: crewai
|
|
57
|
+
Requires-Dist: crewai>=0.1.0; extra == "crewai"
|
|
58
|
+
Dynamic: author
|
|
59
|
+
Dynamic: author-email
|
|
60
|
+
Dynamic: classifier
|
|
61
|
+
Dynamic: description
|
|
62
|
+
Dynamic: description-content-type
|
|
63
|
+
Dynamic: home-page
|
|
64
|
+
Dynamic: keywords
|
|
65
|
+
Dynamic: provides-extra
|
|
66
|
+
Dynamic: requires-dist
|
|
67
|
+
Dynamic: requires-python
|
|
68
|
+
Dynamic: summary
|
|
69
|
+
|
|
70
|
+
# Agentium - AI Agent Development Toolkit
|
|
71
|
+
|
|
72
|
+
[](https://badge.fury.io/py/agentium)
|
|
73
|
+
[](https://pypi.org/project/agentium/)
|
|
74
|
+
[](https://opensource.org/licenses/MIT)
|
|
75
|
+
|
|
76
|
+
A comprehensive Python library designed for AI agent development and workflow orchestration. Agentium provides a rich set of tools and utilities that seamlessly integrate with popular AI frameworks like LangChain, LangGraph, and CrewAI.
|
|
77
|
+
|
|
78
|
+
## Features
|
|
79
|
+
|
|
80
|
+
- **🗜️ Condense**: Intelligent content condensation and compression
|
|
81
|
+
- **⚡ Optimizer**: Refine text, code, and workflows for better performance
|
|
82
|
+
- **📋 Rearranger**: Organize and restructure content logically
|
|
83
|
+
- **🔍 Extractor**: Extract structured information from various data sources
|
|
84
|
+
- **📢 Communicator**: Send messages and notifications across platforms
|
|
85
|
+
- **🌐 Translator**: Multi-language translation with tone adaptation
|
|
86
|
+
- **💡 Insight Generator**: Generate actionable insights from data
|
|
87
|
+
- **🔄 Workflow Helper**: Orchestrate complex tasks and triggers
|
|
88
|
+
- **📄 Template Manager**: Standardize outputs with customizable templates
|
|
89
|
+
- **🧠 Memory Helper**: Context storage and retrieval system
|
|
90
|
+
- **📝 Custom Summarizer**: Create summaries tailored to specific needs
|
|
91
|
+
- **📊 Logger Utils**: Track and debug operations with detailed logging
|
|
92
|
+
|
|
93
|
+
## Installation
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
pip install agentium
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Framework-specific installations:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# For LangChain integration
|
|
103
|
+
pip install agentium[langchain]
|
|
104
|
+
|
|
105
|
+
# For LangGraph integration
|
|
106
|
+
pip install agentium[langgraph]
|
|
107
|
+
|
|
108
|
+
# For CrewAI integration
|
|
109
|
+
pip install agentium[crewai]
|
|
110
|
+
|
|
111
|
+
# For development
|
|
112
|
+
pip install agentium[dev]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Quick Start
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
from agentium import Condenser, Optimizer, Communicator
|
|
119
|
+
|
|
120
|
+
# Initialize components
|
|
121
|
+
condenser = Condenser()
|
|
122
|
+
optimizer = Optimizer()
|
|
123
|
+
communicator = Communicator()
|
|
124
|
+
|
|
125
|
+
# Condense text
|
|
126
|
+
condensed = condenser.condense("Your long text here...")
|
|
127
|
+
|
|
128
|
+
# Optimize content
|
|
129
|
+
optimized = optimizer.optimize_text("Text to optimize")
|
|
130
|
+
|
|
131
|
+
# Send notification
|
|
132
|
+
communicator.send_notification("Process completed!", channel="email")
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Framework Integration
|
|
136
|
+
|
|
137
|
+
### LangChain Integration
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from agentium.integrations.langchain import AgentiumTool
|
|
141
|
+
from langchain.agents import initialize_agent
|
|
142
|
+
|
|
143
|
+
# Create Agentium tools for LangChain
|
|
144
|
+
tools = AgentiumTool.create_all_tools()
|
|
145
|
+
agent = initialize_agent(tools, llm, agent_type="zero-shot-react-description")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### LangGraph Integration
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
from agentium.integrations.langgraph import AgentiumNode
|
|
152
|
+
from langgraph import Graph
|
|
153
|
+
|
|
154
|
+
# Add Agentium nodes to LangGraph
|
|
155
|
+
graph = Graph()
|
|
156
|
+
graph.add_node("condenser", AgentiumNode.condenser_node)
|
|
157
|
+
graph.add_node("optimizer", AgentiumNode.optimizer_node)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### CrewAI Integration
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
from agentium.integrations.crewai import AgentiumCrewTool
|
|
164
|
+
from crewai import Agent, Task, Crew
|
|
165
|
+
|
|
166
|
+
# Create tools for CrewAI agents
|
|
167
|
+
tools = AgentiumCrewTool.get_all_tools()
|
|
168
|
+
agent = Agent(tools=tools, ...)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Documentation
|
|
172
|
+
|
|
173
|
+
For detailed documentation and examples, visit [our documentation site](https://agentium.readthedocs.io).
|
|
174
|
+
|
|
175
|
+
## Contributing
|
|
176
|
+
|
|
177
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
178
|
+
|
|
179
|
+
## License
|
|
180
|
+
|
|
181
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
182
|
+
|
|
183
|
+
## Support
|
|
184
|
+
|
|
185
|
+
If you encounter any issues or have questions, please [open an issue](https://github.com/RNSsanjay/Agentium-Python-Library/issues) on GitHub.
|
agentium-1.0.0/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Agentium - AI Agent Development Toolkit
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/agentium)
|
|
4
|
+
[](https://pypi.org/project/agentium/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
A comprehensive Python library designed for AI agent development and workflow orchestration. Agentium provides a rich set of tools and utilities that seamlessly integrate with popular AI frameworks like LangChain, LangGraph, and CrewAI.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **🗜️ Condense**: Intelligent content condensation and compression
|
|
12
|
+
- **⚡ Optimizer**: Refine text, code, and workflows for better performance
|
|
13
|
+
- **📋 Rearranger**: Organize and restructure content logically
|
|
14
|
+
- **🔍 Extractor**: Extract structured information from various data sources
|
|
15
|
+
- **📢 Communicator**: Send messages and notifications across platforms
|
|
16
|
+
- **🌐 Translator**: Multi-language translation with tone adaptation
|
|
17
|
+
- **💡 Insight Generator**: Generate actionable insights from data
|
|
18
|
+
- **🔄 Workflow Helper**: Orchestrate complex tasks and triggers
|
|
19
|
+
- **📄 Template Manager**: Standardize outputs with customizable templates
|
|
20
|
+
- **🧠 Memory Helper**: Context storage and retrieval system
|
|
21
|
+
- **📝 Custom Summarizer**: Create summaries tailored to specific needs
|
|
22
|
+
- **📊 Logger Utils**: Track and debug operations with detailed logging
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install agentium
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Framework-specific installations:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# For LangChain integration
|
|
34
|
+
pip install agentium[langchain]
|
|
35
|
+
|
|
36
|
+
# For LangGraph integration
|
|
37
|
+
pip install agentium[langgraph]
|
|
38
|
+
|
|
39
|
+
# For CrewAI integration
|
|
40
|
+
pip install agentium[crewai]
|
|
41
|
+
|
|
42
|
+
# For development
|
|
43
|
+
pip install agentium[dev]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Quick Start
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from agentium import Condenser, Optimizer, Communicator
|
|
50
|
+
|
|
51
|
+
# Initialize components
|
|
52
|
+
condenser = Condenser()
|
|
53
|
+
optimizer = Optimizer()
|
|
54
|
+
communicator = Communicator()
|
|
55
|
+
|
|
56
|
+
# Condense text
|
|
57
|
+
condensed = condenser.condense("Your long text here...")
|
|
58
|
+
|
|
59
|
+
# Optimize content
|
|
60
|
+
optimized = optimizer.optimize_text("Text to optimize")
|
|
61
|
+
|
|
62
|
+
# Send notification
|
|
63
|
+
communicator.send_notification("Process completed!", channel="email")
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Framework Integration
|
|
67
|
+
|
|
68
|
+
### LangChain Integration
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from agentium.integrations.langchain import AgentiumTool
|
|
72
|
+
from langchain.agents import initialize_agent
|
|
73
|
+
|
|
74
|
+
# Create Agentium tools for LangChain
|
|
75
|
+
tools = AgentiumTool.create_all_tools()
|
|
76
|
+
agent = initialize_agent(tools, llm, agent_type="zero-shot-react-description")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### LangGraph Integration
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from agentium.integrations.langgraph import AgentiumNode
|
|
83
|
+
from langgraph import Graph
|
|
84
|
+
|
|
85
|
+
# Add Agentium nodes to LangGraph
|
|
86
|
+
graph = Graph()
|
|
87
|
+
graph.add_node("condenser", AgentiumNode.condenser_node)
|
|
88
|
+
graph.add_node("optimizer", AgentiumNode.optimizer_node)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### CrewAI Integration
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from agentium.integrations.crewai import AgentiumCrewTool
|
|
95
|
+
from crewai import Agent, Task, Crew
|
|
96
|
+
|
|
97
|
+
# Create tools for CrewAI agents
|
|
98
|
+
tools = AgentiumCrewTool.get_all_tools()
|
|
99
|
+
agent = Agent(tools=tools, ...)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Documentation
|
|
103
|
+
|
|
104
|
+
For detailed documentation and examples, visit [our documentation site](https://agentium.readthedocs.io).
|
|
105
|
+
|
|
106
|
+
## Contributing
|
|
107
|
+
|
|
108
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
113
|
+
|
|
114
|
+
## Support
|
|
115
|
+
|
|
116
|
+
If you encounter any issues or have questions, please [open an issue](https://github.com/RNSsanjay/Agentium-Python-Library/issues) on GitHub.
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Agentium - Comprehensive Python Library for AI Agent Development
|
|
3
|
+
|
|
4
|
+
A production-ready library providing essential tools and utilities for
|
|
5
|
+
building intelligent AI agents, compatible with LangChain, LangGraph, and CrewAI.
|
|
6
|
+
|
|
7
|
+
Core Features:
|
|
8
|
+
- Content condensation and optimization
|
|
9
|
+
- Data extraction and processing
|
|
10
|
+
- Multi-channel communication
|
|
11
|
+
- Translation and localization
|
|
12
|
+
- Insight generation and analysis
|
|
13
|
+
- Workflow orchestration
|
|
14
|
+
- Template management
|
|
15
|
+
- Memory and context storage
|
|
16
|
+
- Custom summarization
|
|
17
|
+
- Advanced logging and monitoring
|
|
18
|
+
|
|
19
|
+
Framework Integrations:
|
|
20
|
+
- LangChain: Tools, memory, parsers, callbacks
|
|
21
|
+
- LangGraph: Workflow nodes, state management
|
|
22
|
+
- CrewAI: Enhanced agents, tasks, crews
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
__version__ = "1.0.0"
|
|
26
|
+
__author__ = "Agentium Development Team"
|
|
27
|
+
__license__ = "MIT"
|
|
28
|
+
|
|
29
|
+
# Core components
|
|
30
|
+
from .core.condenser import Condenser, CondenserConfig
|
|
31
|
+
from .core.optimizer import Optimizer, OptimizerConfig
|
|
32
|
+
from .core.rearranger import Rearranger, RearrangerConfig
|
|
33
|
+
from .core.extractor import Extractor, ExtractorConfig
|
|
34
|
+
from .core.communicator import Communicator, CommunicatorConfig
|
|
35
|
+
from .core.translator import Translator, TranslatorConfig
|
|
36
|
+
from .core.insight_generator import InsightGenerator, InsightConfig
|
|
37
|
+
from .core.workflow_helper import WorkflowHelper, WorkflowConfig
|
|
38
|
+
from .core.template_manager import TemplateManager, TemplateConfig
|
|
39
|
+
from .core.memory_helper import MemoryHelper, MemoryConfig
|
|
40
|
+
from .core.summarize_custom import CustomSummarizer, SummaryConfig
|
|
41
|
+
|
|
42
|
+
# Utilities
|
|
43
|
+
from .utils.logger_utils import LoggerUtils, LoggerConfig
|
|
44
|
+
|
|
45
|
+
# Integrations (with optional imports)
|
|
46
|
+
try:
|
|
47
|
+
from .integrations.langchain import (
|
|
48
|
+
get_agentium_langchain_integration,
|
|
49
|
+
AgentiumLangChainIntegration,
|
|
50
|
+
AgentiumMemory,
|
|
51
|
+
AgentiumOutputParser,
|
|
52
|
+
AgentiumCallbackHandler
|
|
53
|
+
)
|
|
54
|
+
LANGCHAIN_INTEGRATION_AVAILABLE = True
|
|
55
|
+
except Exception:
|
|
56
|
+
LANGCHAIN_INTEGRATION_AVAILABLE = False
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
from .integrations.langgraph import (
|
|
60
|
+
get_agentium_langgraph_integration,
|
|
61
|
+
AgentiumLangGraphIntegration,
|
|
62
|
+
AgentiumLangGraphBuilder,
|
|
63
|
+
AgentiumLangGraphWorkflow
|
|
64
|
+
)
|
|
65
|
+
LANGGRAPH_INTEGRATION_AVAILABLE = True
|
|
66
|
+
except Exception:
|
|
67
|
+
LANGGRAPH_INTEGRATION_AVAILABLE = False
|
|
68
|
+
|
|
69
|
+
try:
|
|
70
|
+
from .integrations.crewai import (
|
|
71
|
+
get_agentium_crewai_integration,
|
|
72
|
+
AgentiumCrewAIIntegration,
|
|
73
|
+
AgentiumCrewAIAgent,
|
|
74
|
+
AgentiumCrewAITask,
|
|
75
|
+
AgentiumCrewAICrew
|
|
76
|
+
)
|
|
77
|
+
CREWAI_INTEGRATION_AVAILABLE = True
|
|
78
|
+
except Exception:
|
|
79
|
+
CREWAI_INTEGRATION_AVAILABLE = False
|
|
80
|
+
|
|
81
|
+
# Main exports
|
|
82
|
+
__all__ = [
|
|
83
|
+
# Version and metadata
|
|
84
|
+
'__version__',
|
|
85
|
+
'__author__',
|
|
86
|
+
'__license__',
|
|
87
|
+
|
|
88
|
+
# Core components
|
|
89
|
+
'Condenser',
|
|
90
|
+
'CondenserConfig',
|
|
91
|
+
'Optimizer',
|
|
92
|
+
'OptimizerConfig',
|
|
93
|
+
'Rearranger',
|
|
94
|
+
'RearrangerConfig',
|
|
95
|
+
'Extractor',
|
|
96
|
+
'ExtractorConfig',
|
|
97
|
+
'Communicator',
|
|
98
|
+
'CommunicatorConfig',
|
|
99
|
+
'Translator',
|
|
100
|
+
'TranslatorConfig',
|
|
101
|
+
'InsightGenerator',
|
|
102
|
+
'InsightConfig',
|
|
103
|
+
'WorkflowHelper',
|
|
104
|
+
'WorkflowConfig',
|
|
105
|
+
'TemplateManager',
|
|
106
|
+
'TemplateConfig',
|
|
107
|
+
'MemoryHelper',
|
|
108
|
+
'MemoryConfig',
|
|
109
|
+
'CustomSummarizer',
|
|
110
|
+
'SummaryConfig',
|
|
111
|
+
|
|
112
|
+
# Utilities
|
|
113
|
+
'LoggerUtils',
|
|
114
|
+
'LoggerConfig',
|
|
115
|
+
|
|
116
|
+
# Integration flags
|
|
117
|
+
'LANGCHAIN_INTEGRATION_AVAILABLE',
|
|
118
|
+
'LANGGRAPH_INTEGRATION_AVAILABLE',
|
|
119
|
+
'CREWAI_INTEGRATION_AVAILABLE',
|
|
120
|
+
]
|
|
121
|
+
|
|
122
|
+
# Add integration exports if available
|
|
123
|
+
if LANGCHAIN_INTEGRATION_AVAILABLE:
|
|
124
|
+
__all__.extend([
|
|
125
|
+
'get_agentium_langchain_integration',
|
|
126
|
+
'AgentiumLangChainIntegration',
|
|
127
|
+
'AgentiumMemory',
|
|
128
|
+
'AgentiumOutputParser',
|
|
129
|
+
'AgentiumCallbackHandler'
|
|
130
|
+
])
|
|
131
|
+
|
|
132
|
+
if LANGGRAPH_INTEGRATION_AVAILABLE:
|
|
133
|
+
__all__.extend([
|
|
134
|
+
'get_agentium_langgraph_integration',
|
|
135
|
+
'AgentiumLangGraphIntegration',
|
|
136
|
+
'AgentiumLangGraphBuilder',
|
|
137
|
+
'AgentiumLangGraphWorkflow'
|
|
138
|
+
])
|
|
139
|
+
|
|
140
|
+
if CREWAI_INTEGRATION_AVAILABLE:
|
|
141
|
+
__all__.extend([
|
|
142
|
+
'get_agentium_crewai_integration',
|
|
143
|
+
'AgentiumCrewAIIntegration',
|
|
144
|
+
'AgentiumCrewAIAgent',
|
|
145
|
+
'AgentiumCrewAITask',
|
|
146
|
+
'AgentiumCrewAICrew'
|
|
147
|
+
])
|
|
148
|
+
|
|
149
|
+
from typing import Optional, Dict, Any
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class Agentium:
|
|
153
|
+
"""
|
|
154
|
+
Main Agentium class providing unified access to all components.
|
|
155
|
+
|
|
156
|
+
This class serves as a convenient entry point for accessing all
|
|
157
|
+
Agentium functionality in a single interface.
|
|
158
|
+
"""
|
|
159
|
+
|
|
160
|
+
def __init__(self, logger_config: Optional[LoggerConfig] = None):
|
|
161
|
+
"""Initialize Agentium with optional logging configuration"""
|
|
162
|
+
self.logger = LoggerUtils.get_logger(__name__)
|
|
163
|
+
|
|
164
|
+
if logger_config:
|
|
165
|
+
LoggerUtils.configure(logger_config)
|
|
166
|
+
|
|
167
|
+
# Initialize core components
|
|
168
|
+
self.condenser = Condenser()
|
|
169
|
+
self.optimizer = Optimizer()
|
|
170
|
+
self.rearranger = Rearranger()
|
|
171
|
+
self.extractor = Extractor()
|
|
172
|
+
self.communicator = Communicator()
|
|
173
|
+
self.translator = Translator()
|
|
174
|
+
self.insight_generator = InsightGenerator()
|
|
175
|
+
self.workflow_helper = WorkflowHelper()
|
|
176
|
+
self.template_manager = TemplateManager()
|
|
177
|
+
self.memory_helper = MemoryHelper()
|
|
178
|
+
self.summarizer = CustomSummarizer()
|
|
179
|
+
|
|
180
|
+
# Initialize integrations
|
|
181
|
+
self._init_integrations()
|
|
182
|
+
|
|
183
|
+
self.logger.info("Agentium initialized with all core components")
|
|
184
|
+
|
|
185
|
+
def _init_integrations(self):
|
|
186
|
+
"""Initialize framework integrations"""
|
|
187
|
+
self.langchain_integration = None
|
|
188
|
+
self.langgraph_integration = None
|
|
189
|
+
self.crewai_integration = None
|
|
190
|
+
|
|
191
|
+
if LANGCHAIN_INTEGRATION_AVAILABLE:
|
|
192
|
+
try:
|
|
193
|
+
self.langchain_integration = get_agentium_langchain_integration()
|
|
194
|
+
self.logger.info("LangChain integration initialized")
|
|
195
|
+
except Exception as e:
|
|
196
|
+
self.logger.warning(f"Failed to initialize LangChain integration: {e}")
|
|
197
|
+
|
|
198
|
+
if LANGGRAPH_INTEGRATION_AVAILABLE:
|
|
199
|
+
try:
|
|
200
|
+
self.langgraph_integration = get_agentium_langgraph_integration()
|
|
201
|
+
self.logger.info("LangGraph integration initialized")
|
|
202
|
+
except Exception as e:
|
|
203
|
+
self.logger.warning(f"Failed to initialize LangGraph integration: {e}")
|
|
204
|
+
|
|
205
|
+
if CREWAI_INTEGRATION_AVAILABLE:
|
|
206
|
+
try:
|
|
207
|
+
self.crewai_integration = get_agentium_crewai_integration()
|
|
208
|
+
self.logger.info("CrewAI integration initialized")
|
|
209
|
+
except Exception as e:
|
|
210
|
+
self.logger.warning(f"Failed to initialize CrewAI integration: {e}")
|
|
211
|
+
|
|
212
|
+
def get_integration_status(self) -> Dict[str, bool]:
|
|
213
|
+
"""Get the status of all integrations"""
|
|
214
|
+
return {
|
|
215
|
+
'langchain': LANGCHAIN_INTEGRATION_AVAILABLE and self.langchain_integration is not None,
|
|
216
|
+
'langgraph': LANGGRAPH_INTEGRATION_AVAILABLE and self.langgraph_integration is not None,
|
|
217
|
+
'crewai': CREWAI_INTEGRATION_AVAILABLE and self.crewai_integration is not None,
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
def process_content(self, content: str, workflow: str = "basic") -> Dict[str, Any]:
|
|
221
|
+
"""
|
|
222
|
+
Process content through a predefined workflow
|
|
223
|
+
|
|
224
|
+
Available workflows:
|
|
225
|
+
- basic: condense -> optimize -> summarize
|
|
226
|
+
- analysis: extract -> insights -> summarize
|
|
227
|
+
- translation: translate -> optimize -> summarize
|
|
228
|
+
"""
|
|
229
|
+
|
|
230
|
+
results = {'workflow': workflow, 'steps': []}
|
|
231
|
+
|
|
232
|
+
try:
|
|
233
|
+
if workflow == "basic":
|
|
234
|
+
# Condense -> Optimize -> Summarize
|
|
235
|
+
condensed_result = self.condenser.condense(content)
|
|
236
|
+
condensed_text = condensed_result.get('text') if isinstance(condensed_result, dict) else condensed_result
|
|
237
|
+
results['steps'].append({'step': 'condense', 'result': condensed_result})
|
|
238
|
+
|
|
239
|
+
optimized_result = self.optimizer.optimize(condensed_text)
|
|
240
|
+
optimized_text = optimized_result.get('text') if isinstance(optimized_result, dict) else optimized_result
|
|
241
|
+
results['steps'].append({'step': 'optimize', 'result': optimized_result})
|
|
242
|
+
|
|
243
|
+
summarized_result = self.summarizer.summarize(optimized_text)
|
|
244
|
+
summarized = summarized_result if isinstance(summarized_result, dict) else {'summary': summarized_result}
|
|
245
|
+
results['steps'].append({'step': 'summarize', 'result': summarized})
|
|
246
|
+
|
|
247
|
+
results['final_output'] = summarized.get('summary', str(summarized))
|
|
248
|
+
|
|
249
|
+
elif workflow == "analysis":
|
|
250
|
+
# Extract -> Insights -> Summarize
|
|
251
|
+
extracted_result = self.extractor.extract(content)
|
|
252
|
+
extracted = extracted_result if isinstance(extracted_result, dict) else {'extracted_data': extracted_result}
|
|
253
|
+
results['steps'].append({'step': 'extract', 'result': extracted})
|
|
254
|
+
|
|
255
|
+
insights_result = self.insight_generator.generate_insights(str(extracted['extracted_data']))
|
|
256
|
+
insights = insights_result if isinstance(insights_result, dict) else {'insights': insights_result}
|
|
257
|
+
results['steps'].append({'step': 'insights', 'result': insights})
|
|
258
|
+
|
|
259
|
+
data_str = str(extracted['extracted_data'])
|
|
260
|
+
insights_str = str(insights.get('insights', insights))
|
|
261
|
+
summarized_result = self.summarizer.summarize(f"Data: {data_str} Insights: {insights_str}")
|
|
262
|
+
summarized = summarized_result if isinstance(summarized_result, dict) else {'summary': summarized_result}
|
|
263
|
+
results['steps'].append({'step': 'summarize', 'result': summarized})
|
|
264
|
+
|
|
265
|
+
results['final_output'] = summarized.get('summary', str(summarized))
|
|
266
|
+
|
|
267
|
+
elif workflow == "translation":
|
|
268
|
+
# Translate -> Optimize -> Summarize
|
|
269
|
+
translated_result = self.translator.translate(content)
|
|
270
|
+
translated = translated_result if isinstance(translated_result, dict) else {'translated_text': translated_result}
|
|
271
|
+
results['steps'].append({'step': 'translate', 'result': translated})
|
|
272
|
+
|
|
273
|
+
optimized_result = self.optimizer.optimize(translated['translated_text'])
|
|
274
|
+
optimized = optimized_result if isinstance(optimized_result, dict) else {'optimized_content': optimized_result}
|
|
275
|
+
results['steps'].append({'step': 'optimize', 'result': optimized})
|
|
276
|
+
|
|
277
|
+
summarized_result = self.summarizer.summarize(optimized['optimized_content'])
|
|
278
|
+
summarized = summarized_result if isinstance(summarized_result, dict) else {'summary': summarized_result}
|
|
279
|
+
results['steps'].append({'step': 'summarize', 'result': summarized})
|
|
280
|
+
|
|
281
|
+
results['final_output'] = summarized.get('summary', str(summarized))
|
|
282
|
+
|
|
283
|
+
else:
|
|
284
|
+
raise ValueError(f"Unknown workflow: {workflow}")
|
|
285
|
+
|
|
286
|
+
results['success'] = True
|
|
287
|
+
|
|
288
|
+
except Exception as e:
|
|
289
|
+
results['success'] = False
|
|
290
|
+
results['error'] = str(e)
|
|
291
|
+
self.logger.error(f"Workflow {workflow} failed: {e}")
|
|
292
|
+
|
|
293
|
+
return results
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
# Add to main exports
|
|
297
|
+
__all__.extend(['Agentium'])
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Core package initialization
|