pygeai-orchestration 0.1.0b5__tar.gz → 0.1.0b7__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.
- pygeai_orchestration-0.1.0b7/CHANGELOG.md +75 -0
- {pygeai_orchestration-0.1.0b5/pygeai_orchestration.egg-info → pygeai_orchestration-0.1.0b7}/PKG-INFO +181 -51
- pygeai_orchestration-0.1.0b7/README.md +389 -0
- pygeai_orchestration-0.1.0b7/docs/source/patterns.rst +571 -0
- pygeai_orchestration-0.1.0b7/docs/source/quickstart.rst +343 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/__init__.py +4 -5
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/__init__.py +0 -4
- pygeai_orchestration-0.1.0b7/pygeai_orchestration/core/base/__init__.py +23 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/base/geai_agent.py +34 -57
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/base/geai_orchestrator.py +6 -28
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/base/orchestrator.py +2 -2
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/utils/__init__.py +4 -7
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/patterns/multi_agent.py +4 -4
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/patterns/planning.py +4 -4
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/patterns/react.py +4 -4
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/patterns/reflection.py +4 -4
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/patterns/tool_use.py +4 -4
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7/pygeai_orchestration.egg-info}/PKG-INFO +181 -51
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration.egg-info/SOURCES.txt +9 -6
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pyproject.toml +1 -1
- pygeai_orchestration-0.1.0b7/snippets/multi_agent_collaboration.py +80 -0
- pygeai_orchestration-0.1.0b7/snippets/planning_analysis.py +49 -0
- pygeai_orchestration-0.1.0b7/snippets/planning_project.py +45 -0
- pygeai_orchestration-0.1.0b7/snippets/react_problem_solving.py +47 -0
- pygeai_orchestration-0.1.0b7/snippets/react_research.py +50 -0
- pygeai_orchestration-0.1.0b7/snippets/reflection_code_review.py +50 -0
- pygeai_orchestration-0.1.0b7/snippets/reflection_explanation.py +42 -0
- pygeai_orchestration-0.1.0b7/snippets/tool_use_calculator.py +89 -0
- pygeai_orchestration-0.1.0b7/snippets/tool_use_data_processing.py +135 -0
- pygeai_orchestration-0.1.0b5/CHANGELOG.md +0 -29
- pygeai_orchestration-0.1.0b5/README.md +0 -259
- pygeai_orchestration-0.1.0b5/docs/patterns_guide.md +0 -313
- pygeai_orchestration-0.1.0b5/docs/quickstart.md +0 -139
- pygeai_orchestration-0.1.0b5/docs/source/patterns.rst +0 -380
- pygeai_orchestration-0.1.0b5/docs/source/quickstart.rst +0 -251
- pygeai_orchestration-0.1.0b5/pygeai_orchestration/core/base/__init__.py +0 -23
- pygeai_orchestration-0.1.0b5/pygeai_orchestration/core/utils/logging.py +0 -57
- pygeai_orchestration-0.1.0b5/snippets/multi_agent_snippet.py +0 -26
- pygeai_orchestration-0.1.0b5/snippets/react_snippet.py +0 -17
- pygeai_orchestration-0.1.0b5/snippets/reflection_snippet.py +0 -15
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/BUILD.md +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/CONTRIBUTING.md +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/LICENSE +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/MANIFEST.in +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/docs/source/api/core.rst +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/docs/source/api/exceptions.rst +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/docs/source/api/patterns.rst +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/docs/source/changelog.rst +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/docs/source/contributing.rst +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/docs/source/examples.rst +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/docs/source/index.rst +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/cli/__init__.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/cli/__main__.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/cli/commands/__init__.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/cli/commands/base.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/cli/error_handler.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/cli/formatters.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/cli/geai_orch.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/cli/interactive.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/cli/texts/help.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/base/agent.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/base/pattern.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/base/tool.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/common/__init__.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/common/context.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/common/memory.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/common/message.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/common/state.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/composition.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/config.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/exceptions.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/handlers.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/utils/cache.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/utils/config.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/utils/metrics.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/core/utils/validators.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/dev/__init__.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/dev/debug.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/dev/templates.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/dev/testing.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/patterns/__init__.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/__init__.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_base_classes.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_cache.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_cli_formatters.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_common.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_composition.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_config.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_dev_utils.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_exceptions.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_handlers.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_metrics.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration/tests/test_patterns.py +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration.egg-info/dependency_links.txt +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration.egg-info/entry_points.txt +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration.egg-info/requires.txt +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/pygeai_orchestration.egg-info/top_level.txt +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/requirements.txt +0 -0
- {pygeai_orchestration-0.1.0b5 → pygeai_orchestration-0.1.0b7}/setup.cfg +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to PyGEAI-Orchestration will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial project structure and configuration
|
|
12
|
+
- Core base classes for agents, orchestrators, and patterns
|
|
13
|
+
- CLI framework with `geai-orch` command
|
|
14
|
+
- Reflection pattern for iterative improvement
|
|
15
|
+
- Tool Use pattern for function calling
|
|
16
|
+
- ReAct pattern for reasoning and acting
|
|
17
|
+
- Planning pattern for multi-step execution
|
|
18
|
+
- Multi-Agent pattern for collaborative workflows
|
|
19
|
+
- Comprehensive test suite with unit and integration tests
|
|
20
|
+
- Documentation and examples for all patterns
|
|
21
|
+
- GitHub Actions CI/CD workflows
|
|
22
|
+
- 9 working code snippets demonstrating all patterns:
|
|
23
|
+
- `reflection_explanation.py` - Iterative explanation improvement
|
|
24
|
+
- `reflection_code_review.py` - Code review with self-critique
|
|
25
|
+
- `react_research.py` - Structured research tasks
|
|
26
|
+
- `react_problem_solving.py` - Step-by-step problem solving
|
|
27
|
+
- `planning_project.py` - Project planning and breakdown
|
|
28
|
+
- `planning_analysis.py` - Data analysis planning
|
|
29
|
+
- `tool_use_calculator.py` - Mathematical operations with tools
|
|
30
|
+
- `tool_use_data_processing.py` - Data validation and transformation
|
|
31
|
+
- `multi_agent_collaboration.py` - Collaborative multi-agent workflow
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- **BREAKING**: Refactored entire import system to use absolute imports only
|
|
35
|
+
- All imports now use full module paths: `from pygeai_orchestration.core.base import ...`
|
|
36
|
+
- Removed all relative imports (`.module` style)
|
|
37
|
+
- **BREAKING**: Removed `get_logger()` and `OrchestrationLogger` from public API
|
|
38
|
+
- All modules now use standard `logging.getLogger("pygeai_orchestration")`
|
|
39
|
+
- Logging disabled by default with `NullHandler` (follows PyGEAI pattern)
|
|
40
|
+
- Users can enable logging by configuring the `"pygeai_orchestration"` logger
|
|
41
|
+
- **BREAKING**: Renamed all snippet files from `*_snippet.py` to `<pattern>_<topic>.py` format
|
|
42
|
+
- More descriptive naming that indicates pattern and use case
|
|
43
|
+
- Example: `reflection_snippet.py` → `reflection_explanation.py`
|
|
44
|
+
- Updated `GEAIAgent` to use actual PyGEAI Session and ChatManager APIs
|
|
45
|
+
- Proper integration with PyGEAI chat completion
|
|
46
|
+
- Correct credential loading from `~/.geai/credentials`
|
|
47
|
+
- Support for provider-prefixed model names (e.g., `openai/gpt-4o-mini`)
|
|
48
|
+
- Tool system improvements:
|
|
49
|
+
- `BaseTool` subclasses must implement `validate_parameters()` method
|
|
50
|
+
- `ToolConfig` uses `parameters_schema` field (not `parameters`)
|
|
51
|
+
- Clear ToolCategory enum values: SEARCH, COMPUTATION, DATA_ACCESS, COMMUNICATION, CUSTOM
|
|
52
|
+
- All pattern implementations updated to use absolute imports and standard logging
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- PyGEAI integration now uses correct Session and ChatManager APIs
|
|
56
|
+
- Removed incorrect assumptions about `Session.agents` and `Session.chats` attributes
|
|
57
|
+
- Fixed message formatting to use proper PyGEAI `ChatMessageList` and `ChatMessage` models
|
|
58
|
+
- Fixed credential loading to delegate to PyGEAI's configuration system
|
|
59
|
+
- Corrected model naming to include provider prefix as required by PyGEAI
|
|
60
|
+
|
|
61
|
+
### Removed
|
|
62
|
+
- **BREAKING**: Removed PyGEAI availability checks
|
|
63
|
+
- PyGEAI is now a required dependency
|
|
64
|
+
- No fallback or mock implementations
|
|
65
|
+
- Removed `get_logger()` utility function from `pygeai_orchestration.core.utils`
|
|
66
|
+
- Removed `OrchestrationLogger` singleton class
|
|
67
|
+
- Removed all relative import statements across the codebase
|
|
68
|
+
|
|
69
|
+
## [0.1.0b1] - 2026-02-05
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
- Initial beta release of PyGEAI-Orchestration
|
|
73
|
+
- Foundation for agentic AI orchestration patterns
|
|
74
|
+
- Integration with PyGEAI SDK
|
|
75
|
+
- Basic project structure and tooling
|
{pygeai_orchestration-0.1.0b5/pygeai_orchestration.egg-info → pygeai_orchestration-0.1.0b7}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pygeai-orchestration
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0b7
|
|
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
|
|
@@ -88,27 +88,37 @@ import asyncio
|
|
|
88
88
|
from pygeai_orchestration import (
|
|
89
89
|
GEAIAgent,
|
|
90
90
|
AgentConfig,
|
|
91
|
+
PatternConfig,
|
|
92
|
+
PatternType,
|
|
91
93
|
ReflectionPattern
|
|
92
94
|
)
|
|
93
95
|
|
|
94
96
|
async def main():
|
|
95
|
-
# Create
|
|
96
|
-
|
|
97
|
+
# Create agent configuration
|
|
98
|
+
agent_config = AgentConfig(
|
|
97
99
|
name="my-agent",
|
|
98
|
-
model="gpt-
|
|
100
|
+
model="openai/gpt-4o-mini",
|
|
99
101
|
temperature=0.7
|
|
100
102
|
)
|
|
101
|
-
agent = GEAIAgent(config)
|
|
103
|
+
agent = GEAIAgent(config=agent_config)
|
|
104
|
+
|
|
105
|
+
# Create pattern configuration
|
|
106
|
+
pattern_config = PatternConfig(
|
|
107
|
+
name="reflection-example",
|
|
108
|
+
pattern_type=PatternType.REFLECTION,
|
|
109
|
+
max_iterations=3
|
|
110
|
+
)
|
|
102
111
|
|
|
103
112
|
# Create and execute pattern
|
|
104
|
-
pattern = ReflectionPattern(agent=agent)
|
|
105
|
-
result = await pattern.execute("
|
|
113
|
+
pattern = ReflectionPattern(agent=agent, config=pattern_config)
|
|
114
|
+
result = await pattern.execute("Explain quantum computing in simple terms")
|
|
106
115
|
|
|
107
116
|
print(f"Success: {result.success}")
|
|
108
|
-
print(f"Result: {result.result}")
|
|
109
117
|
print(f"Iterations: {result.iterations}")
|
|
118
|
+
print(f"Result: {result.result[:200]}...") # First 200 chars
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
if __name__ == "__main__":
|
|
121
|
+
asyncio.run(main())
|
|
112
122
|
```
|
|
113
123
|
|
|
114
124
|
## Configuration
|
|
@@ -137,10 +147,24 @@ See [PyGEAI Configuration](https://docs.globant.ai/en/wiki?1149,Getting+started+
|
|
|
137
147
|
Enables agents to self-critique and iteratively improve their outputs.
|
|
138
148
|
|
|
139
149
|
```python
|
|
140
|
-
from pygeai_orchestration
|
|
150
|
+
from pygeai_orchestration import GEAIAgent, AgentConfig, PatternConfig, PatternType, ReflectionPattern
|
|
151
|
+
|
|
152
|
+
agent = GEAIAgent(config=AgentConfig(
|
|
153
|
+
name="reflector",
|
|
154
|
+
model="openai/gpt-4o-mini",
|
|
155
|
+
temperature=0.7
|
|
156
|
+
))
|
|
157
|
+
|
|
158
|
+
pattern = ReflectionPattern(
|
|
159
|
+
agent=agent,
|
|
160
|
+
config=PatternConfig(
|
|
161
|
+
name="reflection",
|
|
162
|
+
pattern_type=PatternType.REFLECTION,
|
|
163
|
+
max_iterations=3
|
|
164
|
+
)
|
|
165
|
+
)
|
|
141
166
|
|
|
142
|
-
|
|
143
|
-
result = agent.reflect_and_improve("Initial output", iterations=3)
|
|
167
|
+
result = await pattern.execute("Explain quantum computing in simple terms")
|
|
144
168
|
```
|
|
145
169
|
|
|
146
170
|
**Use Cases:**
|
|
@@ -148,30 +172,28 @@ result = agent.reflect_and_improve("Initial output", iterations=3)
|
|
|
148
172
|
- Code review and refinement
|
|
149
173
|
- Self-correcting responses
|
|
150
174
|
|
|
151
|
-
### 2.
|
|
152
|
-
Integrates function calling and tool execution into agent workflows.
|
|
153
|
-
|
|
154
|
-
```python
|
|
155
|
-
from pygeai_orchestration.patterns.tool_use import ToolUseAgent
|
|
156
|
-
|
|
157
|
-
agent = ToolUseAgent(session=session)
|
|
158
|
-
agent.register_tool("search", search_function)
|
|
159
|
-
result = agent.execute("Search for information about AI")
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
**Use Cases:**
|
|
163
|
-
- API integration
|
|
164
|
-
- External data retrieval
|
|
165
|
-
- Action execution
|
|
166
|
-
|
|
167
|
-
### 3. ReAct Pattern
|
|
175
|
+
### 2. ReAct Pattern
|
|
168
176
|
Implements the Reasoning + Acting loop for step-by-step problem solving.
|
|
169
177
|
|
|
170
178
|
```python
|
|
171
|
-
from pygeai_orchestration
|
|
179
|
+
from pygeai_orchestration import GEAIAgent, AgentConfig, PatternConfig, PatternType, ReActPattern
|
|
180
|
+
|
|
181
|
+
agent = GEAIAgent(config=AgentConfig(
|
|
182
|
+
name="reasoner",
|
|
183
|
+
model="openai/gpt-4o-mini",
|
|
184
|
+
temperature=0.7
|
|
185
|
+
))
|
|
186
|
+
|
|
187
|
+
pattern = ReActPattern(
|
|
188
|
+
agent=agent,
|
|
189
|
+
config=PatternConfig(
|
|
190
|
+
name="react",
|
|
191
|
+
pattern_type=PatternType.REACT,
|
|
192
|
+
max_iterations=5
|
|
193
|
+
)
|
|
194
|
+
)
|
|
172
195
|
|
|
173
|
-
|
|
174
|
-
result = agent.solve("Complex multi-step problem")
|
|
196
|
+
result = await pattern.execute("Research and summarize renewable energy benefits")
|
|
175
197
|
```
|
|
176
198
|
|
|
177
199
|
**Use Cases:**
|
|
@@ -179,15 +201,28 @@ result = agent.solve("Complex multi-step problem")
|
|
|
179
201
|
- Research tasks
|
|
180
202
|
- Multi-step workflows
|
|
181
203
|
|
|
182
|
-
###
|
|
204
|
+
### 3. Planning Pattern
|
|
183
205
|
Creates and executes multi-step plans with adaptive execution.
|
|
184
206
|
|
|
185
207
|
```python
|
|
186
|
-
from pygeai_orchestration
|
|
208
|
+
from pygeai_orchestration import GEAIAgent, AgentConfig, PatternConfig, PatternType, PlanningPattern
|
|
209
|
+
|
|
210
|
+
agent = GEAIAgent(config=AgentConfig(
|
|
211
|
+
name="planner",
|
|
212
|
+
model="openai/gpt-4o-mini",
|
|
213
|
+
temperature=0.5
|
|
214
|
+
))
|
|
215
|
+
|
|
216
|
+
pattern = PlanningPattern(
|
|
217
|
+
agent=agent,
|
|
218
|
+
config=PatternConfig(
|
|
219
|
+
name="planning",
|
|
220
|
+
pattern_type=PatternType.PLANNING,
|
|
221
|
+
max_iterations=1
|
|
222
|
+
)
|
|
223
|
+
)
|
|
187
224
|
|
|
188
|
-
|
|
189
|
-
plan = agent.create_plan("Build a web application")
|
|
190
|
-
result = agent.execute_plan(plan)
|
|
225
|
+
result = await pattern.execute("Create a project plan for building a REST API")
|
|
191
226
|
```
|
|
192
227
|
|
|
193
228
|
**Use Cases:**
|
|
@@ -195,16 +230,92 @@ result = agent.execute_plan(plan)
|
|
|
195
230
|
- Task decomposition
|
|
196
231
|
- Workflow automation
|
|
197
232
|
|
|
233
|
+
### 4. Tool Use Pattern
|
|
234
|
+
Integrates function calling and tool execution into agent workflows.
|
|
235
|
+
|
|
236
|
+
```python
|
|
237
|
+
from pygeai_orchestration import (
|
|
238
|
+
GEAIAgent, AgentConfig, PatternConfig, PatternType,
|
|
239
|
+
ToolUsePattern, BaseTool, ToolConfig, ToolResult, ToolCategory
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
class CalculatorTool(BaseTool):
|
|
243
|
+
def __init__(self):
|
|
244
|
+
super().__init__(ToolConfig(
|
|
245
|
+
name="calculator",
|
|
246
|
+
description="Performs calculations",
|
|
247
|
+
category=ToolCategory.COMPUTATION,
|
|
248
|
+
parameters_schema={"operation": "string", "values": "list"}
|
|
249
|
+
))
|
|
250
|
+
|
|
251
|
+
def validate_parameters(self, parameters):
|
|
252
|
+
return "operation" in parameters and "values" in parameters
|
|
253
|
+
|
|
254
|
+
async def execute(self, operation, values, **kwargs):
|
|
255
|
+
if operation == "average":
|
|
256
|
+
result = sum(values) / len(values)
|
|
257
|
+
return ToolResult(success=True, result=result)
|
|
258
|
+
return ToolResult(success=False, error="Unknown operation")
|
|
259
|
+
|
|
260
|
+
agent = GEAIAgent(config=AgentConfig(name="calculator", model="openai/gpt-4o-mini"))
|
|
261
|
+
pattern = ToolUsePattern(
|
|
262
|
+
agent=agent,
|
|
263
|
+
config=PatternConfig(name="tools", pattern_type=PatternType.TOOL_USE),
|
|
264
|
+
tools=[CalculatorTool()]
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
result = await pattern.execute("Calculate average of: 10, 20, 30")
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Use Cases:**
|
|
271
|
+
- API integration
|
|
272
|
+
- External data retrieval
|
|
273
|
+
- Action execution
|
|
274
|
+
|
|
198
275
|
### 5. Multi-Agent Pattern
|
|
199
276
|
Coordinates multiple agents working collaboratively on complex tasks.
|
|
200
277
|
|
|
201
278
|
```python
|
|
202
|
-
from pygeai_orchestration
|
|
279
|
+
from pygeai_orchestration import (
|
|
280
|
+
GEAIAgent, AgentConfig, PatternConfig, PatternType, MultiAgentPattern, AgentRole
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
# Create specialized agents
|
|
284
|
+
researcher = GEAIAgent(config=AgentConfig(
|
|
285
|
+
name="researcher",
|
|
286
|
+
model="openai/gpt-4o-mini",
|
|
287
|
+
system_prompt="You are a research specialist."
|
|
288
|
+
))
|
|
289
|
+
|
|
290
|
+
writer = GEAIAgent(config=AgentConfig(
|
|
291
|
+
name="writer",
|
|
292
|
+
model="openai/gpt-4o-mini",
|
|
293
|
+
system_prompt="You are a technical writer."
|
|
294
|
+
))
|
|
295
|
+
|
|
296
|
+
coordinator = GEAIAgent(config=AgentConfig(
|
|
297
|
+
name="coordinator",
|
|
298
|
+
model="openai/gpt-4o-mini",
|
|
299
|
+
system_prompt="You coordinate tasks and synthesize results."
|
|
300
|
+
))
|
|
301
|
+
|
|
302
|
+
# Create agent roles
|
|
303
|
+
agent_roles = [
|
|
304
|
+
AgentRole(name="researcher", agent=researcher, role_description="Researches topics"),
|
|
305
|
+
AgentRole(name="writer", agent=writer, role_description="Writes reports")
|
|
306
|
+
]
|
|
307
|
+
|
|
308
|
+
# Create multi-agent pattern
|
|
309
|
+
pattern = MultiAgentPattern(
|
|
310
|
+
agents=agent_roles,
|
|
311
|
+
coordinator_agent=coordinator,
|
|
312
|
+
config=PatternConfig(
|
|
313
|
+
name="collaboration",
|
|
314
|
+
pattern_type=PatternType.MULTI_AGENT
|
|
315
|
+
)
|
|
316
|
+
)
|
|
203
317
|
|
|
204
|
-
|
|
205
|
-
coordinator.add_agent("researcher", researcher_agent)
|
|
206
|
-
coordinator.add_agent("writer", writer_agent)
|
|
207
|
-
result = coordinator.execute("Create research report")
|
|
318
|
+
result = await pattern.execute("Create a report on AI in healthcare")
|
|
208
319
|
```
|
|
209
320
|
|
|
210
321
|
**Use Cases:**
|
|
@@ -217,14 +328,13 @@ result = coordinator.execute("Create research report")
|
|
|
217
328
|
- [Getting Started Guide](docs/getting-started.md)
|
|
218
329
|
- [Pattern Documentation](docs/patterns/)
|
|
219
330
|
- [API Reference](docs/api-reference/)
|
|
220
|
-
- [
|
|
331
|
+
- [Code Snippets](snippets/)
|
|
221
332
|
|
|
222
333
|
## Development
|
|
223
334
|
|
|
224
335
|
### Setup Development Environment
|
|
225
336
|
|
|
226
337
|
```bash
|
|
227
|
-
git clone https://docs.globant.ai/en/wiki?1149,Getting+started+with+PyGEAI-orchestration.git
|
|
228
338
|
cd pygeai-orchestration
|
|
229
339
|
python -m venv venv
|
|
230
340
|
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
@@ -247,15 +357,35 @@ python testing.py --coverage
|
|
|
247
357
|
|
|
248
358
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development guidelines.
|
|
249
359
|
|
|
250
|
-
##
|
|
360
|
+
## Code Snippets
|
|
361
|
+
|
|
362
|
+
Check the [snippets/](snippets/) directory for working code examples:
|
|
251
363
|
|
|
252
|
-
|
|
364
|
+
### Reflection Pattern
|
|
365
|
+
- [reflection_explanation.py](snippets/reflection_explanation.py) - Iterative explanation improvement
|
|
366
|
+
- [reflection_code_review.py](snippets/reflection_code_review.py) - Code review with self-critique
|
|
253
367
|
|
|
254
|
-
|
|
255
|
-
- [
|
|
256
|
-
- [
|
|
257
|
-
|
|
258
|
-
|
|
368
|
+
### ReAct Pattern
|
|
369
|
+
- [react_research.py](snippets/react_research.py) - Structured research tasks
|
|
370
|
+
- [react_problem_solving.py](snippets/react_problem_solving.py) - Step-by-step problem solving
|
|
371
|
+
|
|
372
|
+
### Planning Pattern
|
|
373
|
+
- [planning_project.py](snippets/planning_project.py) - Project planning and breakdown
|
|
374
|
+
- [planning_analysis.py](snippets/planning_analysis.py) - Data analysis planning
|
|
375
|
+
|
|
376
|
+
### Tool Use Pattern
|
|
377
|
+
- [tool_use_calculator.py](snippets/tool_use_calculator.py) - Mathematical operations with tools
|
|
378
|
+
- [tool_use_data_processing.py](snippets/tool_use_data_processing.py) - Data validation and transformation
|
|
379
|
+
|
|
380
|
+
### Multi-Agent Pattern
|
|
381
|
+
- [multi_agent_collaboration.py](snippets/multi_agent_collaboration.py) - Collaborative multi-agent workflow
|
|
382
|
+
|
|
383
|
+
Run any snippet:
|
|
384
|
+
```bash
|
|
385
|
+
python snippets/reflection_explanation.py
|
|
386
|
+
python snippets/react_research.py
|
|
387
|
+
python snippets/planning_project.py
|
|
388
|
+
```
|
|
259
389
|
|
|
260
390
|
## Contributing
|
|
261
391
|
|