opto.utils.llm.AutoGenLLM

opto.utils.llm.AutoGenLLM#

class AutoGenLLM[source]#

This is the main class Trace uses to interact with the model. It is a wrapper around autogen’s OpenAIWrapper. For using models not supported by autogen, subclass AutoGenLLM and override the _factory and create method. Users can pass instances of this class to optimizers’ llm argument.

Parameters:
  • factory – A function that takes no arguments and returns a model that is callable.

  • reset_freq – The number of seconds after which the model should be refreshed. If None, the model is never refreshed.

Attributes

model

Methods

create(**config)

Make a completion for a given config using available clients.

__init__(config_list: List | None = None, filter_dict: Dict | None = None, reset_freq: int | None = None) None[source]#
Parameters:
  • factory – A function that takes no arguments and returns a model that is callable.

  • reset_freq – The number of seconds after which the model should be refreshed. If None, the model is never refreshed.

__new__(**kwargs)#