pygeai 0.6.0b3__py3-none-any.whl → 0.6.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.
Files changed (145) hide show
  1. pygeai/_docs/Makefile +20 -0
  2. pygeai/_docs/make.bat +35 -0
  3. pygeai/_docs/source/conf.py +45 -0
  4. pygeai/_docs/source/content/ai_lab/cli.rst +747 -0
  5. pygeai/_docs/source/content/ai_lab/models.rst +1600 -0
  6. pygeai/_docs/source/content/ai_lab/runner.rst +253 -0
  7. pygeai/_docs/source/content/ai_lab/spec.rst +431 -0
  8. pygeai/_docs/source/content/ai_lab/usage.rst +1011 -0
  9. pygeai/_docs/source/content/ai_lab.rst +102 -0
  10. pygeai/_docs/source/content/api_reference/chat.rst +328 -0
  11. pygeai/_docs/source/content/api_reference/embeddings.rst +124 -0
  12. pygeai/_docs/source/content/api_reference/project.rst +552 -0
  13. pygeai/_docs/source/content/api_reference/rag.rst +710 -0
  14. pygeai/_docs/source/content/api_reference.rst +46 -0
  15. pygeai/_docs/source/content/chat_gui.rst +121 -0
  16. pygeai/_docs/source/content/cli.rst +126 -0
  17. pygeai/_docs/source/content/debugger.rst +188 -0
  18. pygeai/_docs/source/content/intro.rst +67 -0
  19. pygeai/_docs/source/content/modules.rst +7 -0
  20. pygeai/_docs/source/content/quickstart.rst +143 -0
  21. pygeai/_docs/source/content/samples.rst +394 -0
  22. pygeai/_docs/source/index.rst +21 -0
  23. pygeai/_docs/source/modules.rst +7 -0
  24. pygeai/_docs/source/pygeai.admin.rst +29 -0
  25. pygeai/_docs/source/pygeai.assistant.data.rst +21 -0
  26. pygeai/_docs/source/pygeai.assistant.data_analyst.rst +29 -0
  27. pygeai/_docs/source/pygeai.assistant.rag.rst +53 -0
  28. pygeai/_docs/source/pygeai.assistant.rst +55 -0
  29. pygeai/_docs/source/pygeai.chat.rst +69 -0
  30. pygeai/_docs/source/pygeai.cli.commands.flows.rst +10 -0
  31. pygeai/_docs/source/pygeai.cli.commands.lab.rst +53 -0
  32. pygeai/_docs/source/pygeai.cli.commands.rst +198 -0
  33. pygeai/_docs/source/pygeai.cli.rst +54 -0
  34. pygeai/_docs/source/pygeai.cli.texts.rst +21 -0
  35. pygeai/_docs/source/pygeai.core.base.rst +53 -0
  36. pygeai/_docs/source/pygeai.core.common.rst +37 -0
  37. pygeai/_docs/source/pygeai.core.embeddings.rst +61 -0
  38. pygeai/_docs/source/pygeai.core.feedback.rst +37 -0
  39. pygeai/_docs/source/pygeai.core.files.rst +61 -0
  40. pygeai/_docs/source/pygeai.core.llm.rst +29 -0
  41. pygeai/_docs/source/pygeai.core.plugins.rst +37 -0
  42. pygeai/_docs/source/pygeai.core.rerank.rst +53 -0
  43. pygeai/_docs/source/pygeai.core.rst +63 -0
  44. pygeai/_docs/source/pygeai.core.secrets.rst +29 -0
  45. pygeai/_docs/source/pygeai.core.services.llm.rst +29 -0
  46. pygeai/_docs/source/pygeai.core.services.rst +37 -0
  47. pygeai/_docs/source/pygeai.core.utils.rst +21 -0
  48. pygeai/_docs/source/pygeai.dbg.rst +21 -0
  49. pygeai/_docs/source/pygeai.evaluation.dataset.rst +29 -0
  50. pygeai/_docs/source/pygeai.evaluation.plan.rst +29 -0
  51. pygeai/_docs/source/pygeai.evaluation.result.rst +29 -0
  52. pygeai/_docs/source/pygeai.evaluation.rst +31 -0
  53. pygeai/_docs/source/pygeai.flows.rst +29 -0
  54. pygeai/_docs/source/pygeai.gam.rst +29 -0
  55. pygeai/_docs/source/pygeai.health.rst +29 -0
  56. pygeai/_docs/source/pygeai.lab.agents.rst +37 -0
  57. pygeai/_docs/source/pygeai.lab.processes.rst +37 -0
  58. pygeai/_docs/source/pygeai.lab.rst +65 -0
  59. pygeai/_docs/source/pygeai.lab.spec.rst +29 -0
  60. pygeai/_docs/source/pygeai.lab.strategies.rst +37 -0
  61. pygeai/_docs/source/pygeai.lab.tools.rst +37 -0
  62. pygeai/_docs/source/pygeai.man.man1.rst +10 -0
  63. pygeai/_docs/source/pygeai.man.rst +18 -0
  64. pygeai/_docs/source/pygeai.migration.rst +29 -0
  65. pygeai/_docs/source/pygeai.organization.limits.rst +45 -0
  66. pygeai/_docs/source/pygeai.organization.rst +61 -0
  67. pygeai/_docs/source/pygeai.proxy.rst +53 -0
  68. pygeai/_docs/source/pygeai.rst +33 -0
  69. pygeai/_docs/source/pygeai.tests.admin.rst +21 -0
  70. pygeai/_docs/source/pygeai.tests.assistants.rag.rst +37 -0
  71. pygeai/_docs/source/pygeai.tests.assistants.rst +45 -0
  72. pygeai/_docs/source/pygeai.tests.chat.rst +45 -0
  73. pygeai/_docs/source/pygeai.tests.cli.commands.lab.rst +37 -0
  74. pygeai/_docs/source/pygeai.tests.cli.commands.rst +149 -0
  75. pygeai/_docs/source/pygeai.tests.cli.docker.rst +10 -0
  76. pygeai/_docs/source/pygeai.tests.cli.rst +30 -0
  77. pygeai/_docs/source/pygeai.tests.core.base.data.rst +29 -0
  78. pygeai/_docs/source/pygeai.tests.core.base.rst +37 -0
  79. pygeai/_docs/source/pygeai.tests.core.common.data.rst +10 -0
  80. pygeai/_docs/source/pygeai.tests.core.common.rst +37 -0
  81. pygeai/_docs/source/pygeai.tests.core.embeddings.rst +21 -0
  82. pygeai/_docs/source/pygeai.tests.core.feedback.rst +21 -0
  83. pygeai/_docs/source/pygeai.tests.core.files.rst +45 -0
  84. pygeai/_docs/source/pygeai.tests.core.llm.rst +21 -0
  85. pygeai/_docs/source/pygeai.tests.core.rerank.rst +37 -0
  86. pygeai/_docs/source/pygeai.tests.core.rst +38 -0
  87. pygeai/_docs/source/pygeai.tests.core.secrets.rst +21 -0
  88. pygeai/_docs/source/pygeai.tests.core.services.rst +21 -0
  89. pygeai/_docs/source/pygeai.tests.core.utils.rst +21 -0
  90. pygeai/_docs/source/pygeai.tests.dbg.rst +21 -0
  91. pygeai/_docs/source/pygeai.tests.gam.rst +21 -0
  92. pygeai/_docs/source/pygeai.tests.health.rst +21 -0
  93. pygeai/_docs/source/pygeai.tests.integration.assistants.rag.rst +21 -0
  94. pygeai/_docs/source/pygeai.tests.integration.assistants.rst +18 -0
  95. pygeai/_docs/source/pygeai.tests.integration.chat.rst +21 -0
  96. pygeai/_docs/source/pygeai.tests.integration.lab.agents.rst +69 -0
  97. pygeai/_docs/source/pygeai.tests.integration.lab.processes.rst +69 -0
  98. pygeai/_docs/source/pygeai.tests.integration.lab.reasoning_strategies.rst +37 -0
  99. pygeai/_docs/source/pygeai.tests.integration.lab.rst +21 -0
  100. pygeai/_docs/source/pygeai.tests.integration.lab.tools.rst +77 -0
  101. pygeai/_docs/source/pygeai.tests.integration.rst +20 -0
  102. pygeai/_docs/source/pygeai.tests.lab.agents.rst +29 -0
  103. pygeai/_docs/source/pygeai.tests.lab.processes.rst +29 -0
  104. pygeai/_docs/source/pygeai.tests.lab.rst +49 -0
  105. pygeai/_docs/source/pygeai.tests.lab.spec.rst +29 -0
  106. pygeai/_docs/source/pygeai.tests.lab.strategies.rst +29 -0
  107. pygeai/_docs/source/pygeai.tests.lab.tools.rst +29 -0
  108. pygeai/_docs/source/pygeai.tests.migration.rst +29 -0
  109. pygeai/_docs/source/pygeai.tests.organization.limits.rst +29 -0
  110. pygeai/_docs/source/pygeai.tests.organization.rst +45 -0
  111. pygeai/_docs/source/pygeai.tests.proxy.rst +61 -0
  112. pygeai/_docs/source/pygeai.tests.rst +31 -0
  113. pygeai/_docs/source/pygeai.tests.snippets.assistants.data_analyst.rst +37 -0
  114. pygeai/_docs/source/pygeai.tests.snippets.assistants.rag.rst +85 -0
  115. pygeai/_docs/source/pygeai.tests.snippets.assistants.rst +78 -0
  116. pygeai/_docs/source/pygeai.tests.snippets.chat.rst +85 -0
  117. pygeai/_docs/source/pygeai.tests.snippets.embeddings.rst +21 -0
  118. pygeai/_docs/source/pygeai.tests.snippets.evaluation.rst +10 -0
  119. pygeai/_docs/source/pygeai.tests.snippets.extras.rst +37 -0
  120. pygeai/_docs/source/pygeai.tests.snippets.files.rst +53 -0
  121. pygeai/_docs/source/pygeai.tests.snippets.gam.rst +21 -0
  122. pygeai/_docs/source/pygeai.tests.snippets.lab.agents.rst +93 -0
  123. pygeai/_docs/source/pygeai.tests.snippets.lab.processes.jobs.rst +21 -0
  124. pygeai/_docs/source/pygeai.tests.snippets.lab.processes.kbs.rst +45 -0
  125. pygeai/_docs/source/pygeai.tests.snippets.lab.processes.rst +46 -0
  126. pygeai/_docs/source/pygeai.tests.snippets.lab.rst +82 -0
  127. pygeai/_docs/source/pygeai.tests.snippets.lab.samples.rst +21 -0
  128. pygeai/_docs/source/pygeai.tests.snippets.lab.strategies.rst +45 -0
  129. pygeai/_docs/source/pygeai.tests.snippets.lab.tools.rst +85 -0
  130. pygeai/_docs/source/pygeai.tests.snippets.lab.use_cases.rst +117 -0
  131. pygeai/_docs/source/pygeai.tests.snippets.migrate.rst +10 -0
  132. pygeai/_docs/source/pygeai.tests.snippets.organization.rst +69 -0
  133. pygeai/_docs/source/pygeai.tests.snippets.rag.rst +85 -0
  134. pygeai/_docs/source/pygeai.tests.snippets.rerank.rst +21 -0
  135. pygeai/_docs/source/pygeai.tests.snippets.rst +30 -0
  136. pygeai/_docs/source/pygeai.tests.snippets.secrets.rst +10 -0
  137. pygeai/_docs/source/pygeai.tests.snippets.usage_limit.rst +77 -0
  138. pygeai/cli/commands/base.py +9 -9
  139. pygeai/cli/commands/docs.py +2 -2
  140. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/METADATA +1 -1
  141. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/RECORD +145 -8
  142. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/WHEEL +0 -0
  143. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/entry_points.txt +0 -0
  144. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/licenses/LICENSE +0 -0
  145. {pygeai-0.6.0b3.dist-info → pygeai-0.6.0b6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1600 @@
1
+ Data Models
2
+ ===========
3
+
4
+ The PyGEAI SDK provides Pydantic-based data models for interacting with the Globant Enterprise AI Lab, enabling developers to configure agents, tools, processes, tasks, and more. These models ensure type safety and API compatibility without requiring hardcoded field details that may change. Many models allow direct dictionary inputs for nested configurations, simplifying instantiation. This section describes each model’s purpose, provides examples of instantiation (via attributes and dictionaries), and notes key restrictions, keeping documentation maintainable and flexible.
5
+
6
+ .. note::
7
+ Models inherit from ``CustomBaseModel``, a Pydantic ``BaseModel`` subclass, providing ``to_dict()`` for serialization.
8
+
9
+ FilterSettings
10
+ --------------
11
+
12
+ Purpose
13
+ ~~~~~~~
14
+
15
+ Configures filters for querying Lab entities like agents or tools, supporting pagination and scope.
16
+
17
+ Usage Examples
18
+ ~~~~~~~~~~~~~~
19
+
20
+ **Via Attributes**:
21
+
22
+ .. code-block:: python
23
+
24
+ from pygeai.lab.models import FilterSettings
25
+
26
+ filters = FilterSettings(id="agent-123", name="MyAgent", access_scope="private")
27
+ print(filters.to_dict())
28
+ # Output: Dictionary with filter settings
29
+
30
+ **Via Dictionary**:
31
+
32
+ .. code-block:: python
33
+
34
+ from pygeai.lab.models import FilterSettings
35
+
36
+ filters = FilterSettings(**{
37
+ "id": "agent-123",
38
+ "name": "MyAgent",
39
+ "accessScope": "private"
40
+ })
41
+ print(filters.to_dict())
42
+ # Output: Dictionary with filter settings
43
+
44
+ Restrictions and Considerations
45
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46
+
47
+ - Most fields are optional for flexible queries.
48
+ - Pagination requires non-negative integers.
49
+ - Scope values must match API expectations (e.g., "public", "private").
50
+ - Use dictionaries for quick filter setup in API calls.
51
+ - Avoid over-specifying to ensure results.
52
+
53
+ Sampling
54
+ --------
55
+
56
+ Purpose
57
+ ~~~~~~~
58
+
59
+ Controls randomness in LLM token generation.
60
+
61
+ Usage Examples
62
+ ~~~~~~~~~~~~~~
63
+
64
+ **Via Attributes**:
65
+
66
+ .. code-block:: python
67
+
68
+ from pygeai.lab.models import Sampling
69
+
70
+ sampling = Sampling(temperature=0.8, top_k=40, top_p=0.95)
71
+ print(sampling.to_dict())
72
+ # Output: {"temperature": 0.8, "topK": 40, "topP": 0.95}
73
+
74
+ **Via Dictionary**:
75
+
76
+ .. code-block:: python
77
+
78
+ from pygeai.lab.models import Sampling
79
+
80
+ sampling = Sampling(**{
81
+ "temperature": 0.8,
82
+ "topK": 40,
83
+ "topP": 0.95
84
+ })
85
+ print(sampling.to_dict())
86
+ # Output: {"temperature": 0.8, "topK": 40, "topP": 0.95}
87
+
88
+ Restrictions and Considerations
89
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90
+
91
+ - All fields are required.
92
+ - Temperature should range from 0.1 to 2.0.
93
+ - Top-k and top-p need positive, reasonable values.
94
+ - Dictionaries simplify sampling configuration.
95
+ - Test settings to balance creativity and coherence.
96
+
97
+ LlmConfig
98
+ ---------
99
+
100
+ Purpose
101
+ ~~~~~~~
102
+
103
+ Defines LLM settings, including token limits and sampling.
104
+
105
+ Usage Examples
106
+ ~~~~~~~~~~~~~~
107
+
108
+ **Via Attributes**:
109
+
110
+ .. code-block:: python
111
+
112
+ from pygeai.lab.models import LlmConfig, Sampling
113
+
114
+ sampling = Sampling(temperature=0.7, top_k=50, top_p=0.9)
115
+ llm_config = LlmConfig(max_tokens=2048, timeout=30, sampling=sampling)
116
+ print(llm_config.to_dict())
117
+ # Output: Dictionary with LLM settings
118
+
119
+ **Via Dictionary (with Sampling as dict)**:
120
+
121
+ .. code-block:: python
122
+
123
+ from pygeai.lab.models import LlmConfig
124
+
125
+ llm_config = LlmConfig(**{
126
+ "maxTokens": 2048,
127
+ "timeout": 30,
128
+ "sampling": {
129
+ "temperature": 0.7,
130
+ "topK": 50,
131
+ "topP": 0.9
132
+ }
133
+ })
134
+ print(llm_config.to_dict())
135
+ # Output: Dictionary with LLM settings
136
+
137
+ Restrictions and Considerations
138
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139
+
140
+ - Core fields are mandatory.
141
+ - Token limits depend on LLM capacity.
142
+ - Timeout may be API-capped; use 0 carefully.
143
+ - Accepts sampling as a dictionary for convenience.
144
+ - Verify settings before scaling.
145
+
146
+ Model
147
+ -----
148
+
149
+ Purpose
150
+ ~~~~~~~
151
+
152
+ Customizes an LLM for an agent.
153
+
154
+ Usage Examples
155
+ ~~~~~~~~~~~~~~
156
+
157
+ **Via Attributes**:
158
+
159
+ .. code-block:: python
160
+
161
+ from pygeai.lab.models import Model, LlmConfig, Sampling
162
+
163
+ sampling = Sampling(temperature=0.7, top_k=50, top_p=0.9)
164
+ llm_config = LlmConfig(max_tokens=2048, timeout=30, sampling=sampling)
165
+ model = Model(name="gpt-4", llm_config=llm_config)
166
+ print(model.to_dict())
167
+ # Output: Dictionary with model settings
168
+
169
+ **Via Dictionary (with LlmConfig as dict)**:
170
+
171
+ .. code-block:: python
172
+
173
+ from pygeai.lab.models import Model
174
+
175
+ model = Model(**{
176
+ "name": "gpt-4",
177
+ "llmConfig": {
178
+ "maxTokens": 2048,
179
+ "timeout": 30,
180
+ "sampling": {
181
+ "temperature": 0.7,
182
+ "topK": 50,
183
+ "topP": 0.9
184
+ }
185
+ }
186
+ })
187
+ print(model.to_dict())
188
+ # Output: Dictionary with model settings
189
+
190
+ Restrictions and Considerations
191
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192
+
193
+ - Name is required; must be Lab-supported.
194
+ - Optional LLM config can be a dictionary.
195
+ - Prompt, if used, should align with agent tasks.
196
+ - Useful for flexible model assignments.
197
+ - Check LLM compatibility.
198
+
199
+ PromptExample
200
+ -------------
201
+
202
+ Purpose
203
+ ~~~~~~~
204
+
205
+ Provides input-output pairs for few-shot learning.
206
+
207
+ Usage Examples
208
+ ~~~~~~~~~~~~~~
209
+
210
+ **Via Attributes**:
211
+
212
+ .. code-block:: python
213
+
214
+ from pygeai.lab.models import PromptExample
215
+
216
+ example = PromptExample(input_data="Summarize: [article]", output='{"summary": "AI news."}')
217
+ print(example.to_dict())
218
+ # Output: Dictionary with example data
219
+
220
+ **Via Dictionary**:
221
+
222
+ .. code-block:: python
223
+
224
+ from pygeai.lab.models import PromptExample
225
+
226
+ example = PromptExample(**{
227
+ "inputData": "Summarize: [article]",
228
+ "output": '{"summary": "AI news."}'
229
+ })
230
+ print(example.to_dict())
231
+ # Output: Dictionary with example data
232
+
233
+ Restrictions and Considerations
234
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235
+
236
+ - Both fields are required; output must be JSON.
237
+ - Keep examples concise and relevant.
238
+ - Multiple examples improve accuracy.
239
+ - Dictionaries simplify example setup.
240
+ - Monitor token usage with examples.
241
+
242
+ PromptOutput
243
+ ------------
244
+
245
+ Purpose
246
+ ~~~~~~~
247
+
248
+ Defines expected prompt outputs.
249
+
250
+ Usage Examples
251
+ ~~~~~~~~~~~~~~
252
+
253
+ **Via Attributes**:
254
+
255
+ .. code-block:: python
256
+
257
+ from pygeai.lab.models import PromptOutput
258
+
259
+ output = PromptOutput(key="summary", description="Text summary.")
260
+ print(output.to_dict())
261
+ # Output: {"key": "summary", "description": "Text summary."}
262
+
263
+ **Via Dictionary**:
264
+
265
+ .. code-block:: python
266
+
267
+ from pygeai.lab.models import PromptOutput
268
+
269
+ output = PromptOutput(**{
270
+ "key": "summary",
271
+ "description": "Text summary."
272
+ })
273
+ print(output.to_dict())
274
+ # Output: {"key": "summary", "description": "Text summary."}
275
+
276
+ Restrictions and Considerations
277
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278
+
279
+ - Key and description are required.
280
+ - Keys must be unique per prompt.
281
+ - Use clear descriptions for output format.
282
+ - Dictionaries streamline output definitions.
283
+ - Supports multiple outputs.
284
+
285
+ Prompt
286
+ ------
287
+
288
+ Purpose
289
+ ~~~~~~~
290
+
291
+ Configures an agent’s prompt behavior.
292
+
293
+ Usage Examples
294
+ ~~~~~~~~~~~~~~
295
+
296
+ **Via Attributes**:
297
+
298
+ .. code-block:: python
299
+
300
+ from pygeai.lab.models import Prompt, PromptOutput, PromptExample
301
+
302
+ output = PromptOutput(key="summary", description="Text summary.")
303
+ example = PromptExample(input_data="Article: [content]", output='{"summary": "AI news."}')
304
+ prompt = Prompt(instructions="Summarize article.", inputs=["article"], outputs=[output], examples=[example])
305
+ print(prompt.to_dict())
306
+ # Output: Dictionary with prompt settings
307
+
308
+ **Via Dictionary (with Outputs, Examples as dicts)**:
309
+
310
+ .. code-block:: python
311
+
312
+ from pygeai.lab.models import Prompt
313
+
314
+ prompt = Prompt(**{
315
+ "instructions": "Summarize article.",
316
+ "inputs": ["article"],
317
+ "outputs": [{"key": "summary", "description": "Text summary."}],
318
+ "examples": [{"inputData": "Article: [content]", "output": '{"summary": "AI news."}'}]
319
+ })
320
+ print(prompt.to_dict())
321
+ # Output: Dictionary with prompt settings
322
+
323
+ Restrictions and Considerations
324
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
325
+
326
+ - Instructions, inputs, and outputs are required.
327
+ - Outputs need at least one entry.
328
+ - Accepts outputs and examples as dictionaries.
329
+ - Inputs must be unique.
330
+ - Avoid unimplemented fields like context.
331
+
332
+ ModelList
333
+ ---------
334
+
335
+ Purpose
336
+ ~~~~~~~
337
+
338
+ Holds multiple model configurations.
339
+
340
+ Usage Examples
341
+ ~~~~~~~~~~~~~~
342
+
343
+ **Via Attributes**:
344
+
345
+ .. code-block:: python
346
+
347
+ from pygeai.lab.models import ModelList, Model
348
+
349
+ model = Model(name="gpt-4")
350
+ model_list = ModelList(models=[model])
351
+ print(model_list.to_dict())
352
+ # Output: List of model dictionaries
353
+
354
+ **Via Dictionary (with Models as dicts)**:
355
+
356
+ .. code-block:: python
357
+
358
+ from pygeai.lab.models import ModelList
359
+
360
+ model_list = ModelList(**{
361
+ "models": [
362
+ {"name": "gpt-4"},
363
+ {"name": "gpt-3.5"}
364
+ ]
365
+ })
366
+ print(model_list.to_dict())
367
+ # Output: List of model dictionaries
368
+
369
+ Restrictions and Considerations
370
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
371
+
372
+ - Models collection is required; can be empty.
373
+ - Accepts models as dictionaries.
374
+ - Supports iteration and appending.
375
+ - Ensure unique model names.
376
+ - Simplifies bulk model setup.
377
+
378
+ AgentData
379
+ ---------
380
+
381
+ Purpose
382
+ ~~~~~~~
383
+
384
+ Defines an agent’s core configuration.
385
+
386
+ Usage Examples
387
+ ~~~~~~~~~~~~~~
388
+
389
+ **Via Attributes**:
390
+
391
+ .. code-block:: python
392
+
393
+ from pygeai.lab.models import AgentData, Prompt, PromptOutput, LlmConfig, Sampling, ModelList, Model
394
+
395
+ prompt = Prompt(instructions="Summarize.", inputs=["text"], outputs=[PromptOutput(key="summary", description="Summary.")])
396
+ sampling = Sampling(temperature=0.7, top_k=50, top_p=0.9)
397
+ llm_config = LlmConfig(max_tokens=2048, timeout=30, sampling=sampling)
398
+ model_list = ModelList(models=[Model(name="gpt-4")])
399
+ agent_data = AgentData(prompt=prompt, llm_config=llm_config, models=model_list)
400
+ print(agent_data.to_dict())
401
+ # Output: Dictionary with agent data
402
+
403
+ **Via Dictionary (with Prompt, LlmConfig, Models as dicts)**:
404
+
405
+ .. code-block:: python
406
+
407
+ from pygeai.lab.models import AgentData
408
+
409
+ agent_data = AgentData(**{
410
+ "prompt": {
411
+ "instructions": "Summarize.",
412
+ "inputs": ["text"],
413
+ "outputs": [{"key": "summary", "description": "Summary."}]
414
+ },
415
+ "llmConfig": {
416
+ "maxTokens": 2048,
417
+ "timeout": 30,
418
+ "sampling": {"temperature": 0.7, "topK": 50, "topP": 0.9}
419
+ },
420
+ "models": [{"name": "gpt-4"}]
421
+ })
422
+ print(agent_data.to_dict())
423
+ # Output: Dictionary with agent data
424
+
425
+ Restrictions and Considerations
426
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427
+
428
+ - Core components are required.
429
+ - Accepts prompt, LLM config, and models as dictionaries.
430
+ - Non-draft agents need at least one model.
431
+ - Align settings with LLM capabilities.
432
+ - Simplifies complex agent setups.
433
+
434
+ Agent
435
+ -----
436
+
437
+ Purpose
438
+ ~~~~~~~
439
+
440
+ Represents a complete agent with metadata.
441
+
442
+ Usage Examples
443
+ ~~~~~~~~~~~~~~
444
+
445
+ **Via Attributes**:
446
+
447
+ .. code-block:: python
448
+
449
+ from pygeai.lab.models import Agent, AgentData, Prompt, PromptOutput, ModelList, Model
450
+
451
+ prompt = Prompt(instructions="Summarize.", inputs=["text"], outputs=[PromptOutput(key="summary", description="Summary.")])
452
+ model_list = ModelList(models=[Model(name="gpt-4")])
453
+ agent_data = AgentData(prompt=prompt, llm_config=LlmConfig(max_tokens=2048, timeout=30, sampling=Sampling(temperature=0.7, top_k=50, top_p=0.9)), models=model_list)
454
+ agent = Agent(name="SummaryAgent", access_scope="public", public_name="summary-agent", agent_data=agent_data)
455
+ print(agent.to_dict())
456
+ # Output: Dictionary with agent settings
457
+
458
+ **Via Dictionary (with AgentData as dict)**:
459
+
460
+ .. code-block:: python
461
+
462
+ from pygeai.lab.models import Agent
463
+
464
+ agent = Agent(**{
465
+ "name": "SummaryAgent",
466
+ "accessScope": "public",
467
+ "publicName": "summary-agent",
468
+ "agentData": {
469
+ "prompt": {
470
+ "instructions": "Summarize.",
471
+ "inputs": ["text"],
472
+ "outputs": [{"key": "summary", "description": "Summary."}]
473
+ },
474
+ "llmConfig": {
475
+ "maxTokens": 2048,
476
+ "timeout": 30,
477
+ "sampling": {"temperature": 0.7, "topK": 50, "topP": 0.9}
478
+ },
479
+ "models": [{"name": "gpt-4"}]
480
+ }
481
+ })
482
+ print(agent.to_dict())
483
+ # Output: Dictionary with agent settings
484
+
485
+ Restrictions and Considerations
486
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
487
+
488
+ - Name is required; avoid special characters.
489
+ - Accepts `agent_data` as a dictionary.
490
+ - Public agents need valid public names.
491
+ - Non-draft agents require full configuration.
492
+ - API sets identifiers automatically.
493
+
494
+ AgentList
495
+ ---------
496
+
497
+ Purpose
498
+ ~~~~~~~
499
+
500
+ Manages multiple agents, typically from API responses.
501
+
502
+ Usage Examples
503
+ ~~~~~~~~~~~~~~
504
+
505
+ **Via Attributes**:
506
+
507
+ .. code-block:: python
508
+
509
+ from pygeai.lab.models import AgentList, Agent
510
+
511
+ agent = Agent(name="Agent1", access_scope="private")
512
+ agent_list = AgentList(agents=[agent])
513
+ print(agent_list.to_dict())
514
+ # Output: List of agent dictionaries
515
+
516
+ **Via Dictionary (with Agents as dicts)**:
517
+
518
+ .. code-block:: python
519
+
520
+ from pygeai.lab.models import AgentList
521
+
522
+ agent_list = AgentList(**{
523
+ "agents": [
524
+ {"name": "Agent1", "accessScope": "private"},
525
+ {"name": "Agent2", "accessScope": "public", "publicName": "agent-two"}
526
+ ]
527
+ })
528
+ print(agent_list.to_dict())
529
+ # Output: List of agent dictionaries
530
+
531
+ Restrictions and Considerations
532
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
533
+
534
+ - Agents collection is required; can be empty.
535
+ - Accepts agents as dictionaries.
536
+ - Supports iteration and appending.
537
+ - Useful for bulk agent management.
538
+
539
+ SharingLink
540
+ -----------
541
+
542
+ Purpose
543
+ ~~~~~~~
544
+
545
+ Enables agent sharing via links.
546
+
547
+ Usage Examples
548
+ ~~~~~~~~~~~~~~
549
+
550
+ **Via Attributes**:
551
+
552
+ .. code-block:: python
553
+
554
+ from pygeai.lab.models import SharingLink
555
+
556
+ link = SharingLink(agent_id="agent-123", api_token="xyz-token", shared_link="https://lab.globant.ai/share/agent-123")
557
+ print(link.to_dict())
558
+ # Output: Dictionary with link details
559
+
560
+ **Via Dictionary**:
561
+
562
+ .. code-block:: python
563
+
564
+ from pygeai.lab.models import SharingLink
565
+
566
+ link = SharingLink(**{
567
+ "agentId": "agent-123",
568
+ "apiToken": "xyz-token",
569
+ "sharedLink": "https://lab.globant.ai/share/agent-123"
570
+ })
571
+ print(link.to_dict())
572
+ # Output: Dictionary with link details
573
+
574
+ Restrictions and Considerations
575
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
576
+
577
+ - All fields are required, set by API.
578
+ - Links must be valid URLs.
579
+ - Secure tokens to prevent leaks.
580
+ - Dictionaries simplify link creation.
581
+
582
+ ToolParameter
583
+ -------------
584
+
585
+ Purpose
586
+ ~~~~~~~
587
+
588
+ Defines tool parameters.
589
+
590
+ Usage Examples
591
+ ~~~~~~~~~~~~~~
592
+
593
+ **Via Attributes**:
594
+
595
+ .. code-block:: python
596
+
597
+ from pygeai.lab.models import ToolParameter
598
+
599
+ param = ToolParameter(key="api_key", data_type="String", description="API key.", is_required=True)
600
+ print(param.to_dict())
601
+ # Output: Dictionary with parameter details
602
+
603
+ **Via Dictionary**:
604
+
605
+ .. code-block:: python
606
+
607
+ from pygeai.lab.models import ToolParameter
608
+
609
+ param = ToolParameter(**{
610
+ "key": "api_key",
611
+ "dataType": "String",
612
+ "description": "API key.",
613
+ "isRequired": True
614
+ })
615
+ print(param.to_dict())
616
+ # Output: Dictionary with parameter details
617
+
618
+ Restrictions and Considerations
619
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
620
+
621
+ - Core fields are mandatory.
622
+ - Data types must match API expectations.
623
+ - Keys must be unique per tool.
624
+ - Dictionaries streamline parameter setup.
625
+
626
+ ToolMessage
627
+ -----------
628
+
629
+ Purpose
630
+ ~~~~~~~
631
+
632
+ Provides tool feedback messages.
633
+
634
+ Usage Examples
635
+ ~~~~~~~~~~~~~~
636
+
637
+ **Via Attributes**:
638
+
639
+ .. code-block:: python
640
+
641
+ from pygeai.lab.models import ToolMessage
642
+
643
+ message = ToolMessage(description="Invalid key.", type="error")
644
+ print(message.to_dict())
645
+ # Output: {"description": "Invalid key.", "type": "error"}
646
+
647
+ **Via Dictionary**:
648
+
649
+ .. code-block:: python
650
+
651
+ from pygeai.lab.models import ToolMessage
652
+
653
+ message = ToolMessage(**{
654
+ "description": "Invalid key.",
655
+ "type": "error"
656
+ })
657
+ print(message.to_dict())
658
+ # Output: {"description": "Invalid key.", "type": "error"}
659
+
660
+ Restrictions and Considerations
661
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
662
+
663
+ - Both fields are required.
664
+ - Types are typically "warning" or "error."
665
+ - Keep messages concise.
666
+ - Dictionaries simplify message creation.
667
+
668
+ Tool
669
+ ----
670
+
671
+ Purpose
672
+ ~~~~~~~
673
+
674
+ Configures tools for agents.
675
+
676
+ Usage Examples
677
+ ~~~~~~~~~~~~~~
678
+
679
+ **Via Attributes**:
680
+
681
+ .. code-block:: python
682
+
683
+ from pygeai.lab.models import Tool, ToolParameter
684
+
685
+ param = ToolParameter(key="api_key", data_type="String", description="API key.", is_required=True)
686
+ tool = Tool(name="WeatherTool", description="Fetches weather.", scope="api", parameters=[param])
687
+ print(tool.to_dict())
688
+ # Output: Dictionary with tool settings
689
+
690
+ **Via Dictionary (with Parameters as dicts)**:
691
+
692
+ .. code-block:: python
693
+
694
+ from pygeai.lab.models import Tool
695
+
696
+ tool = Tool(**{
697
+ "name": "WeatherTool",
698
+ "description": "Fetches weather.",
699
+ "scope": "api",
700
+ "parameters": [
701
+ {"key": "api_key", "dataType": "String", "description": "API key.", "isRequired": True}
702
+ ]
703
+ })
704
+ print(tool.to_dict())
705
+ # Output: Dictionary with tool settings
706
+
707
+ Restrictions and Considerations
708
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
709
+
710
+ - Name and description are required.
711
+ - Accepts parameters as dictionaries.
712
+ - API tools need valid OpenAPI specs.
713
+ - Public tools require valid public names.
714
+ - Ensure unique parameter keys.
715
+
716
+ ToolList
717
+ --------
718
+
719
+ Purpose
720
+ ~~~~~~~
721
+
722
+ Manages multiple tools.
723
+
724
+ Usage Examples
725
+ ~~~~~~~~~~~~~~
726
+
727
+ **Via Attributes**:
728
+
729
+ .. code-block:: python
730
+
731
+ from pygeai.lab.models import ToolList, Tool
732
+
733
+ tool = Tool(name="Tool1", description="Tool one.", scope="builtin")
734
+ tool_list = ToolList(tools=[tool])
735
+ print(tool_list.to_dict())
736
+ # Output: Dictionary with tool list
737
+
738
+ **Via Dictionary (with Tools as dicts)**:
739
+
740
+ .. code-block:: python
741
+
742
+ from pygeai.lab.models import ToolList
743
+
744
+ tool_list = ToolList(**{
745
+ "tools": [
746
+ {"name": "Tool1", "description": "Tool one.", "scope": "builtin"}
747
+ ]
748
+ })
749
+ print(tool_list.to_dict())
750
+ # Output: Dictionary with tool list
751
+
752
+ Restrictions and Considerations
753
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
754
+
755
+ - Tools collection is required; can be empty.
756
+ - Accepts tools as dictionaries.
757
+ - Supports iteration and appending.
758
+ - Simplifies bulk tool handling.
759
+
760
+ LocalizedDescription
761
+ --------------------
762
+
763
+ Purpose
764
+ ~~~~~~~
765
+
766
+ Provides multilingual strategy descriptions.
767
+
768
+ Usage Examples
769
+ ~~~~~~~~~~~~~~
770
+
771
+ **Via Attributes**:
772
+
773
+ .. code-block:: python
774
+
775
+ from pygeai.lab.models import LocalizedDescription
776
+
777
+ desc = LocalizedDescription(language="english", description="Creative strategy.")
778
+ print(desc.to_dict())
779
+ # Output: {"language": "english", "description": "Creative strategy."}
780
+
781
+ **Via Dictionary**:
782
+
783
+ .. code-block:: python
784
+
785
+ from pygeai.lab.models import LocalizedDescription
786
+
787
+ desc = LocalizedDescription(**{
788
+ "language": "english",
789
+ "description": "Creative strategy."
790
+ })
791
+ print(desc.to_dict())
792
+ # Output: {"language": "english", "description": "Creative strategy."}
793
+
794
+ Restrictions and Considerations
795
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
796
+
797
+ - Both fields are required.
798
+ - Use standard language names.
799
+ - Dictionaries simplify descriptions.
800
+ - Supports multiple languages.
801
+
802
+ ReasoningStrategy
803
+ -----------------
804
+
805
+ Purpose
806
+ ~~~~~~~
807
+
808
+ Guides agent reasoning behavior.
809
+
810
+ Usage Examples
811
+ ~~~~~~~~~~~~~~
812
+
813
+ **Via Attributes**:
814
+
815
+ .. code-block:: python
816
+
817
+ from pygeai.lab.models import ReasoningStrategy, LocalizedDescription
818
+
819
+ desc = LocalizedDescription(language="english", description="Creative strategy.")
820
+ strategy = ReasoningStrategy(name="CreativeStrategy", access_scope="public", type="addendum", localized_descriptions=[desc])
821
+ print(strategy.to_dict())
822
+ # Output: Dictionary with strategy settings
823
+
824
+ **Via Dictionary (with Descriptions as dicts)**:
825
+
826
+ .. code-block:: python
827
+
828
+ from pygeai.lab.models import ReasoningStrategy
829
+
830
+ strategy = ReasoningStrategy(**{
831
+ "name": "CreativeStrategy",
832
+ "accessScope": "public",
833
+ "type": "addendum",
834
+ "localizedDescriptions": [
835
+ {"language": "english", "description": "Creative strategy."}
836
+ ]
837
+ })
838
+ print(strategy.to_dict())
839
+ # Output: Dictionary with strategy settings
840
+
841
+ Restrictions and Considerations
842
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
843
+
844
+ - Name, scope, and type are required.
845
+ - Accepts descriptions as dictionaries.
846
+ - Scope and type depend on Lab values.
847
+ - API sets identifiers.
848
+
849
+ ReasoningStrategyList
850
+ ---------------------
851
+
852
+ Purpose
853
+ ~~~~~~~
854
+
855
+ Manages multiple reasoning strategies.
856
+
857
+ Usage Examples
858
+ ~~~~~~~~~~~~~~
859
+
860
+ **Via Attributes**:
861
+
862
+ .. code-block:: python
863
+
864
+ from pygeai.lab.models import ReasoningStrategyList, ReasoningStrategy
865
+
866
+ strategy = ReasoningStrategy(name="Strategy1", access_scope="private", type="addendum")
867
+ strategy_list = ReasoningStrategyList(strategies=[strategy])
868
+ print(strategy_list.to_dict())
869
+ # Output: List of strategy dictionaries
870
+
871
+ **Via Dictionary (with Strategies as dicts)**:
872
+
873
+ .. code-block:: python
874
+
875
+ from pygeai.lab.models import ReasoningStrategyList
876
+
877
+ strategy_list = ReasoningStrategyList(**{
878
+ "strategies": [
879
+ {"name": "Strategy1", "accessScope": "private", "type": "addendum"}
880
+ ]
881
+ })
882
+ print(strategy_list.to_dict())
883
+ # Output: List of strategy dictionaries
884
+
885
+ Restrictions and Considerations
886
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
887
+
888
+ - Strategies collection is required; can be empty.
889
+ - Accepts strategies as dictionaries.
890
+ - Supports iteration and appending.
891
+
892
+ KnowledgeBase
893
+ -------------
894
+
895
+ Purpose
896
+ ~~~~~~~
897
+
898
+ Manages process artifacts.
899
+
900
+ Usage Examples
901
+ ~~~~~~~~~~~~~~
902
+
903
+ **Via Attributes**:
904
+
905
+ .. code-block:: python
906
+
907
+ from pygeai.lab.models import KnowledgeBase
908
+
909
+ kb = KnowledgeBase(name="DocsKB", artifact_type_name=["document"])
910
+ print(kb.to_dict())
911
+ # Output: Dictionary with knowledge base settings
912
+
913
+ **Via Dictionary**:
914
+
915
+ .. code-block:: python
916
+
917
+ from pygeai.lab.models import KnowledgeBase
918
+
919
+ kb = KnowledgeBase(**{
920
+ "name": "DocsKB",
921
+ "artifactTypeName": ["document"]
922
+ })
923
+ print(kb.to_dict())
924
+ # Output: Dictionary with knowledge base settings
925
+
926
+ Restrictions and Considerations
927
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
928
+
929
+ - Name and artifact types are required.
930
+ - Dictionaries simplify setup.
931
+ - API sets identifiers.
932
+ - Ensure valid artifact types.
933
+
934
+ AgenticActivity
935
+ ---------------
936
+
937
+ Purpose
938
+ ~~~~~~~
939
+
940
+ Links tasks and agents in processes.
941
+
942
+ Usage Examples
943
+ ~~~~~~~~~~~~~~
944
+
945
+ **Via Attributes**:
946
+
947
+ .. code-block:: python
948
+
949
+ from pygeai.lab.models import AgenticActivity
950
+
951
+ activity = AgenticActivity(key="act1", name="Summarize", task_name="SummaryTask", agent_name="SummaryAgent", agent_revision_id=1)
952
+ print(activity.to_dict())
953
+ # Output: Dictionary with activity settings
954
+
955
+ **Via Dictionary**:
956
+
957
+ .. code-block:: python
958
+
959
+ from pygeai.lab.models import AgenticActivity
960
+
961
+ activity = AgenticActivity(**{
962
+ "key": "act1",
963
+ "name": "Summarize",
964
+ "taskName": "SummaryTask",
965
+ "agentName": "SummaryAgent",
966
+ "agentRevisionId": 1
967
+ })
968
+ print(activity.to_dict())
969
+ # Output: Dictionary with activity settings
970
+
971
+ Restrictions and Considerations
972
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
973
+
974
+ - Core fields are required.
975
+ - Keys must be unique.
976
+ - Dictionaries streamline activity setup.
977
+ - Reference existing tasks and agents.
978
+
979
+ ArtifactSignal
980
+ --------------
981
+
982
+ Purpose
983
+ ~~~~~~~
984
+
985
+ Triggers process actions via artifacts.
986
+
987
+ Usage Examples
988
+ ~~~~~~~~~~~~~~
989
+
990
+ **Via Attributes**:
991
+
992
+ .. code-block:: python
993
+
994
+ from pygeai.lab.models import ArtifactSignal
995
+
996
+ signal = ArtifactSignal(key="sig1", name="DocSignal", handling_type="C", artifact_type_name=["document"])
997
+ print(signal.to_dict())
998
+ # Output: Dictionary with signal settings
999
+
1000
+ **Via Dictionary**:
1001
+
1002
+ .. code-block:: python
1003
+
1004
+ from pygeai.lab.models import ArtifactSignal
1005
+
1006
+ signal = ArtifactSignal(**{
1007
+ "key": "sig1",
1008
+ "name": "DocSignal",
1009
+ "handlingType": "C",
1010
+ "artifactTypeName": ["document"]
1011
+ })
1012
+ print(signal.to_dict())
1013
+ # Output: Dictionary with signal settings
1014
+
1015
+ Restrictions and Considerations
1016
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1017
+
1018
+ - All fields are required.
1019
+ - Keys must be unique.
1020
+ - Dictionaries simplify signal setup.
1021
+ - Handling types depend on Lab engine.
1022
+
1023
+ UserSignal
1024
+ ----------
1025
+
1026
+ Purpose
1027
+ ~~~~~~~
1028
+
1029
+ Enables user-driven process signals.
1030
+
1031
+ Usage Examples
1032
+ ~~~~~~~~~~~~~~
1033
+
1034
+ **Via Attributes**:
1035
+
1036
+ .. code-block:: python
1037
+
1038
+ from pygeai.lab.models import UserSignal
1039
+
1040
+ signal = UserSignal(key="user1", name="UserInput")
1041
+ print(signal.to_dict())
1042
+ # Output: {"key": "user1", "name": "UserInput"}
1043
+
1044
+ **Via Dictionary**:
1045
+
1046
+ .. code-block:: python
1047
+
1048
+ from pygeai.lab.models import UserSignal
1049
+
1050
+ signal = UserSignal(**{
1051
+ "key": "user1",
1052
+ "name": "UserInput"
1053
+ })
1054
+ print(signal.to_dict())
1055
+ # Output: {"key": "user1", "name": "UserInput"}
1056
+
1057
+ Restrictions and Considerations
1058
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1059
+
1060
+ - Both fields are required.
1061
+ - Keys must be unique.
1062
+ - Dictionaries simplify setup.
1063
+ - Use descriptive names.
1064
+
1065
+ Event
1066
+ -----
1067
+
1068
+ Purpose
1069
+ ~~~~~~~
1070
+
1071
+ Marks process start or end points.
1072
+
1073
+ Usage Examples
1074
+ ~~~~~~~~~~~~~~
1075
+
1076
+ **Via Attributes**:
1077
+
1078
+ .. code-block:: python
1079
+
1080
+ from pygeai.lab.models import Event
1081
+
1082
+ event = Event(key="start1", name="ProcessStart")
1083
+ print(event.to_dict())
1084
+ # Output: {"key": "start1", "name": "ProcessStart"}
1085
+
1086
+ **Via Dictionary**:
1087
+
1088
+ .. code-block:: python
1089
+
1090
+ from pygeai.lab.models import Event
1091
+
1092
+ event = Event(**{
1093
+ "key": "start1",
1094
+ "name": "ProcessStart"
1095
+ })
1096
+ print(event.to_dict())
1097
+ # Output: {"key": "start1", "name": "ProcessStart"}
1098
+
1099
+ Restrictions and Considerations
1100
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1101
+
1102
+ - Both fields are required.
1103
+ - Keys must be unique.
1104
+ - Dictionaries simplify event setup.
1105
+ - Ensure flow connectivity.
1106
+
1107
+ SequenceFlow
1108
+ ------------
1109
+
1110
+ Purpose
1111
+ ~~~~~~~
1112
+
1113
+ Connects process elements.
1114
+
1115
+ Usage Examples
1116
+ ~~~~~~~~~~~~~~
1117
+
1118
+ **Via Attributes**:
1119
+
1120
+ .. code-block:: python
1121
+
1122
+ from pygeai.lab.models import SequenceFlow
1123
+
1124
+ flow = SequenceFlow(key="flow1", source_key="start1", target_key="act1")
1125
+ print(flow.to_dict())
1126
+ # Output: Dictionary with flow settings
1127
+
1128
+ **Via Dictionary**:
1129
+
1130
+ .. code-block:: python
1131
+
1132
+ from pygeai.lab.models import SequenceFlow
1133
+
1134
+ flow = SequenceFlow(**{
1135
+ "key": "flow1",
1136
+ "sourceKey": "start1",
1137
+ "targetKey": "act1"
1138
+ })
1139
+ print(flow.to_dict())
1140
+ # Output: Dictionary with flow settings
1141
+
1142
+ Restrictions and Considerations
1143
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1144
+
1145
+ - All fields are required.
1146
+ - Keys must be unique.
1147
+ - Dictionaries simplify flow setup.
1148
+ - Reference valid elements.
1149
+
1150
+ Variable
1151
+ --------
1152
+
1153
+ Purpose
1154
+ ~~~~~~~
1155
+
1156
+ Stores dynamic process data.
1157
+
1158
+ Usage Examples
1159
+ ~~~~~~~~~~~~~~
1160
+
1161
+ **Via Attributes**:
1162
+
1163
+ .. code-block:: python
1164
+
1165
+ from pygeai.lab.models import Variable
1166
+
1167
+ var = Variable(key="input_text", value="Sample text")
1168
+ print(var.to_dict())
1169
+ # Output: {"key": "input_text", "value": "Sample text"}
1170
+
1171
+ **Via Dictionary**:
1172
+
1173
+ .. code-block:: python
1174
+
1175
+ from pygeai.lab.models import Variable
1176
+
1177
+ var = Variable(**{
1178
+ "key": "input_text",
1179
+ "value": "Sample text"
1180
+ })
1181
+ print(var.to_dict())
1182
+ # Output: {"key": "input_text", "value": "Sample text"}
1183
+
1184
+ Restrictions and Considerations
1185
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1186
+
1187
+ - Both fields are required.
1188
+ - Keys should be unique.
1189
+ - Dictionaries simplify variable setup.
1190
+ - Values must be strings.
1191
+
1192
+ VariableList
1193
+ ------------
1194
+
1195
+ Purpose
1196
+ ~~~~~~~
1197
+
1198
+ Manages process variables.
1199
+
1200
+ Usage Examples
1201
+ ~~~~~~~~~~~~~~
1202
+
1203
+ **Via Attributes**:
1204
+
1205
+ .. code-block:: python
1206
+
1207
+ from pygeai.lab.models import VariableList, Variable
1208
+
1209
+ var = Variable(key="input_text", value="Sample text")
1210
+ var_list = VariableList(variables=[var])
1211
+ print(var_list.to_dict())
1212
+ # Output: List of variable dictionaries
1213
+
1214
+ **Via Dictionary (with Variables as dicts)**:
1215
+
1216
+ .. code-block:: python
1217
+
1218
+ from pygeai.lab.models import VariableList
1219
+
1220
+ var_list = VariableList(**{
1221
+ "variables": [
1222
+ {"key": "input_text", "value": "Sample text"}
1223
+ ]
1224
+ })
1225
+ print(var_list.to_dict())
1226
+ # Output: List of variable dictionaries
1227
+
1228
+ Restrictions and Considerations
1229
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1230
+
1231
+ - Variables collection is optional; defaults to empty.
1232
+ - Accepts variables as dictionaries.
1233
+ - Supports iteration and appending.
1234
+
1235
+ AgenticProcess
1236
+ --------------
1237
+
1238
+ Purpose
1239
+ ~~~~~~~
1240
+
1241
+ Orchestrates process workflows.
1242
+
1243
+ Usage Examples
1244
+ ~~~~~~~~~~~~~~
1245
+
1246
+ **Via Attributes**:
1247
+
1248
+ .. code-block:: python
1249
+
1250
+ from pygeai.lab.models import AgenticProcess, AgenticActivity, Event, SequenceFlow
1251
+
1252
+ activity = AgenticActivity(key="act1", name="Summarize", task_name="SummaryTask", agent_name="SummaryAgent", agent_revision_id=1)
1253
+ start_event = Event(key="start1", name="Start")
1254
+ flow = SequenceFlow(key="flow1", source_key="start1", target_key="act1")
1255
+ process = AgenticProcess(name="SummaryProcess", agentic_activities=[activity], start_event=start_event, sequence_flows=[flow])
1256
+ print(process.to_dict())
1257
+ # Output: Dictionary with process settings
1258
+
1259
+ **Via Dictionary (with Activities, Event, Flows as dicts)**:
1260
+
1261
+ .. code-block:: python
1262
+
1263
+ from pygeai.lab.models import AgenticProcess
1264
+
1265
+ process = AgenticProcess(**{
1266
+ "name": "SummaryProcess",
1267
+ "agenticActivities": [
1268
+ {
1269
+ "key": "act1",
1270
+ "name": "Summarize",
1271
+ "taskName": "SummaryTask",
1272
+ "agentName": "SummaryAgent",
1273
+ "agentRevisionId": 1
1274
+ }
1275
+ ],
1276
+ "startEvent": {"key": "start1", "name": "Start"},
1277
+ "sequenceFlows": [
1278
+ {"key": "flow1", "sourceKey": "start1", "targetKey": "act1"}
1279
+ ]
1280
+ })
1281
+ print(process.to_dict())
1282
+ # Output: Dictionary with process settings
1283
+
1284
+ Restrictions and Considerations
1285
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1286
+
1287
+ - Name is required; avoid special characters.
1288
+ - Accepts activities, events, and flows as dictionaries.
1289
+ - Flows must reference valid keys.
1290
+ - API sets identifiers.
1291
+ - Ensure valid process structure.
1292
+
1293
+ ArtifactType
1294
+ ------------
1295
+
1296
+ Purpose
1297
+ ~~~~~~~
1298
+
1299
+ Defines task artifacts.
1300
+
1301
+ Usage Examples
1302
+ ~~~~~~~~~~~~~~
1303
+
1304
+ **Via Attributes**:
1305
+
1306
+ .. code-block:: python
1307
+
1308
+ from pygeai.lab.models import ArtifactType
1309
+
1310
+ artifact = ArtifactType(name="document", usage_type="input")
1311
+ print(artifact.to_dict())
1312
+ # Output: Dictionary with artifact settings
1313
+
1314
+ **Via Dictionary**:
1315
+
1316
+ .. code-block:: python
1317
+
1318
+ from pygeai.lab.models import ArtifactType
1319
+
1320
+ artifact = ArtifactType(**{
1321
+ "name": "document",
1322
+ "usageType": "input"
1323
+ })
1324
+ print(artifact.to_dict())
1325
+ # Output: Dictionary with artifact settings
1326
+
1327
+ Restrictions and Considerations
1328
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1329
+
1330
+ - Name and usage type are required.
1331
+ - Usage type is "input" or "output."
1332
+ - Dictionaries simplify artifact setup.
1333
+ - Variable keys have length limits.
1334
+
1335
+ ArtifactTypeList
1336
+ ----------------
1337
+
1338
+ Purpose
1339
+ ~~~~~~~
1340
+
1341
+ Manages task artifact types.
1342
+
1343
+ Usage Examples
1344
+ ~~~~~~~~~~~~~~
1345
+
1346
+ **Via Attributes**:
1347
+
1348
+ .. code-block:: python
1349
+
1350
+ from pygeai.lab.models import ArtifactTypeList, ArtifactType
1351
+
1352
+ artifact = ArtifactType(name="document", usage_type="input")
1353
+ artifact_list = ArtifactTypeList(artifact_types=[artifact])
1354
+ print(artifact_list.to_dict())
1355
+ # Output: List of artifact dictionaries
1356
+
1357
+ **Via Dictionary (with ArtifactTypes as dicts)**:
1358
+
1359
+ .. code-block:: python
1360
+
1361
+ from pygeai.lab.models import ArtifactTypeList
1362
+
1363
+ artifact_list = ArtifactTypeList(**{
1364
+ "artifact_types": [
1365
+ {"name": "document", "usageType": "input"}
1366
+ ]
1367
+ })
1368
+ print(artifact_list.to_dict())
1369
+ # Output: List of artifact dictionaries
1370
+
1371
+ Restrictions and Considerations
1372
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1373
+
1374
+ - Artifact types collection is optional; defaults to empty.
1375
+ - Accepts artifact types as dictionaries.
1376
+ - Supports iteration and appending.
1377
+
1378
+ Task
1379
+ ----
1380
+
1381
+ Purpose
1382
+ ~~~~~~~
1383
+
1384
+ Configures agent tasks.
1385
+
1386
+ Usage Examples
1387
+ ~~~~~~~~~~~~~~
1388
+
1389
+ **Via Attributes**:
1390
+
1391
+ .. code-block:: python
1392
+
1393
+ from pygeai.lab.models import Task, Prompt, PromptOutput, ArtifactTypeList, ArtifactType
1394
+
1395
+ prompt = Prompt(instructions="Summarize.", inputs=["text"], outputs=[PromptOutput(key="summary", description="Summary.")])
1396
+ artifact = ArtifactType(name="document", usage_type="input")
1397
+ task = Task(name="SummaryTask", prompt_data=prompt, artifact_types=ArtifactTypeList(artifact_types=[artifact]))
1398
+ print(task.to_dict())
1399
+ # Output: Dictionary with task settings
1400
+
1401
+ **Via Dictionary (with Prompt, ArtifactTypes as dicts)**:
1402
+
1403
+ .. code-block:: python
1404
+
1405
+ from pygeai.lab.models import Task
1406
+
1407
+ task = Task(**{
1408
+ "name": "SummaryTask",
1409
+ "promptData": {
1410
+ "instructions": "Summarize.",
1411
+ "inputs": ["text"],
1412
+ "outputs": [{"key": "summary", "description": "Summary."}]
1413
+ },
1414
+ "artifactTypes": [
1415
+ {"name": "document", "usageType": "input"}
1416
+ ]
1417
+ })
1418
+ print(task.to_dict())
1419
+ # Output: Dictionary with task settings
1420
+
1421
+ Restrictions and Considerations
1422
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1423
+
1424
+ - Name is required; avoid special characters.
1425
+ - Accepts prompt and artifact types as dictionaries.
1426
+ - Artifact types must use valid usage types.
1427
+ - Prompt is optional but recommended.
1428
+
1429
+ AgenticProcessList
1430
+ ------------------
1431
+
1432
+ Purpose
1433
+ ~~~~~~~
1434
+
1435
+ Manages multiple processes.
1436
+
1437
+ Usage Examples
1438
+ ~~~~~~~~~~~~~~
1439
+
1440
+ **Via Attributes**:
1441
+
1442
+ .. code-block:: python
1443
+
1444
+ from pygeai.lab.models import AgenticProcessList, AgenticProcess
1445
+
1446
+ process = AgenticProcess(name="Process1")
1447
+ process_list = AgenticProcessList(processes=[process])
1448
+ print(process_list.to_dict())
1449
+ # Output: Dictionary with process list
1450
+
1451
+ **Via Dictionary (with Processes as dicts)**:
1452
+
1453
+ .. code-block:: python
1454
+
1455
+ from pygeai.lab.models import AgenticProcessList
1456
+
1457
+ process_list = AgenticProcessList(**{
1458
+ "processes": [
1459
+ {"name": "Process1"}
1460
+ ]
1461
+ })
1462
+ print(process_list.to_dict())
1463
+ # Output: Dictionary with process list
1464
+
1465
+ Restrictions and Considerations
1466
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1467
+
1468
+ - Processes collection is required; can be empty.
1469
+ - Accepts processes as dictionaries.
1470
+ - Supports iteration and appending.
1471
+
1472
+ TaskList
1473
+ --------
1474
+
1475
+ Purpose
1476
+ ~~~~~~~
1477
+
1478
+ Manages multiple tasks.
1479
+
1480
+ Usage Examples
1481
+ ~~~~~~~~~~~~~~
1482
+
1483
+ **Via Attributes**:
1484
+
1485
+ .. code-block:: python
1486
+
1487
+ from pygeai.lab.models import TaskList, Task
1488
+
1489
+ task = Task(name="Task1")
1490
+ task_list = TaskList(tasks=[task])
1491
+ print(task_list.to_dict())
1492
+ # Output: List of task dictionaries
1493
+
1494
+ **Via Dictionary (with Tasks as dicts)**:
1495
+
1496
+ .. code-block:: python
1497
+
1498
+ from pygeai.lab.models import TaskList
1499
+
1500
+ task_list = TaskList(**{
1501
+ "tasks": [
1502
+ {"name": "Task1"}
1503
+ ]
1504
+ })
1505
+ print(task_list.to_dict())
1506
+ # Output: List of task dictionaries
1507
+
1508
+ Restrictions and Considerations
1509
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1510
+
1511
+ - Tasks collection is required; can be empty.
1512
+ - Accepts tasks as dictionaries.
1513
+ - Supports iteration and appending.
1514
+
1515
+ ProcessInstance
1516
+ ---------------
1517
+
1518
+ Purpose
1519
+ ~~~~~~~
1520
+
1521
+ Tracks running process instances.
1522
+
1523
+ Usage Examples
1524
+ ~~~~~~~~~~~~~~
1525
+
1526
+ **Via Attributes**:
1527
+
1528
+ .. code-block:: python
1529
+
1530
+ from pygeai.lab.models import ProcessInstance, AgenticProcess
1531
+
1532
+ process = AgenticProcess(name="SummaryProcess")
1533
+ instance = ProcessInstance(process=process, subject="Summary")
1534
+ print(instance.to_dict())
1535
+ # Output: Dictionary with instance settings
1536
+
1537
+ **Via Dictionary (with Process as dict)**:
1538
+
1539
+ .. code-block:: python
1540
+
1541
+ from pygeai.lab.models import ProcessInstance
1542
+
1543
+ instance = ProcessInstance(**{
1544
+ "process": {"name": "SummaryProcess"},
1545
+ "subject": "Summary"
1546
+ })
1547
+ print(instance.to_dict())
1548
+ # Output: Dictionary with instance settings
1549
+
1550
+ Restrictions and Considerations
1551
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1552
+
1553
+ - Process and subject are required.
1554
+ - Accepts process as a dictionary.
1555
+ - API sets identifiers.
1556
+ - Align variables with process needs.
1557
+
1558
+ ProcessInstanceList
1559
+ -------------------
1560
+
1561
+ Purpose
1562
+ ~~~~~~~
1563
+
1564
+ Manages multiple process instances.
1565
+
1566
+ Usage Examples
1567
+ ~~~~~~~~~~~~~~
1568
+
1569
+ **Via Attributes**:
1570
+
1571
+ .. code-block:: python
1572
+
1573
+ from pygeai.lab.models import ProcessInstanceList, ProcessInstance, AgenticProcess
1574
+
1575
+ process = AgenticProcess(name="Process1")
1576
+ instance = ProcessInstance(process=process, subject="Instance1")
1577
+ instance_list = ProcessInstanceList(instances=[instance])
1578
+ print(instance_list.to_dict())
1579
+ # Output: List of instance dictionaries
1580
+
1581
+ **Via Dictionary (with Instances as dicts)**:
1582
+
1583
+ .. code-block:: python
1584
+
1585
+ from pygeai.lab.models import ProcessInstanceList
1586
+
1587
+ instance_list = ProcessInstanceList(**{
1588
+ "instances": [
1589
+ {"process": {"name": "Process1"}, "subject": "Instance1"}
1590
+ ]
1591
+ })
1592
+ print(instance_list.to_dict())
1593
+ # Output: List of instance dictionaries
1594
+
1595
+ Restrictions and Considerations
1596
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1597
+
1598
+ - Instances collection is required; can be empty.
1599
+ - Accepts instances as dictionaries.
1600
+ - Supports iteration and appending.