class GeminiAutoGenFramework: « » » Complete AutoGen framework using free Gemini API Supports multi-agent conversations, code execution, and retrieval « » » def __init__(self, gemini_api_key: str): « » »Initialize with Gemini API key » » » self.gemini_api_key = gemini_api_key self.setup_gemini_config() self.agents: Dict[str, autogen.Agent] = {} self.group_chats: Dict[str, GroupChat] = {} def setup_gemini_config(self): « » »Configure Gemini for AutoGen » » » os.environ[« GOOGLE_API_KEY »] = self.gemini_api_key self.llm_config = { « config_list »: [ { « model »: « gemini/gemini-1.5-flash », « api_key »: self.gemini_api_key, « api_type »: « google », « temperature »: 0.7, « max_tokens »: 4096, } ], « timeout »: 120, « cache_seed »: 42, } self.llm_config_pro = { « config_list »: [ { « model »: « gemini/gemini-1.5-pro », « api_key »: self.gemini_api_key, « api_type »: « google », « temperature »: 0.5, « max_tokens »: 8192, } ], « timeout »: 180, « cache_seed »: 42, } def create_assistant_agent(self, name: str,…
Read More