└── app.py /app.py: -------------------------------------------------------------------------------- 1 | #install these two libraries 2 | # pip install pyautogen 3 | # pip install xgboost 4 | 5 | from autogen import AssistantAgent, UserProxyAgent 6 | 7 | # config_list = [ 8 | # { 9 | # 'model': 'gpt-4-0613', 10 | # 'api_key': 'YOUR OPENAI API KEY: NOT REQUIRED' 11 | # } 12 | # ] 13 | 14 | config_list = [{ 15 | "api_type" : "open_ai", 16 | "api_base" : "http://localhost:1234/v1", 17 | "api_key" : "NULL" 18 | } 19 | ] 20 | 21 | llm_config = {'config_list': config_list} 22 | 23 | #create an instance of AssistanAgent 24 | assistant = AssistantAgent( 25 | name = "assistant", 26 | llm_config=llm_config, 27 | ) 28 | 29 | #create an instance of UserProxyAgent 30 | user_proxy = UserProxyAgent( 31 | name="user_proxy", 32 | human_input_mode="NEVER", 33 | max_consecutive_auto_reply=100, 34 | 35 | ) 36 | 37 | 38 | # user_proxy.initiate_chat( 39 | # assistant, 40 | # message = """Write me a python function to print the number 1 though 30""" 41 | # ) 42 | 43 | user_proxy.initiate_chat( 44 | assistant, 45 | message = """Write me a python function to check for prime number and the check for the number 79""" 46 | ) 47 | 48 | 49 | # user_proxy.initiate_chat( 50 | # assistant, 51 | # message = """Write a python code for a snake game""" 52 | 53 | # ) --------------------------------------------------------------------------------