A2 DLNN

Autogen

Agents

Different agents and thier scirpts:

Assistant agent:
assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})
The AssistantAgent is designed to act as an AI assistant, using LLMs by default but not requiring human input or code execution. It could write Python code (in a Python coding block) for a user to execute when a message (typically a description of a task that needs to be solved) is received. Under the hood, the Python code is written by LLM (e.g., GPT-4). It can also receive the execution results and suggest corrections or bug fixes. Its behavior can be altered by passing a new system message. The LLM configuration can be configured via llm_config.
User Proxy agent
user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding"})
The UserProxyAgent is conceptually a proxy agent for humans, soliciting human input as the agent's reply at each interaction turn by default and also having the capability to execute code and call functions. The UserProxyAgent triggers code execution automatically when it detects an executable code block in the received message and no human user input is provided. Code execution can be disabled by setting the code_execution_config parameter to False. LLM-based response is disabled by default. It can be enabled by setting llm_config to a dict corresponding to the configuration. When llm_config is set as a dictionary, UserProxyAgent can generate replies using an LLM when code execution is not performed.
assistant = autogen.AssistantAgent(
"George",
llm_config=llm_config,
system_message="The legendary George Hotz is here to help you with your coding problems."
)

assistant = autogen.AssistantAgent(
"Lex",
llm_config=llm_config,
system_message="The legendary Lex Fridman is here to help you with your coding problems."
)


Setup:


import autogen

config_list = [
{
'model': 'gpt-4', 'api_key': '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'
}
]

llm_config = {
"request_timeout": 600,
"seed": 42,
"config_list": config_list,
"temperature": 0.7
}

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.