pygeai-orchestration 0.1.0b5__py3-none-any.whl → 0.1.0b6__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.
- pygeai_orchestration/__init__.py +4 -5
- pygeai_orchestration/core/__init__.py +0 -4
- pygeai_orchestration/core/base/__init__.py +6 -6
- pygeai_orchestration/core/base/geai_agent.py +34 -57
- pygeai_orchestration/core/base/geai_orchestrator.py +6 -28
- pygeai_orchestration/core/base/orchestrator.py +2 -2
- pygeai_orchestration/core/utils/__init__.py +4 -7
- pygeai_orchestration/patterns/multi_agent.py +4 -4
- pygeai_orchestration/patterns/planning.py +4 -4
- pygeai_orchestration/patterns/react.py +4 -4
- pygeai_orchestration/patterns/reflection.py +4 -4
- pygeai_orchestration/patterns/tool_use.py +4 -4
- {pygeai_orchestration-0.1.0b5.dist-info → pygeai_orchestration-0.1.0b6.dist-info}/METADATA +29 -10
- {pygeai_orchestration-0.1.0b5.dist-info → pygeai_orchestration-0.1.0b6.dist-info}/RECORD +18 -19
- pygeai_orchestration/core/utils/logging.py +0 -57
- {pygeai_orchestration-0.1.0b5.dist-info → pygeai_orchestration-0.1.0b6.dist-info}/WHEEL +0 -0
- {pygeai_orchestration-0.1.0b5.dist-info → pygeai_orchestration-0.1.0b6.dist-info}/entry_points.txt +0 -0
- {pygeai_orchestration-0.1.0b5.dist-info → pygeai_orchestration-0.1.0b6.dist-info}/licenses/LICENSE +0 -0
- {pygeai_orchestration-0.1.0b5.dist-info → pygeai_orchestration-0.1.0b6.dist-info}/top_level.txt +0 -0
pygeai_orchestration/__init__.py
CHANGED
|
@@ -3,10 +3,10 @@ import logging
|
|
|
3
3
|
__author__ = "Globant"
|
|
4
4
|
__version__ = "0.1.0b1"
|
|
5
5
|
|
|
6
|
-
logger = logging.getLogger("
|
|
6
|
+
logger = logging.getLogger("pygeai_orchestration")
|
|
7
7
|
logger.addHandler(logging.NullHandler())
|
|
8
8
|
|
|
9
|
-
from .core import (
|
|
9
|
+
from pygeai_orchestration.core import (
|
|
10
10
|
BaseAgent,
|
|
11
11
|
AgentConfig,
|
|
12
12
|
BaseOrchestrator,
|
|
@@ -32,7 +32,6 @@ from .core import (
|
|
|
32
32
|
Memory,
|
|
33
33
|
MemoryEntry,
|
|
34
34
|
MemoryStore,
|
|
35
|
-
get_logger,
|
|
36
35
|
get_config,
|
|
37
36
|
OrchestrationError,
|
|
38
37
|
PatternExecutionError,
|
|
@@ -43,7 +42,7 @@ from .core import (
|
|
|
43
42
|
ValidationError,
|
|
44
43
|
)
|
|
45
44
|
|
|
46
|
-
from .patterns import (
|
|
45
|
+
from pygeai_orchestration.patterns import (
|
|
47
46
|
ReflectionPattern,
|
|
48
47
|
ToolUsePattern,
|
|
49
48
|
ReActPattern,
|
|
@@ -55,6 +54,7 @@ from .patterns import (
|
|
|
55
54
|
|
|
56
55
|
__all__ = [
|
|
57
56
|
"__version__",
|
|
57
|
+
"logger",
|
|
58
58
|
"BaseAgent",
|
|
59
59
|
"AgentConfig",
|
|
60
60
|
"BaseOrchestrator",
|
|
@@ -80,7 +80,6 @@ __all__ = [
|
|
|
80
80
|
"Memory",
|
|
81
81
|
"MemoryEntry",
|
|
82
82
|
"MemoryStore",
|
|
83
|
-
"get_logger",
|
|
84
83
|
"get_config",
|
|
85
84
|
"OrchestrationError",
|
|
86
85
|
"PatternExecutionError",
|
|
@@ -30,8 +30,6 @@ from .common import (
|
|
|
30
30
|
)
|
|
31
31
|
|
|
32
32
|
from .utils import (
|
|
33
|
-
OrchestrationLogger,
|
|
34
|
-
get_logger,
|
|
35
33
|
ConfigManager,
|
|
36
34
|
get_config,
|
|
37
35
|
ValidationResult,
|
|
@@ -97,8 +95,6 @@ __all__ = [
|
|
|
97
95
|
"Memory",
|
|
98
96
|
"MemoryEntry",
|
|
99
97
|
"MemoryStore",
|
|
100
|
-
"OrchestrationLogger",
|
|
101
|
-
"get_logger",
|
|
102
98
|
"ConfigManager",
|
|
103
99
|
"get_config",
|
|
104
100
|
"ValidationResult",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
from .agent import BaseAgent, AgentConfig
|
|
2
|
-
from .orchestrator import BaseOrchestrator, OrchestratorConfig
|
|
3
|
-
from .pattern import BasePattern, PatternConfig, PatternResult, PatternType
|
|
4
|
-
from .tool import BaseTool, ToolConfig, ToolResult, ToolCategory
|
|
5
|
-
from .geai_agent import GEAIAgent
|
|
6
|
-
from .geai_orchestrator import GEAIOrchestrator
|
|
1
|
+
from pygeai_orchestration.core.base.agent import BaseAgent, AgentConfig
|
|
2
|
+
from pygeai_orchestration.core.base.orchestrator import BaseOrchestrator, OrchestratorConfig
|
|
3
|
+
from pygeai_orchestration.core.base.pattern import BasePattern, PatternConfig, PatternResult, PatternType
|
|
4
|
+
from pygeai_orchestration.core.base.tool import BaseTool, ToolConfig, ToolResult, ToolCategory
|
|
5
|
+
from pygeai_orchestration.core.base.geai_agent import GEAIAgent
|
|
6
|
+
from pygeai_orchestration.core.base.geai_orchestrator import GEAIOrchestrator
|
|
7
7
|
|
|
8
8
|
__all__ = [
|
|
9
9
|
"BaseAgent",
|
|
@@ -5,19 +5,16 @@ This module provides a concrete agent implementation using the PyGEAI SDK,
|
|
|
5
5
|
enabling AI-powered task execution with GeneXus Enterprise AI.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
import logging
|
|
8
9
|
from typing import Any, Dict, Optional
|
|
9
|
-
from .agent import BaseAgent, AgentConfig
|
|
10
|
-
from ..utils import get_logger
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
from pygeai_orchestration.core.base.agent import BaseAgent, AgentConfig
|
|
12
|
+
from pygeai.core.base.session import Session
|
|
13
|
+
from pygeai.chat.managers import ChatManager
|
|
14
|
+
from pygeai.core.models import LlmSettings, ChatMessageList, ChatMessage
|
|
15
|
+
from pygeai.core.common.config import get_settings
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
from pygeai import Session
|
|
16
|
-
|
|
17
|
-
PYGEAI_AVAILABLE = True
|
|
18
|
-
except ImportError:
|
|
19
|
-
PYGEAI_AVAILABLE = False
|
|
20
|
-
logger.warning("PyGEAI not available. GEAIAgent will have limited functionality.")
|
|
17
|
+
logger = logging.getLogger("pygeai_orchestration")
|
|
21
18
|
|
|
22
19
|
|
|
23
20
|
class GEAIAgent(BaseAgent):
|
|
@@ -28,10 +25,10 @@ class GEAIAgent(BaseAgent):
|
|
|
28
25
|
Enterprise AI models, providing AI-powered reasoning and generation.
|
|
29
26
|
|
|
30
27
|
The agent:
|
|
31
|
-
- Integrates with PyGEAI Session and
|
|
28
|
+
- Integrates with PyGEAI Session and ChatManager
|
|
32
29
|
- Supports custom system prompts and model configuration
|
|
33
|
-
- Automatically manages agent resource creation
|
|
34
30
|
- Maintains execution history
|
|
31
|
+
- Automatically loads credentials from ~/.geai/credentials
|
|
35
32
|
"""
|
|
36
33
|
|
|
37
34
|
def __init__(self, config: AgentConfig, session=None, alias: Optional[str] = None):
|
|
@@ -40,14 +37,20 @@ class GEAIAgent(BaseAgent):
|
|
|
40
37
|
|
|
41
38
|
:param config: AgentConfig - Agent configuration.
|
|
42
39
|
:param session: Optional PyGEAI Session - Existing session to use.
|
|
43
|
-
:param alias: Optional[str] -
|
|
44
|
-
:raises ImportError: If PyGEAI is not installed.
|
|
40
|
+
:param alias: Optional[str] - Credentials alias (default: 'default').
|
|
45
41
|
"""
|
|
46
42
|
super().__init__(config)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
|
|
44
|
+
if session:
|
|
45
|
+
self._session = session
|
|
46
|
+
else:
|
|
47
|
+
alias = alias or 'default'
|
|
48
|
+
settings = get_settings()
|
|
49
|
+
api_key = settings.get_api_key(alias)
|
|
50
|
+
base_url = settings.get_base_url(alias)
|
|
51
|
+
self._session = Session(api_key=api_key, base_url=base_url)
|
|
52
|
+
|
|
53
|
+
self._chat_manager = ChatManager(self._session)
|
|
51
54
|
|
|
52
55
|
async def execute(self, task: str, context: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
|
|
53
56
|
"""
|
|
@@ -88,8 +91,6 @@ class GEAIAgent(BaseAgent):
|
|
|
88
91
|
:raises Exception: If generation fails.
|
|
89
92
|
"""
|
|
90
93
|
try:
|
|
91
|
-
self._get_or_create_agent()
|
|
92
|
-
|
|
93
94
|
messages = kwargs.get("messages", [])
|
|
94
95
|
if not messages:
|
|
95
96
|
messages = [{"role": "user", "content": prompt}]
|
|
@@ -97,48 +98,24 @@ class GEAIAgent(BaseAgent):
|
|
|
97
98
|
if self.config.system_prompt:
|
|
98
99
|
messages.insert(0, {"role": "system", "content": self.config.system_prompt})
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
messages=messages
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
chat_messages = ChatMessageList(
|
|
102
|
+
messages=[ChatMessage(role=msg["role"], content=msg["content"]) for msg in messages]
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
llm_settings = LlmSettings(
|
|
106
|
+
temperature=self.config.temperature, max_tokens=self.config.max_tokens
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
response = self._chat_manager.chat_completion(
|
|
110
|
+
model=self.config.model, messages=chat_messages, llm_settings=llm_settings
|
|
105
111
|
)
|
|
106
112
|
|
|
107
|
-
|
|
113
|
+
response_text = response.choices[0].message.content
|
|
108
114
|
|
|
109
|
-
self.add_to_history({"type": "generation", "prompt": prompt, "response":
|
|
115
|
+
self.add_to_history({"type": "generation", "prompt": prompt, "response": response_text})
|
|
110
116
|
|
|
111
|
-
return
|
|
117
|
+
return response_text
|
|
112
118
|
|
|
113
119
|
except Exception as e:
|
|
114
120
|
logger.error(f"Generation failed: {str(e)}")
|
|
115
121
|
raise
|
|
116
|
-
|
|
117
|
-
def _get_or_create_agent(self):
|
|
118
|
-
"""
|
|
119
|
-
Get or create PyGEAI agent resource.
|
|
120
|
-
|
|
121
|
-
Lazily creates an agent resource in PyGEAI if not already created,
|
|
122
|
-
or reuses existing agent with matching name.
|
|
123
|
-
|
|
124
|
-
:return: PyGEAI Agent resource.
|
|
125
|
-
"""
|
|
126
|
-
if self._agent_resource is None:
|
|
127
|
-
try:
|
|
128
|
-
agents = self._session.agents.list()
|
|
129
|
-
for agent in agents.data:
|
|
130
|
-
if agent.name == self.name:
|
|
131
|
-
self._agent_resource = agent
|
|
132
|
-
break
|
|
133
|
-
|
|
134
|
-
if self._agent_resource is None:
|
|
135
|
-
logger.debug(f"Creating new agent resource: {self.name}")
|
|
136
|
-
self._agent_resource = self._session.agents.create(
|
|
137
|
-
name=self.name,
|
|
138
|
-
model=self.config.model,
|
|
139
|
-
description=self.config.description or f"Orchestration agent: {self.name}",
|
|
140
|
-
)
|
|
141
|
-
except Exception as e:
|
|
142
|
-
logger.warning(f"Could not create agent resource: {str(e)}")
|
|
143
|
-
|
|
144
|
-
return self._agent_resource
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
from typing import Any, Dict, List, Optional
|
|
2
|
-
from .orchestrator import BaseOrchestrator, OrchestratorConfig
|
|
3
|
-
from .pattern import PatternResult
|
|
4
|
-
from ..utils import get_logger
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
from pygeai_orchestration.core.base.orchestrator import BaseOrchestrator, OrchestratorConfig
|
|
5
|
+
from pygeai_orchestration.core.base.pattern import PatternResult
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger("pygeai_orchestration")
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class GEAIOrchestrator(BaseOrchestrator):
|
|
@@ -48,30 +49,7 @@ class GEAIOrchestrator(BaseOrchestrator):
|
|
|
48
49
|
|
|
49
50
|
async def coordinate_agents(self, agents: List[str], task: str) -> Dict[str, Any]:
|
|
50
51
|
logger.info(f"Coordinating {len(agents)} agents for task: {task[:50]}...")
|
|
51
|
-
|
|
52
|
-
results = {}
|
|
53
|
-
|
|
54
|
-
for agent_name in agents:
|
|
55
|
-
agent = self.get_agent(agent_name)
|
|
56
|
-
if agent is None:
|
|
57
|
-
logger.warning(f"Agent '{agent_name}' not found, skipping")
|
|
58
|
-
continue
|
|
59
|
-
|
|
60
|
-
try:
|
|
61
|
-
result = await agent.execute(task)
|
|
62
|
-
results[agent_name] = result
|
|
63
|
-
except Exception as e:
|
|
64
|
-
logger.error(f"Agent '{agent_name}' failed: {str(e)}")
|
|
65
|
-
results[agent_name] = {"success": False, "error": str(e)}
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
"success": len(results) > 0,
|
|
69
|
-
"results": results,
|
|
70
|
-
"agents_executed": list(results.keys()),
|
|
71
|
-
}
|
|
52
|
+
return {"status": "not_implemented", "agents": agents, "task": task}
|
|
72
53
|
|
|
73
54
|
def get_execution_history(self) -> List[Dict[str, Any]]:
|
|
74
55
|
return self._execution_history.copy()
|
|
75
|
-
|
|
76
|
-
def clear_history(self) -> None:
|
|
77
|
-
self._execution_history.clear()
|
|
@@ -9,8 +9,8 @@ from abc import ABC, abstractmethod
|
|
|
9
9
|
from typing import Any, Dict, List, Optional
|
|
10
10
|
from pydantic import BaseModel, Field
|
|
11
11
|
|
|
12
|
-
from .agent import BaseAgent
|
|
13
|
-
from .pattern import BasePattern, PatternResult
|
|
12
|
+
from pygeai_orchestration.core.base.agent import BaseAgent
|
|
13
|
+
from pygeai_orchestration.core.base.pattern import BasePattern, PatternResult
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class OrchestratorConfig(BaseModel):
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
from .
|
|
2
|
-
from .
|
|
3
|
-
from .validators import (
|
|
1
|
+
from pygeai_orchestration.core.utils.config import ConfigManager, get_config
|
|
2
|
+
from pygeai_orchestration.core.utils.validators import (
|
|
4
3
|
ValidationResult,
|
|
5
4
|
validate_agent_config,
|
|
6
5
|
validate_pattern_config,
|
|
7
6
|
validate_tool_config,
|
|
8
7
|
validate_pydantic_model,
|
|
9
8
|
)
|
|
10
|
-
from .cache import CacheEntry, LRUCache, PatternCache
|
|
11
|
-
from .metrics import (
|
|
9
|
+
from pygeai_orchestration.core.utils.cache import CacheEntry, LRUCache, PatternCache
|
|
10
|
+
from pygeai_orchestration.core.utils.metrics import (
|
|
12
11
|
Metric,
|
|
13
12
|
MetricType,
|
|
14
13
|
MetricsCollector,
|
|
@@ -17,8 +16,6 @@ from .metrics import (
|
|
|
17
16
|
)
|
|
18
17
|
|
|
19
18
|
__all__ = [
|
|
20
|
-
"OrchestrationLogger",
|
|
21
|
-
"get_logger",
|
|
22
19
|
"ConfigManager",
|
|
23
20
|
"get_config",
|
|
24
21
|
"ValidationResult",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Optional
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
2
|
+
from pygeai_orchestration.core.base import BasePattern, PatternConfig, PatternResult, PatternType
|
|
3
|
+
from pygeai_orchestration.core.common import Message, MessageRole, Conversation, State, StateStatus
|
|
4
|
+
import logging
|
|
5
5
|
|
|
6
|
-
logger =
|
|
6
|
+
logger = logging.getLogger("pygeai_orchestration")
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class AgentRole:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Optional
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
2
|
+
from pygeai_orchestration.core.base import BasePattern, PatternConfig, PatternResult, PatternType
|
|
3
|
+
from pygeai_orchestration.core.common import Message, MessageRole, Conversation, State, StateStatus
|
|
4
|
+
import logging
|
|
5
5
|
|
|
6
|
-
logger =
|
|
6
|
+
logger = logging.getLogger("pygeai_orchestration")
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class PlanStep:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Optional
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
2
|
+
from pygeai_orchestration.core.base import BasePattern, BaseTool, PatternConfig, PatternResult, PatternType
|
|
3
|
+
from pygeai_orchestration.core.common import Message, MessageRole, Conversation, State, StateStatus
|
|
4
|
+
import logging
|
|
5
5
|
|
|
6
|
-
logger =
|
|
6
|
+
logger = logging.getLogger("pygeai_orchestration")
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class ReActPattern(BasePattern):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import Any, Dict, Optional
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
2
|
+
from pygeai_orchestration.core.base import BasePattern, PatternConfig, PatternResult, PatternType
|
|
3
|
+
from pygeai_orchestration.core.common import Message, MessageRole, Conversation, State, StateStatus
|
|
4
|
+
import logging
|
|
5
5
|
|
|
6
|
-
logger =
|
|
6
|
+
logger = logging.getLogger("pygeai_orchestration")
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class ReflectionPattern(BasePattern):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Optional
|
|
2
|
-
from
|
|
3
|
-
from
|
|
4
|
-
|
|
2
|
+
from pygeai_orchestration.core.base import BasePattern, BaseTool, PatternConfig, PatternResult, PatternType
|
|
3
|
+
from pygeai_orchestration.core.common import Message, MessageRole, Conversation, State, StateStatus
|
|
4
|
+
import logging
|
|
5
5
|
|
|
6
|
-
logger =
|
|
6
|
+
logger = logging.getLogger("pygeai_orchestration")
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class ToolUsePattern(BasePattern):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pygeai-orchestration
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0b6
|
|
4
4
|
Summary: Agentic AI orchestration patterns built on Globant Enterprise AI
|
|
5
5
|
Author-email: Globant <geai-sdk@globant.com>
|
|
6
6
|
Keywords: geai,pygeai,orchestration,agents,ai,multi-agent,autogen,crewai
|
|
@@ -217,14 +217,13 @@ result = coordinator.execute("Create research report")
|
|
|
217
217
|
- [Getting Started Guide](docs/getting-started.md)
|
|
218
218
|
- [Pattern Documentation](docs/patterns/)
|
|
219
219
|
- [API Reference](docs/api-reference/)
|
|
220
|
-
- [
|
|
220
|
+
- [Code Snippets](snippets/)
|
|
221
221
|
|
|
222
222
|
## Development
|
|
223
223
|
|
|
224
224
|
### Setup Development Environment
|
|
225
225
|
|
|
226
226
|
```bash
|
|
227
|
-
git clone https://docs.globant.ai/en/wiki?1149,Getting+started+with+PyGEAI-orchestration.git
|
|
228
227
|
cd pygeai-orchestration
|
|
229
228
|
python -m venv venv
|
|
230
229
|
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
@@ -247,15 +246,35 @@ python testing.py --coverage
|
|
|
247
246
|
|
|
248
247
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development guidelines.
|
|
249
248
|
|
|
250
|
-
##
|
|
249
|
+
## Code Snippets
|
|
251
250
|
|
|
252
|
-
Check the [snippets/](snippets/) directory for working examples
|
|
251
|
+
Check the [snippets/](snippets/) directory for working code examples:
|
|
253
252
|
|
|
254
|
-
|
|
255
|
-
- [
|
|
256
|
-
- [
|
|
257
|
-
|
|
258
|
-
|
|
253
|
+
### Reflection Pattern
|
|
254
|
+
- [reflection_explanation.py](snippets/reflection_explanation.py) - Iterative explanation improvement
|
|
255
|
+
- [reflection_code_review.py](snippets/reflection_code_review.py) - Code review with self-critique
|
|
256
|
+
|
|
257
|
+
### ReAct Pattern
|
|
258
|
+
- [react_research.py](snippets/react_research.py) - Structured research tasks
|
|
259
|
+
- [react_problem_solving.py](snippets/react_problem_solving.py) - Step-by-step problem solving
|
|
260
|
+
|
|
261
|
+
### Planning Pattern
|
|
262
|
+
- [planning_project.py](snippets/planning_project.py) - Project planning and breakdown
|
|
263
|
+
- [planning_analysis.py](snippets/planning_analysis.py) - Data analysis planning
|
|
264
|
+
|
|
265
|
+
### Tool Use Pattern
|
|
266
|
+
- [tool_use_calculator.py](snippets/tool_use_calculator.py) - Mathematical operations with tools
|
|
267
|
+
- [tool_use_data_processing.py](snippets/tool_use_data_processing.py) - Data validation and transformation
|
|
268
|
+
|
|
269
|
+
### Multi-Agent Pattern
|
|
270
|
+
- [multi_agent_collaboration.py](snippets/multi_agent_collaboration.py) - Collaborative multi-agent workflow
|
|
271
|
+
|
|
272
|
+
Run any snippet:
|
|
273
|
+
```bash
|
|
274
|
+
python snippets/reflection_explanation.py
|
|
275
|
+
python snippets/react_research.py
|
|
276
|
+
python snippets/planning_project.py
|
|
277
|
+
```
|
|
259
278
|
|
|
260
279
|
## Contributing
|
|
261
280
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pygeai_orchestration/__init__.py,sha256=
|
|
1
|
+
pygeai_orchestration/__init__.py,sha256=ZSKEjVRjkUzQtanmdtpFuXimNXShI-eqli8Lq52Cq8M,1840
|
|
2
2
|
pygeai_orchestration/cli/__init__.py,sha256=d6wFWuMlcMLng3lBfjSOfhnO_tZINHfNUOmA7-zwPX4,134
|
|
3
3
|
pygeai_orchestration/cli/__main__.py,sha256=2AmJiRvdlVSu3T6FmFAzQuu4a5llrUeMfUX8ShQxhus,157
|
|
4
4
|
pygeai_orchestration/cli/error_handler.py,sha256=ReeeeX2TvJZBgdCc0hzvLZd8LYSQVqYI5hAEqJ4FCCM,3862
|
|
@@ -8,16 +8,16 @@ pygeai_orchestration/cli/interactive.py,sha256=KVZzgjMS89dDQM25XohcFb3dTbjpMsWV_
|
|
|
8
8
|
pygeai_orchestration/cli/commands/__init__.py,sha256=PLWgWUXomwNCqR-wrl_-fWOYFN8PeIAvPnYvmzvzg0w,232
|
|
9
9
|
pygeai_orchestration/cli/commands/base.py,sha256=BWjuxk06KkRVozCMbwjD_pkzrsAHWE9TgVKQegkIHoM,6558
|
|
10
10
|
pygeai_orchestration/cli/texts/help.py,sha256=vHAA-2SSrSYpQLfLp3Ruz0-WEVb8UmCahgDkOZEcGGI,5423
|
|
11
|
-
pygeai_orchestration/core/__init__.py,sha256=
|
|
11
|
+
pygeai_orchestration/core/__init__.py,sha256=33I1phMJ3skCMBAsOHVKd3pQ8cBzCjaPR95DWxs8RRE,2294
|
|
12
12
|
pygeai_orchestration/core/composition.py,sha256=j_mV0iNJfPkCO8h1rrzKY0eL00g77C8D_Hy6qPnDaMw,6654
|
|
13
13
|
pygeai_orchestration/core/config.py,sha256=m2dbBejao9ku0od4jYo4Xn-HmDvq_d44EYJkZKGgd4I,11493
|
|
14
14
|
pygeai_orchestration/core/exceptions.py,sha256=nZWQlPFQtyGmx-qtErydXvIfiqkXuBlsxoofDyDoRLQ,13282
|
|
15
15
|
pygeai_orchestration/core/handlers.py,sha256=6OMo3xZvHwITdn8J4kX7Wi65iWGRwnL0ioHLNmFWwBQ,13474
|
|
16
|
-
pygeai_orchestration/core/base/__init__.py,sha256=
|
|
16
|
+
pygeai_orchestration/core/base/__init__.py,sha256=8w_BBaGo3x4_5xO_3H3DtfjF1i1AZYQ98ynfdtoZXNg,802
|
|
17
17
|
pygeai_orchestration/core/base/agent.py,sha256=J_xRVE1MXPbXWC1ndwMHMVWY44S0myIzNfVPJzoE7Lo,4446
|
|
18
|
-
pygeai_orchestration/core/base/geai_agent.py,sha256=
|
|
19
|
-
pygeai_orchestration/core/base/geai_orchestrator.py,sha256=
|
|
20
|
-
pygeai_orchestration/core/base/orchestrator.py,sha256=
|
|
18
|
+
pygeai_orchestration/core/base/geai_agent.py,sha256=ZS_flu4CQK2orxvctGW-GWKFiUqwchWIAOwVkjgDDpU,4371
|
|
19
|
+
pygeai_orchestration/core/base/geai_orchestrator.py,sha256=QGkH1ovkpyrFPCIq_61E_-d-jSRGmiQ4dK0q02iVSkY,2120
|
|
20
|
+
pygeai_orchestration/core/base/orchestrator.py,sha256=ZA5pvtbLqsK5yfTYCLLoEUmtoTgc8ceiHqXkhxqVmyc,4895
|
|
21
21
|
pygeai_orchestration/core/base/pattern.py,sha256=vuj1UXLuaZvbhjiifwqThnQ_4uaRBkv2VQ5FBrY8Xxs,6114
|
|
22
22
|
pygeai_orchestration/core/base/tool.py,sha256=sypjwrMKiiuwi6VmbXIVoIOkQ4RZWpZD0aSlOCKYOSs,5491
|
|
23
23
|
pygeai_orchestration/core/common/__init__.py,sha256=akhDVqt8uFH0u2k4w_STrKZJ3ndjtpRDkp46baxCn6U,416
|
|
@@ -25,10 +25,9 @@ pygeai_orchestration/core/common/context.py,sha256=mMch8-9mLReYglBMbIB2RCDYn7EGj
|
|
|
25
25
|
pygeai_orchestration/core/common/memory.py,sha256=1jYrqc1sPJujuIcNQLITXbKnQ_WMGjkvcNTMDkoQU9o,5841
|
|
26
26
|
pygeai_orchestration/core/common/message.py,sha256=4JB3ZPeegaRvEYf1MKy7NBHm76oCBYf8V6cuNIf9kzw,1732
|
|
27
27
|
pygeai_orchestration/core/common/state.py,sha256=mHo7ozjvPdHZfd-sbVg6t9HLND7ll1xD6sm6v8nCrb4,5690
|
|
28
|
-
pygeai_orchestration/core/utils/__init__.py,sha256
|
|
28
|
+
pygeai_orchestration/core/utils/__init__.py,sha256=X_CJGxoZM4ptt5aRS4SJr74r8TfHTLfpONkVNEb5DkI,845
|
|
29
29
|
pygeai_orchestration/core/utils/cache.py,sha256=TJLtj115EXqlLrKLMoK7JCT-fZ1TGSjVxmJyW6n2p8c,4108
|
|
30
30
|
pygeai_orchestration/core/utils/config.py,sha256=S2gzAsL20-h_AEFDj0izjlXhWucBLwbE7Vv4ovUiJIM,2775
|
|
31
|
-
pygeai_orchestration/core/utils/logging.py,sha256=BPi0s9dU4i6e4E2HZU1omqI79JhaJ9js533RG_BFAtE,1812
|
|
32
31
|
pygeai_orchestration/core/utils/metrics.py,sha256=Kw8hA-PS6UHMLf0pEG2XQZvcBbuIFhHdo1kWEMf6Vz8,6359
|
|
33
32
|
pygeai_orchestration/core/utils/validators.py,sha256=EoVQSrJDmM8dGlqAoM_1q3B7SBAyI3yuLfcj3weZuio,5146
|
|
34
33
|
pygeai_orchestration/dev/__init__.py,sha256=e-GSMmpkN1cINRDtInrjKTQogSJ2h-Q1ya_YaaMRF5s,476
|
|
@@ -36,11 +35,11 @@ pygeai_orchestration/dev/debug.py,sha256=0RJed1TCreaSm7HC9ijbd9EeMoh3zFn4osjrYDc
|
|
|
36
35
|
pygeai_orchestration/dev/templates.py,sha256=J57-8Stg_m-f-cj_Zl9Yz_VNEZA-trGM8SKdsdzH7NQ,8143
|
|
37
36
|
pygeai_orchestration/dev/testing.py,sha256=_zXvj3JHJNFEbZJnK-OdtL_tD-3xQeCHMrJ39UYqaqg,7826
|
|
38
37
|
pygeai_orchestration/patterns/__init__.py,sha256=W5qROE1pbeVOgPx6xiKZtQp0eQPL9kEhL6Et3t6kBA8,376
|
|
39
|
-
pygeai_orchestration/patterns/multi_agent.py,sha256=
|
|
40
|
-
pygeai_orchestration/patterns/planning.py,sha256=
|
|
41
|
-
pygeai_orchestration/patterns/react.py,sha256=
|
|
42
|
-
pygeai_orchestration/patterns/reflection.py,sha256=
|
|
43
|
-
pygeai_orchestration/patterns/tool_use.py,sha256=
|
|
38
|
+
pygeai_orchestration/patterns/multi_agent.py,sha256=Rn1HJUeNRav--zsn075IC9tka6oYbn7lC1-583__Eiw,9903
|
|
39
|
+
pygeai_orchestration/patterns/planning.py,sha256=rBDiX_DH5hE1HgOJt4MF6WOtOksoXH6JkbfaIFaYH8A,8931
|
|
40
|
+
pygeai_orchestration/patterns/react.py,sha256=hNKh9EgdfUGLsO7sUi3AK8lq2EJL9QrhYXF-xsxqyto,9366
|
|
41
|
+
pygeai_orchestration/patterns/reflection.py,sha256=MsjYlA4xHoZbs6wpI84ov_l-miXhHvO2W3Hy-CJcx4E,5774
|
|
42
|
+
pygeai_orchestration/patterns/tool_use.py,sha256=ET0Sa8R-a2RcHzRY60voSf1TRVt9geiVzihCKtCFh1o,7640
|
|
44
43
|
pygeai_orchestration/tests/__init__.py,sha256=nzx1KsiYalL_YuXKE6acW8Dj5flmMg0-i4gyYO0gV54,22
|
|
45
44
|
pygeai_orchestration/tests/test_base_classes.py,sha256=9VcME1C1fY1cijblzh639ZQhV6-iWGuEx80kDRpDr6k,5673
|
|
46
45
|
pygeai_orchestration/tests/test_cache.py,sha256=t_iYB_La1mkKBEnFinl10kNa1IVtW_yWjKq0dz8-Z4w,5705
|
|
@@ -53,9 +52,9 @@ pygeai_orchestration/tests/test_exceptions.py,sha256=l_YlVxZguM-xcUNlOl8u9R3vx_O
|
|
|
53
52
|
pygeai_orchestration/tests/test_handlers.py,sha256=t3ZCbif4npxsgoYM6vpCrxOru0q-7f0ARjYAE1SuK7Y,12166
|
|
54
53
|
pygeai_orchestration/tests/test_metrics.py,sha256=GP36BuTxp7ydptG4nGo804yB91UkBHuskEfJuZwkZvE,6078
|
|
55
54
|
pygeai_orchestration/tests/test_patterns.py,sha256=9qarHU_9R70nfWf98TzMiJO_XCfz9-kOn9Ju2RQnogs,5051
|
|
56
|
-
pygeai_orchestration-0.1.
|
|
57
|
-
pygeai_orchestration-0.1.
|
|
58
|
-
pygeai_orchestration-0.1.
|
|
59
|
-
pygeai_orchestration-0.1.
|
|
60
|
-
pygeai_orchestration-0.1.
|
|
61
|
-
pygeai_orchestration-0.1.
|
|
55
|
+
pygeai_orchestration-0.1.0b6.dist-info/licenses/LICENSE,sha256=HrOw5fbeVfHobmqgadP4r7dOPCMDA4uOfFX8pE3MDT0,1072
|
|
56
|
+
pygeai_orchestration-0.1.0b6.dist-info/METADATA,sha256=0UdW9rqJCU4trSNH_u5G5yhiai7yIFPdPQDA4vbaRrs,8977
|
|
57
|
+
pygeai_orchestration-0.1.0b6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
58
|
+
pygeai_orchestration-0.1.0b6.dist-info/entry_points.txt,sha256=p8ODRFqLwrrhoS6FlQW330_J59-0ZjSd6x8kAYYLm7E,69
|
|
59
|
+
pygeai_orchestration-0.1.0b6.dist-info/top_level.txt,sha256=8gLeyR8RXLump7AkakhU7kFBh6O7XTvrJi1bKK4e39g,21
|
|
60
|
+
pygeai_orchestration-0.1.0b6.dist-info/RECORD,,
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
import sys
|
|
3
|
-
from typing import Optional
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class OrchestrationLogger:
|
|
7
|
-
_instance: Optional["OrchestrationLogger"] = None
|
|
8
|
-
|
|
9
|
-
def __new__(cls):
|
|
10
|
-
if cls._instance is None:
|
|
11
|
-
cls._instance = super().__new__(cls)
|
|
12
|
-
return cls._instance
|
|
13
|
-
|
|
14
|
-
def __init__(self):
|
|
15
|
-
if not hasattr(self, "_initialized"):
|
|
16
|
-
self._logger = logging.getLogger("pygeai_orchestration")
|
|
17
|
-
self._logger.setLevel(logging.INFO)
|
|
18
|
-
|
|
19
|
-
if not self._logger.handlers:
|
|
20
|
-
handler = logging.StreamHandler(sys.stdout)
|
|
21
|
-
formatter = logging.Formatter(
|
|
22
|
-
"%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
23
|
-
datefmt="%Y-%m-%d %H:%M:%S",
|
|
24
|
-
)
|
|
25
|
-
handler.setFormatter(formatter)
|
|
26
|
-
self._logger.addHandler(handler)
|
|
27
|
-
|
|
28
|
-
self._initialized = True
|
|
29
|
-
|
|
30
|
-
def set_level(self, level: str) -> None:
|
|
31
|
-
level_map = {
|
|
32
|
-
"debug": logging.DEBUG,
|
|
33
|
-
"info": logging.INFO,
|
|
34
|
-
"warning": logging.WARNING,
|
|
35
|
-
"error": logging.ERROR,
|
|
36
|
-
"critical": logging.CRITICAL,
|
|
37
|
-
}
|
|
38
|
-
self._logger.setLevel(level_map.get(level.lower(), logging.INFO))
|
|
39
|
-
|
|
40
|
-
def debug(self, message: str, **kwargs) -> None:
|
|
41
|
-
self._logger.debug(message, **kwargs)
|
|
42
|
-
|
|
43
|
-
def info(self, message: str, **kwargs) -> None:
|
|
44
|
-
self._logger.info(message, **kwargs)
|
|
45
|
-
|
|
46
|
-
def warning(self, message: str, **kwargs) -> None:
|
|
47
|
-
self._logger.warning(message, **kwargs)
|
|
48
|
-
|
|
49
|
-
def error(self, message: str, **kwargs) -> None:
|
|
50
|
-
self._logger.error(message, **kwargs)
|
|
51
|
-
|
|
52
|
-
def critical(self, message: str, **kwargs) -> None:
|
|
53
|
-
self._logger.critical(message, **kwargs)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def get_logger() -> OrchestrationLogger:
|
|
57
|
-
return OrchestrationLogger()
|
|
File without changes
|
{pygeai_orchestration-0.1.0b5.dist-info → pygeai_orchestration-0.1.0b6.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{pygeai_orchestration-0.1.0b5.dist-info → pygeai_orchestration-0.1.0b6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{pygeai_orchestration-0.1.0b5.dist-info → pygeai_orchestration-0.1.0b6.dist-info}/top_level.txt
RENAMED
|
File without changes
|