pygeai-orchestration 0.1.0b6__py3-none-any.whl → 0.1.0b7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygeai-orchestration
3
- Version: 0.1.0b6
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 an agent
96
- config = AgentConfig(
97
+ # Create agent configuration
98
+ agent_config = AgentConfig(
97
99
  name="my-agent",
98
- model="gpt-4",
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("Improve this text: Hello world")
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
- asyncio.run(main())
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.patterns.reflection import ReflectionAgent
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
- agent = ReflectionAgent(session=session, agent_id="critic-agent")
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. Tool Use Pattern
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.patterns.react import ReActAgent
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
- agent = ReActAgent(session=session, agent_id="reasoning-agent")
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
- ### 4. Planning Pattern
204
+ ### 3. Planning Pattern
183
205
  Creates and executes multi-step plans with adaptive execution.
184
206
 
185
207
  ```python
186
- from pygeai_orchestration.patterns.planning import PlanningAgent
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
- agent = PlanningAgent(session=session, planner_id="planner")
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.patterns.multi_agent import MultiAgentCoordinator
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
- coordinator = MultiAgentCoordinator(session=session)
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:**
@@ -52,9 +52,9 @@ pygeai_orchestration/tests/test_exceptions.py,sha256=l_YlVxZguM-xcUNlOl8u9R3vx_O
52
52
  pygeai_orchestration/tests/test_handlers.py,sha256=t3ZCbif4npxsgoYM6vpCrxOru0q-7f0ARjYAE1SuK7Y,12166
53
53
  pygeai_orchestration/tests/test_metrics.py,sha256=GP36BuTxp7ydptG4nGo804yB91UkBHuskEfJuZwkZvE,6078
54
54
  pygeai_orchestration/tests/test_patterns.py,sha256=9qarHU_9R70nfWf98TzMiJO_XCfz9-kOn9Ju2RQnogs,5051
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,,
55
+ pygeai_orchestration-0.1.0b7.dist-info/licenses/LICENSE,sha256=HrOw5fbeVfHobmqgadP4r7dOPCMDA4uOfFX8pE3MDT0,1072
56
+ pygeai_orchestration-0.1.0b7.dist-info/METADATA,sha256=kVYrupmNerxCJVa12LqrR80SPbofje58N-_nnOOLE-Q,11933
57
+ pygeai_orchestration-0.1.0b7.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
58
+ pygeai_orchestration-0.1.0b7.dist-info/entry_points.txt,sha256=p8ODRFqLwrrhoS6FlQW330_J59-0ZjSd6x8kAYYLm7E,69
59
+ pygeai_orchestration-0.1.0b7.dist-info/top_level.txt,sha256=8gLeyR8RXLump7AkakhU7kFBh6O7XTvrJi1bKK4e39g,21
60
+ pygeai_orchestration-0.1.0b7.dist-info/RECORD,,