Skip to main content

AgentOptimizer

Base class for optimizing AG2 agents. Specifically, it is used to optimize the functions used in the agent.
More information could be found in the following paper: https://arxiv.org/abs/2402.11359.
(These APIs are experimental and may change in the future.)
Parameters:

Instance Methods

record_one_conversation

Record one conversation history.
Parameters:

reset_optimizer

Reset the optimizer.

step

One step of training. It will return register_for_llm and register_for_executor at each iteration, which are subsequently utilized to update the assistant and executor agents, respectively.
See example: https://github.com/ag2ai/ag2/blob/main/notebook/agentchat_agentoptimizer.ipynb