Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autogen/agentchat/contrib/agent_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def execute_func(name, packages, code, **args):


class AgentOptimizer:
"""Base class for optimizing AutoGen agents. Specifically, it is used to optimize the functions used in the agent.
"""Base class for optimizing AG2 agents. Specifically, it is used to optimize the functions used in the agent.
More information could be found in the following paper: https://arxiv.org/abs/2402.11359.
"""

Expand Down
2 changes: 1 addition & 1 deletion autogen/agentchat/contrib/gpt_assistant_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


class GPTAssistantAgent(ConversableAgent):
"""An experimental AutoGen agent class that leverages the OpenAI Assistant API for conversational capabilities.
"""An experimental AG2 agent class that leverages the OpenAI Assistant API for conversational capabilities.
This agent is unique in its reliance on the OpenAI Assistant for state management, differing from other agents like ConversableAgent.
"""

Expand Down
2 changes: 1 addition & 1 deletion autogen/logger/base_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def log_chat_completion(
) -> None:
"""Log a chat completion to database.

In AutoGen, chat completions are somewhat complicated because they are handled by the `autogen.oai.OpenAIWrapper` class.
In AG2, chat completions are somewhat complicated because they are handled by the `autogen.oai.OpenAIWrapper` class.
One invocation to `create` can lead to multiple underlying OpenAI calls, depending on the llm_config list used, and
any errors or retries.

Expand Down
4 changes: 2 additions & 2 deletions autogen/oai/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def parse_params(self, params: dict[str, Any]) -> tuple[dict[str, Any], dict[str
return base_params, additional_params

def create(self, params) -> ChatCompletion:
"""Run Amazon Bedrock inference and return AutoGen response"""
"""Run Amazon Bedrock inference and return AG2 response"""
# Set custom client class settings
self.parse_custom_params(params)

Expand Down Expand Up @@ -522,7 +522,7 @@ def format_tools(tools: list[dict[str, Any]]) -> dict[Literal["tools"], list[dic


def format_tool_calls(content):
"""Converts Converse API response tool calls to AutoGen format"""
"""Converts Converse API response tool calls to AG2 format"""
tool_calls = []
for tool_request in content:
if "toolUse" in tool_request:
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/cerebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def parse_params(self, params: dict[str, Any]) -> dict[str, Any]:
def create(self, params: dict) -> ChatCompletion:
messages = params.get("messages", [])

# Convert AutoGen messages to Cerebras messages
# Convert AG2 messages to Cerebras messages
cerebras_messages = oai_messages_to_cerebras_messages(messages)

# Parse parameters to the Cerebras API's parameters
Expand Down
6 changes: 3 additions & 3 deletions autogen/oai/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def create(self, params: dict) -> ChatCompletion:
# Parse parameters to the Cohere API's parameters
cohere_params = self.parse_params(params)

# Convert AutoGen messages to Cohere messages
# Convert AG2 messages to Cohere messages
cohere_messages, preamble, final_message = oai_messages_to_cohere_messages(messages, params, cohere_params)

cohere_params["chat_history"] = cohere_messages
Expand Down Expand Up @@ -292,8 +292,8 @@ def oai_messages_to_cohere_messages(
We correct for any specific role orders and types.

Parameters:
messages: list[Dict[str, Any]]: AutoGen messages
params: Dict[str, Any]: AutoGen parameters dictionary
messages: list[Dict[str, Any]]: AG2 messages
params: Dict[str, Any]: AG2 parameters dictionary
cohere_params: Dict[str, Any]: Cohere parameters dictionary

Returns:
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def create(self, params: dict) -> ChatCompletion:
return response_oai

def _oai_content_to_gemini_content(self, message: dict[str, Any]) -> tuple[list[Any], str]:
"""Convert AutoGen content to Gemini parts, catering for text and tool calls"""
"""Convert AG2 content to Gemini parts, catering for text and tool calls"""
rst = []

if "role" in message and message["role"] == "tool":
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/groq.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def parse_params(self, params: dict[str, Any]) -> dict[str, Any]:
def create(self, params: dict) -> ChatCompletion:
messages = params.get("messages", [])

# Convert AutoGen messages to Groq messages
# Convert AG2 messages to Groq messages
groq_messages = oai_messages_to_groq_messages(messages)

# Parse parameters to the Groq API's parameters
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def get_usage(response: ChatCompletion) -> dict:

@require_optional_import("mistralai", "mistral")
def tool_def_to_mistral(tool_definitions: list[dict[str, Any]]) -> list[dict[str, Any]]:
"""Converts AutoGen tool definition to a mistral tool format"""
"""Converts AG2 tool definition to a mistral tool format"""
mistral_tools = []

for autogen_tool in tool_definitions:
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/together.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def parse_params(self, params: dict[str, Any]) -> dict[str, Any]:
def create(self, params: dict) -> ChatCompletion:
messages = params.get("messages", [])

# Convert AutoGen messages to Together.AI messages
# Convert AG2 messages to Together.AI messages
together_messages = oai_messages_to_together_messages(messages)

# Parse parameters to Together.AI API's parameters
Expand Down
2 changes: 1 addition & 1 deletion notebook/JSON_mode_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"\n",
"## Requirements\n",
"JSON mode is a feature of OpenAI API, however strong models (such as Claude 3 Opus), can generate appropriate json as well.\n",
"AutoGen requires `Python>=3.9`. To run this notebook example, please install:\n",
"AG2 requires `Python>=3.9`. To run this notebook example, please install:\n",
"```bash\n",
"pip install autogen\n",
"```"
Expand Down
2 changes: 1 addition & 1 deletion notebook/agentchat_MathChat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Auto Generated Agent Chat: Using MathChat to Solve Math Problems\n",
"\n",
"AutoGen offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation. Please find documentation about this feature [here](https://docs.ag2.ai/docs/Use-Cases/agent_chat).\n",
"AG2 offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation. Please find documentation about this feature [here](https://docs.ag2.ai/docs/Use-Cases/agent_chat).\n",
"\n",
"MathChat is an experimental conversational framework for math problem solving. In this notebook, we demonstrate how to use MathChat to solve math problems. MathChat uses the `AssistantAgent` and `MathUserProxyAgent`, which is similar to the usage of `AssistantAgent` and `UserProxyAgent` in other notebooks (e.g., [Automated Task Solving with Code Generation, Execution & Debugging](https://github.com/ag2ai/ag2/blob/main/notebook/agentchat_auto_feedback_from_code_execution.ipynb)). Essentially, `MathUserProxyAgent` implements a different auto reply mechanism corresponding to the MathChat prompts. You can find more details in the paper [An Empirical Study on Challenging Math Problem Solving with GPT-4](https://arxiv.org/abs/2306.01337) or the [blogpost](https://docs.ag2.ai/blog/2023-06-28-MathChat).\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_RetrieveChat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Using RetrieveChat for Retrieve Augmented Code Generation and Question Answering\n",
"\n",
"AutoGen offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n",
"AG2 offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n",
"Please find documentation about this feature [here](https://docs.ag2.ai/docs/Use-Cases/agent_chat).\n",
"\n",
"RetrieveChat is a conversational system for retrieval-augmented code generation and question answering. In this notebook, we demonstrate how to utilize RetrieveChat to generate code and answer questions based on customized documentations that are not present in the LLM's training dataset. RetrieveChat uses the `AssistantAgent` and `RetrieveUserProxyAgent`, which is similar to the usage of `AssistantAgent` and `UserProxyAgent` in other notebooks (e.g., [Automated Task Solving with Code Generation, Execution & Debugging](https://github.com/ag2ai/ag2/blob/main/notebook/agentchat_auto_feedback_from_code_execution.ipynb)). Essentially, `RetrieveUserProxyAgent` implement a different auto-reply mechanism corresponding to the RetrieveChat prompts.\n",
Expand Down Expand Up @@ -479,7 +479,7 @@
],
"metadata": {
"front_matter": {
"description": "Explore the use of AutoGen's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.",
"description": "Explore the use of AG2's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.",
"tags": [
"RAG"
]
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_RetrieveChat_couchbase.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Using RetrieveChat Powered by Couchbase Capella for Retrieve Augmented Code Generation and Question Answering\n",
"\n",
"AutoGen offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n",
"AG2 offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n",
"Please find documentation about this feature [here](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat).\n",
"\n",
"RetrieveChat is a conversational system for retrieval-augmented code generation and question answering. In this notebook, we demonstrate how to utilize RetrieveChat to generate code and answer questions based on customized documentations that are not present in the LLM's training dataset. RetrieveChat uses the `AssistantAgent` and `RetrieveUserProxyAgent`, which is similar to the usage of `AssistantAgent` and `UserProxyAgent` in other notebooks (e.g., [Automated Task Solving with Code Generation, Execution & Debugging](https://github.com/microsoft/autogen/blob/main/notebook/agentchat_auto_feedback_from_code_execution.ipynb)). Essentially, `RetrieveUserProxyAgent` implement a different auto-reply mechanism corresponding to the RetrieveChat prompts.\n",
Expand Down Expand Up @@ -578,7 +578,7 @@
],
"metadata": {
"front_matter": {
"description": "Explore the use of AutoGen's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.",
"description": "Explore the use of AG2's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.",
"tags": [
"RAG"
]
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_RetrieveChat_mongodb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Using RetrieveChat Powered by MongoDB Atlas for Retrieve Augmented Code Generation and Question Answering\n",
"\n",
"AutoGen offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n",
"AG2 offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n",
"Please find documentation about this feature [here](https://docs.ag2.ai/docs/Use-Cases/agent_chat).\n",
"\n",
"RetrieveChat is a conversational system for retrieval-augmented code generation and question answering. In this notebook, we demonstrate how to utilize RetrieveChat to generate code and answer questions based on customized documentations that are not present in the LLM's training dataset. RetrieveChat uses the `AssistantAgent` and `RetrieveUserProxyAgent`, which is similar to the usage of `AssistantAgent` and `UserProxyAgent` in other notebooks (e.g., [Automated Task Solving with Code Generation, Execution & Debugging](https://github.com/ag2ai/ag2/blob/main/notebook/agentchat_auto_feedback_from_code_execution.ipynb)). Essentially, `RetrieveUserProxyAgent` implement a different auto-reply mechanism corresponding to the RetrieveChat prompts.\n",
Expand Down Expand Up @@ -551,7 +551,7 @@
],
"metadata": {
"front_matter": {
"description": "Explore the use of AutoGen's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.",
"description": "Explore the use of AG2's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.",
"tags": [
"MongoDB",
"integration",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_RetrieveChat_pgvector.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Using RetrieveChat Powered by PGVector for Retrieve Augmented Code Generation and Question Answering\n",
"\n",
"AutoGen offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n",
"AG2 offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n",
"Please find documentation about this feature [here](https://docs.ag2.ai/docs/Use-Cases/agent_chat).\n",
"\n",
"RetrieveChat is a conversational system for retrieval-augmented code generation and question answering. In this notebook, we demonstrate how to utilize RetrieveChat to generate code and answer questions based on customized documentations that are not present in the LLM's training dataset. RetrieveChat uses the `AssistantAgent` and `RetrieveUserProxyAgent`, which is similar to the usage of `AssistantAgent` and `UserProxyAgent` in other notebooks (e.g., [Automated Task Solving with Code Generation, Execution & Debugging](https://github.com/ag2ai/ag2/blob/main/notebook/agentchat_auto_feedback_from_code_execution.ipynb)). Essentially, `RetrieveUserProxyAgent` implement a different auto-reply mechanism corresponding to the RetrieveChat prompts.\n",
Expand Down Expand Up @@ -1485,7 +1485,7 @@
],
"metadata": {
"front_matter": {
"description": "Explore the use of AutoGen's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.",
"description": "Explore the use of AG2's RetrieveChat for tasks like code generation from docstrings, answering complex questions with human feedback, and exploiting features like Update Context, custom prompts, and few-shot learning.",
"tags": [
"PGVector",
"integration",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_RetrieveChat_qdrant.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@
" <br>\n",
"</p>\n",
"\n",
":fire: Heads-up: We have migrated [AutoGen](https://docs.ag2.ai/) into a dedicated [github repository](https://github.com/ag2ai/ag2). Alongside this move, we have also launched a dedicated [Discord](https://discord.gg/pAbnFJrkgZ) server and a [website](https://docs.ag2.ai/) for comprehensive documentation.\n",
":fire: Heads-up: We have migrated [AG2](https://docs.ag2.ai/) into a dedicated [github repository](https://github.com/ag2ai/ag2). Alongside this move, we have also launched a dedicated [Discord](https://discord.gg/pAbnFJrkgZ) server and a [website](https://docs.ag2.ai/) for comprehensive documentation.\n",
"\n",
":fire: The automated multi-agent chat framework in [AutoGen](https://docs.ag2.ai/) is in preview from v2.0.0.\n",
":fire: The automated multi-agent chat framework in [AG2](https://docs.ag2.ai/) is in preview from v2.0.0.\n",
"\n",
":fire: FLAML is highlighted in OpenAI's [cookbook](https://github.com/openai/openai-cookbook#related-resources-from-around-the-web).\n",
"\n",
Expand Down
8 changes: 4 additions & 4 deletions notebook/agentchat_cost_token_tracking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Usage tracking with AutoGen\n",
"## 1. Use AutoGen's OpenAIWrapper for cost estimation\n",
"# Usage tracking with AG2\n",
"## 1. Use AG2's OpenAIWrapper for cost estimation\n",
"The `OpenAIWrapper` from `autogen` tracks token counts and costs of your API calls. Use the `create()` method to initiate requests and `print_usage_summary()` to retrieve a detailed usage report, including total cost and token usage for both cached and actual requests.\n",
"\n",
"- `mode=[\"actual\", \"total\"]` (default): print usage summary for non-caching completions and all completions (including cache).\n",
Expand All @@ -21,7 +21,7 @@
"To gather usage data for a list of agents, we provide an utility function `autogen.gather_usage_summary(agents)` where you pass in a list of agents and gather the usage summary.\n",
"\n",
"## 3. Custom token price for up-to-date cost estimation\n",
"AutoGen tries to keep the token prices up-to-date. However, you can pass in a `price` field in `config_list` if the token price is not listed or up-to-date. Please creating an issue or pull request to help us keep the token prices up-to-date!\n",
"AG2 tries to keep the token prices up-to-date. However, you can pass in a `price` field in `config_list` if the token price is not listed or up-to-date. Please creating an issue or pull request to help us keep the token prices up-to-date!\n",
"\n",
"Note: in json files, the price should be a list of two floats.\n",
"\n",
Expand All @@ -41,7 +41,7 @@
"\n",
"## Requirements\n",
"\n",
"AutoGen requires `Python>=3.9`:\n",
"AG2 requires `Python>=3.9`:\n",
"```bash\n",
"pip install \"pyautogen\"\n",
"```"
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_dalle_and_gpt4v.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
"# Ask the question with an image\n",
"user_proxy.initiate_chat(\n",
" dalle,\n",
" message=\"\"\"Create an image with black background, a happy robot is showing a sign with \"I Love AutoGen\".\"\"\",\n",
" message=\"\"\"Create an image with black background, a happy robot is showing a sign with \"I Love AG2\".\"\"\",\n",
")"
]
},
Expand Down Expand Up @@ -424,7 +424,7 @@
"user_proxy = UserProxyAgent(name=\"User\", human_input_mode=\"NEVER\", max_consecutive_auto_reply=0)\n",
"\n",
"user_proxy.initiate_chat(\n",
" creator, message=\"\"\"Create an image with black background, a happy robot is showing a sign with \"I Love AutoGen\".\"\"\"\n",
" creator, message=\"\"\"Create an image with black background, a happy robot is showing a sign with \"I Love AG2\".\"\"\"\n",
")"
]
}
Expand Down
Loading
Loading