Skip to content

Instantly share code, notes, and snippets.

@business24ai
Created February 4, 2024 23:06
Show Gist options
  • Save business24ai/4d579655bed5c661ff03424cd87983b9 to your computer and use it in GitHub Desktop.
Save business24ai/4d579655bed5c661ff03424cd87983b9 to your computer and use it in GitHub Desktop.
AutoGen local
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