Runs the optimizer. Args: initial_agent: The initial agent to be optimized. sampler: The interface used to get training and validation example UIDs, request agent evaluations, and get useful data for optimizing the agent. Returns: The final result of the optimizat
(
self,
initial_agent: Agent,
sampler: Sampler[SamplingResultT],
)
| 30 | |
| 31 | @abstractmethod |
| 32 | async def optimize( |
| 33 | self, |
| 34 | initial_agent: Agent, |
| 35 | sampler: Sampler[SamplingResultT], |
| 36 | ) -> OptimizerResult[AgentWithScoresT]: |
| 37 | """Runs the optimizer. |
| 38 | |
| 39 | Args: |
| 40 | initial_agent: The initial agent to be optimized. |
| 41 | sampler: The interface used to get training and validation example UIDs, |
| 42 | request agent evaluations, and get useful data for optimizing the agent. |
| 43 | |
| 44 | Returns: |
| 45 | The final result of the optimization process, containing the optimized |
| 46 | agent instances along with their corresponding scores on the validation |
| 47 | examples and any optimization metadata. |
| 48 | """ |
| 49 | ... |