Created
February 4, 2024 23:06
-
-
Save business24ai/4d579655bed5c661ff03424cd87983b9 to your computer and use it in GitHub Desktop.
AutoGen local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json | |
config_list_paid = [ | |
{ | |
"model": "gpt-4-1106-preview", | |
"api_key": "YOUR-KEY" | |
} | |
] | |
config_list_free = [ | |
{ | |
"api_base": "http://localhost:1234/v1", | |
"api_key": "null" | |
} | |
] | |
llm_config= { | |
"request_timeout": 300, | |
"seed": 43, | |
"config_list": config_list_free, | |
"temperature": 0 | |
} | |
assistant = AssistantAgent( | |
name = "assistant", | |
system_message = "You are a python coder", | |
llm_config=llm_config | |
) | |
user_proxy = UserProxyAgent( | |
name = "user_proxy", | |
llm_config=llm_config, | |
system_message = "You are an Administrator", | |
code_execution_config={"work_dir": "coding"}, | |
human_input_mode="ALWAYS" | |
) | |
user_proxy.initiate_chat( | |
assistant, | |
message="Write a code snippet to check if a string is a valid ip address." | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment