mlflow.autogen
- mlflow.autogen.autolog(log_traces: bool = True, disable: bool = False, silent: bool = False)[source]
Note
Experimental: This function may change or be removed in a future release without warning.
Note
Autologging is known to be compatible with the following package versions:
0.4.9
<=autogen-agentchat
<=0.5.7
. Autologging may not succeed when used with package versions outside of this range.Enables (or disables) and configures autologging for AutoGen flavor. Due to its patch design, this method needs to be called after importing AutoGen classes.
- Parameters
log_traces – If
True
, traces are logged for AutoGen models. IfFalse
, no traces are collected during inference. Default toTrue
.disable – If
True
, disables the AutoGen autologging. Default toFalse
.silent – If
True
, suppress all event logs and warnings from MLflow during AutoGen autologging. IfFalse
, show all events and warnings.
Example:
import mlflow from autogen_agentchat.agents import AssistantAgent from autogen_ext.models.openai import OpenAIChatCompletionClient mlflow.autogen.autolog() agent = AssistantAgent("assistant", OpenAIChatCompletionClient(model="gpt-4o-mini")) result = await agent.run(task="Say 'Hello World!'") print(result)