import os
import trulayer
from autogen import AssistantAgent, UserProxyAgent
from trulayer.instruments.autogen import instrument_autogen
trulayer.init(api_key=os.environ["TRULAYER_API_KEY"], project_name="my-app")
assistant = AssistantAgent(
name="assistant",
llm_config={"model": "gpt-4o-mini"},
)
user = UserProxyAgent(name="user", human_input_mode="NEVER", max_consecutive_auto_reply=1)
with trulayer.trace("autogen-chat") as trace:
instrument_autogen(assistant, trace)
instrument_autogen(user, trace)
user.initiate_chat(assistant, message="What is the capital of France?")