microsoft / FLAML

A fast library for AutoML and tuning. Join our Discord: https://discord.gg/Cppx2vSPVP.
https://microsoft.github.io/FLAML/
MIT License
3.92k stars 510 forks source link

use Python decorator to simplify the registration process #1167

Closed sonichi closed 1 year ago

sonichi commented 1 year ago
          This design is great, which can help many applications and agents in multi-agent scenarios.
  1. Can we use Python decorator to simplify the registration process? (Not a big issue. Just thinking loud).
    class ChildAgent(ResponsiveAgent):
     @register(MathAgent)
     def reponse_for_math_agent(...):
           ...
  2. Why use "class_type" as a decision variable. The agent's name can ne another thing to consider (e.g., in the OptiGuide example, where both Writer and Safeguard are ResponsiveAgent).

_Originally posted by @BeibinLi in https://github.com/microsoft/FLAML/pull/1165#discussion_r1282221107_