relai 0.3.4__py3-none-any.whl → 0.3.5__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.
Potentially problematic release.
This version of relai might be problematic. Click here for more details.
- relai/maestro/optimizer.py +15 -12
- {relai-0.3.4.dist-info → relai-0.3.5.dist-info}/METADATA +4 -4
- {relai-0.3.4.dist-info → relai-0.3.5.dist-info}/RECORD +6 -6
- {relai-0.3.4.dist-info → relai-0.3.5.dist-info}/WHEEL +0 -0
- {relai-0.3.4.dist-info → relai-0.3.5.dist-info}/licenses/LICENSE.md +0 -0
- {relai-0.3.4.dist-info → relai-0.3.5.dist-info}/top_level.txt +0 -0
relai/maestro/optimizer.py
CHANGED
|
@@ -160,7 +160,7 @@ class Maestro:
|
|
|
160
160
|
return str(agent_outputs)
|
|
161
161
|
|
|
162
162
|
async def _evaluate(
|
|
163
|
-
self, awaitables: list[Awaitable], criticos: list[Critico], verbose: bool =
|
|
163
|
+
self, awaitables: list[Awaitable], criticos: list[Critico], verbose: bool = True, print_flag: str = ""
|
|
164
164
|
) -> tuple[list[dict[str, Any]], list[AgentLog]]:
|
|
165
165
|
"""
|
|
166
166
|
Run and evaluate the current version of the agent through a set of awaitables.
|
|
@@ -169,7 +169,7 @@ class Maestro:
|
|
|
169
169
|
awaitables (list[Awaitable]): A list of awaitables, each representing a run of the agent
|
|
170
170
|
criticos (list[Critico]): A list of Critico objects, each corresponding to an awaitable
|
|
171
171
|
verbose (bool): If True, additional information will be printed during evaluation.
|
|
172
|
-
Defaults to
|
|
172
|
+
Defaults to True.
|
|
173
173
|
print_flag (str): A string to be put next to the printed info when `verbose` is True.
|
|
174
174
|
Used to distinguish printed info from different types of evaluations.
|
|
175
175
|
|
|
@@ -227,7 +227,7 @@ class Maestro:
|
|
|
227
227
|
self,
|
|
228
228
|
batch_size: int,
|
|
229
229
|
sampler: ProportionalSampler,
|
|
230
|
-
verbose: bool =
|
|
230
|
+
verbose: bool = True,
|
|
231
231
|
group_id: str | None = None,
|
|
232
232
|
pbar: tqdm | None = None,
|
|
233
233
|
) -> bool:
|
|
@@ -244,7 +244,7 @@ class Maestro:
|
|
|
244
244
|
`batch_size` of them will be used for preliminary examinations.
|
|
245
245
|
sampler (ProportionalSampler): Sampler to use for selecting setups.
|
|
246
246
|
verbose (bool): If True, additional information will be printed during the iterate step.
|
|
247
|
-
Defaults to
|
|
247
|
+
Defaults to True.
|
|
248
248
|
group_id (str, optional): An optional group ID to associate all runs together. If not provided,
|
|
249
249
|
a new UUID will be generated.
|
|
250
250
|
pbar (tqdm, optional): A progress bar to display the progress of the iteration. Defaults to None.
|
|
@@ -376,7 +376,7 @@ class Maestro:
|
|
|
376
376
|
batch_size: int = 8,
|
|
377
377
|
explore_radius: int = 5,
|
|
378
378
|
explore_factor: float = 0.5,
|
|
379
|
-
verbose: bool =
|
|
379
|
+
verbose: bool = True,
|
|
380
380
|
):
|
|
381
381
|
"""
|
|
382
382
|
Optimize the configs (parameters) of the agent.
|
|
@@ -392,7 +392,7 @@ class Maestro:
|
|
|
392
392
|
while a lower value allocates more rollouts to ensure the discovered configs are thoroughly evaluated.
|
|
393
393
|
Defaults to 0.5.
|
|
394
394
|
verbose (bool): If True, related information will be printed during the optimization step.
|
|
395
|
-
Defaults to
|
|
395
|
+
Defaults to True.
|
|
396
396
|
|
|
397
397
|
Raises:
|
|
398
398
|
ValueError: If the input parameters are not valid.
|
|
@@ -414,7 +414,7 @@ class Maestro:
|
|
|
414
414
|
num_rounds: int = int(total_rollouts / (iterate_steps * group_size * 4 + select_steps * group_size))
|
|
415
415
|
total_rollouts = num_rounds * (iterate_steps * group_size * 4 + select_steps * group_size)
|
|
416
416
|
|
|
417
|
-
print("optimize_config settings
|
|
417
|
+
print("\n" + "=" * 30 + "optimize_config settings" + "=" * 30)
|
|
418
418
|
print(" total_rollouts: ", total_rollouts)
|
|
419
419
|
print(" (adjusted) batch_size: ", group_size * 2)
|
|
420
420
|
print(" explore_radius: ", explore_radius)
|
|
@@ -577,7 +577,10 @@ class Maestro:
|
|
|
577
577
|
if self.log_to_platform:
|
|
578
578
|
await sync_to_platform()
|
|
579
579
|
print(
|
|
580
|
-
|
|
580
|
+
(
|
|
581
|
+
f"Results of round {round + 1}/{num_rounds} uploaded to RELAI platform, "
|
|
582
|
+
f"visualization id: {self.config_opt_viz_id}\n\n\n"
|
|
583
|
+
)
|
|
581
584
|
)
|
|
582
585
|
|
|
583
586
|
async def optimize_structure(
|
|
@@ -585,7 +588,7 @@ class Maestro:
|
|
|
585
588
|
total_rollouts: int,
|
|
586
589
|
description: Optional[str] = None,
|
|
587
590
|
code_paths: Optional[list[str]] = None,
|
|
588
|
-
verbose: bool =
|
|
591
|
+
verbose: bool = True,
|
|
589
592
|
) -> str:
|
|
590
593
|
"""
|
|
591
594
|
Propose structural changes (i.e. changes that cannot be achieved by setting parameters alone) to
|
|
@@ -599,13 +602,13 @@ class Maestro:
|
|
|
599
602
|
code_paths (list[str], optional): A list of paths corresponding to code files containing
|
|
600
603
|
the implementation of the agent.
|
|
601
604
|
verbose (bool): If True, additional information will be printed during the optimization.
|
|
602
|
-
Defaults to
|
|
605
|
+
Defaults to True.
|
|
603
606
|
|
|
604
607
|
Returns:
|
|
605
608
|
str: Suggestion for structural changes to the agent.
|
|
606
609
|
"""
|
|
607
610
|
|
|
608
|
-
print("optimize_structure settings
|
|
611
|
+
print("\n" + "=" * 30 + "optimize_structure settings" + "=" * 30)
|
|
609
612
|
print(" total_rollouts: ", total_rollouts)
|
|
610
613
|
print("=" * 80 + "\n\n")
|
|
611
614
|
|
|
@@ -674,6 +677,6 @@ class Maestro:
|
|
|
674
677
|
|
|
675
678
|
if self.log_to_platform:
|
|
676
679
|
uid = await sync_to_platform()
|
|
677
|
-
print(f"Results uploaded to RELAI platform, visualization id: {uid}")
|
|
680
|
+
print(f"Results uploaded to RELAI platform, visualization id: {uid}\n\n\n")
|
|
678
681
|
|
|
679
682
|
return suggestion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: relai
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: An SDK for building reliable AI agents
|
|
5
5
|
Author-email: RELAI <priyatham@relai.ai>, RELAI <wwx@relai.ai>
|
|
6
6
|
License: Apache License
|
|
@@ -236,7 +236,7 @@ Dynamic: license-file
|
|
|
236
236
|
</p>
|
|
237
237
|
|
|
238
238
|
|
|
239
|
-
**RELAI** is
|
|
239
|
+
**RELAI** is a platform for building **reliable AI agents**. It streamlines the hardest parts of agent development—**simulation**, **evaluation**, and **optimization**—so you can iterate quickly with confidence.
|
|
240
240
|
|
|
241
241
|
**What you get**
|
|
242
242
|
- **Agent Simulation** — Create full/partial environments, define LLM personas, mock MCP servers & tools, and generate synthetic data. Optionally condition simulation on real samples to better match production.
|
|
@@ -373,7 +373,7 @@ async def main() -> None:
|
|
|
373
373
|
batch_size=2, # Base batch size to use for individual optimization steps. Defaults to 4.
|
|
374
374
|
explore_radius=1, # A positive integer controlling the aggressiveness of exploration during optimization.
|
|
375
375
|
explore_factor=0.5, # A float between 0 to 1 controlling the exploration-exploitation trade-off.
|
|
376
|
-
verbose=
|
|
376
|
+
verbose=True, # If True, additional information will be printed during the optimization step.
|
|
377
377
|
)
|
|
378
378
|
params.save("saved_config.json") # save optimized params for future usage
|
|
379
379
|
|
|
@@ -384,7 +384,7 @@ async def main() -> None:
|
|
|
384
384
|
await maestro.optimize_structure(
|
|
385
385
|
total_rollouts=10, # Total number of rollouts to use for optimization.
|
|
386
386
|
code_paths=["stock-assistant.py"], # A list of paths corresponding to code implementations of the agent.
|
|
387
|
-
verbose=
|
|
387
|
+
verbose=True, # If True, additional information will be printed during the optimization step.
|
|
388
388
|
)
|
|
389
389
|
|
|
390
390
|
|
|
@@ -13,7 +13,7 @@ relai/critico/critico.py,sha256=J1ek9v2J5WBnHnZknZEVppIrWGczVHxuRX7ghK6mpXM,7616
|
|
|
13
13
|
relai/critico/evaluate.py,sha256=Bd-Hlsh2fz2AQ0SINoyqcdpdbWK2t8yrAPHv6UCueFY,31348
|
|
14
14
|
relai/maestro/__init__.py,sha256=NVXy0v7yghGwGbtsPti4gQGtVA3vMgXdpIpiJUesqME,186
|
|
15
15
|
relai/maestro/graph.py,sha256=SyY0rHzes3o5bSqlK66CQDUAeyChUhWJQM3FzJCBvfs,1850
|
|
16
|
-
relai/maestro/optimizer.py,sha256=
|
|
16
|
+
relai/maestro/optimizer.py,sha256=irefqbtD5qfPt2QOQaQwd8bsC3uhx7HdNF9d3KDHgD4,29549
|
|
17
17
|
relai/maestro/params.py,sha256=-0Dtk23ClHJR6Q-PsaKr-GwUylz0-BIIquJF2eA-p-I,8925
|
|
18
18
|
relai/maestro/utils.py,sha256=WIE3cR8EMDVfAJozEfngh8DfOQdRPZMxxtN-M1cMmxo,7276
|
|
19
19
|
relai/mocker/__init__.py,sha256=JP2xlSG6Szc0tSEiZzCN6UXdE66uy7AmRn-p358xFVM,102
|
|
@@ -21,8 +21,8 @@ relai/mocker/base_mocker.py,sha256=BL4WYtdxWHZdKICfo9idW5i5MrkoxJDElcoeGk-jaJM,9
|
|
|
21
21
|
relai/mocker/persona.py,sha256=q2A_lwYrp7H6sKkguMIPl7FQ_6pL4kTaxGBJ1kU2aGA,6678
|
|
22
22
|
relai/mocker/tool.py,sha256=dHXkVcD9D6HMNlBj13V7GTgW_99a_-3tf9rC6iLDFn8,2229
|
|
23
23
|
relai/schema/visual.py,sha256=Y6BP5CHxLU0e7sTfNjgKmG2GD0R9a8rvITusxd-d-UE,2443
|
|
24
|
-
relai-0.3.
|
|
25
|
-
relai-0.3.
|
|
26
|
-
relai-0.3.
|
|
27
|
-
relai-0.3.
|
|
28
|
-
relai-0.3.
|
|
24
|
+
relai-0.3.5.dist-info/licenses/LICENSE.md,sha256=UNo7WT0mbmbUFjRGzRGaBtybmBPB7xd2ls9tfCkv0oc,10979
|
|
25
|
+
relai-0.3.5.dist-info/METADATA,sha256=ZvzLQHneMR6jcqD-taaKkh9BX93xMHX_LL64AqNnM2U,23533
|
|
26
|
+
relai-0.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
relai-0.3.5.dist-info/top_level.txt,sha256=pRyA93fRj-HsukRNHyS4sHdvLO4TY8VvBMK44KcxRA4,6
|
|
28
|
+
relai-0.3.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|