A programming framework for agentic AI
Rename `agnext` package to `autogen_core` (#418)
Jack Gerrits725f13c3f8c7
diff --git a/python/docs/src/conf.py b/python/docs/src/conf.pyindex 55b258215..8d7f6a2ff 100644--- a/python/docs/src/conf.py+++ b/python/docs/src/conf.py@@ -6,7 +6,7 @@# -- Project information -----------------------------------------------------# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information-project = "agnext"+project = "autogen_core"copyright = "2024, Microsoft"author = "Microsoft"@@ -22,7 +22,7 @@ extensions = ["sphinx.ext.intersphinx",]-apidoc_module_dir = "../../src/agnext"+apidoc_module_dir = "../../src/autogen_core"apidoc_output_dir = "reference"apidoc_template_dir = "_apidoc_templates"apidoc_separate_modules = True@@ -31,7 +31,7 @@ napoleon_custom_sections = [("Returns", "params_style")]apidoc_excluded_paths = ["./application/protos/"]templates_path = []-exclude_patterns = ["reference/agnext.rst"]+exclude_patterns = ["reference/autogen_core.rst"]autoclass_content = "init"@@ -53,7 +53,7 @@ html_theme = "furo"html_static_path = []html_theme_options = {- "source_repository": "https://github.com/microsoft/agnext",+ "source_repository": "https://github.com/microsoft/autogen_core","source_branch": "main","source_directory": "python/docs/src/",}diff --git a/python/docs/src/cookbook/azure-openai-with-aad-auth.md b/python/docs/src/cookbook/azure-openai-with-aad-auth.mdindex ebb2f929f..a40cf0475 100644--- a/python/docs/src/cookbook/azure-openai-with-aad-auth.md+++ b/python/docs/src/cookbook/azure-openai-with-aad-auth.md@@ -15,7 +15,7 @@ pip install azure-identity## Using the Model Client```python-from agnext.components.models import AzureOpenAIChatCompletionClient+from autogen_core.components.models import AzureOpenAIChatCompletionClientfrom azure.identity import DefaultAzureCredential, get_bearer_token_provider# Create the token providerdiff --git a/python/docs/src/cookbook/buffered-memory.md b/python/docs/src/cookbook/buffered-memory.mdindex d132385b3..733fd5158 100644--- a/python/docs/src/cookbook/buffered-memory.md+++ b/python/docs/src/cookbook/buffered-memory.md@@ -6,8 +6,8 @@ last N messages:```pythonfrom typing import Any, List, Mapping-from agnext.components.memory import ChatMemory-from agnext.components.models import FunctionExecutionResultMessage, LLMMessage+from autogen_core.components.memory import ChatMemory+from autogen_core.components.models import FunctionExecutionResultMessage, LLMMessageclass BufferedChatMemory(ChatMemory[LLMMessage]):diff --git a/python/docs/src/cookbook/extracting-results-with-an-agent.md b/python/docs/src/cookbook/extracting-results-with-an-agent.mdindex 19549be74..4a12b7123 100644--- a/python/docs/src/cookbook/extracting-results-with-an-agent.md+++ b/python/docs/src/cookbook/extracting-results-with-an-agent.md@@ -2,16 +2,16 @@When running a multi-agent system to solve some task, you may want to extract the result of the system once it has reached termination. This guide showcases one way to achieve this. Given that agent instances are not directly accessible from the outside, we will use an agent to publish the final result to an accessible location.-If you model your system to publish some `FinalResult` type then you can create an agent whose sole job is to subscribe to this and make it available externally. For simple agents like this the {py:class}`~agnext.components.ClosureAgent` is an option to reduce the amount of boilerplate code. This allows you to define a function that will be associated as the agent's message handler. In this example, we're going to use a queue shared between the agent and the external code to pass the result.+If you model your system to publish some `FinalResult` type then you can create an agent whose sole job is to subscribe to this and make it available externally. For simple agents like this the {py:class}`~autogen_core.components.ClosureAgent` is an option to reduce the amount of boilerplate code. This allows you to define a function that will be associated as the agent's message handler. In this example, we're going to use a queue shared between the agent and the external code to pass the result.```{note}When considering how to extract results from a multi-agent system, you must always consider the namespace of the agent and by extension the message.``````python-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentRuntime, AgentId, CancellationToken-from agnext.components import ClosureAgent+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentRuntime, AgentId, CancellationToken+from autogen_core.components import ClosureAgentimport asynciodiff --git a/python/docs/src/cookbook/langgraph-agent.ipynb b/python/docs/src/cookbook/langgraph-agent.ipynbindex b46d29630..d623709c1 100644--- a/python/docs/src/cookbook/langgraph-agent.ipynb+++ b/python/docs/src/cookbook/langgraph-agent.ipynb@@ -43,9 +43,9 @@"from dataclasses import dataclass\n","from typing import Any, Callable, List, Literal\n","\n",- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.base import AgentId, MessageContext\n",- "from agnext.components import RoutedAgent, message_handler\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.base import AgentId, MessageContext\n",+ "from autogen_core.components import RoutedAgent, message_handler\n","from azure.identity import DefaultAzureCredential, get_bearer_token_provider\n","from langchain_core.messages import HumanMessage, SystemMessage\n","from langchain_core.tools import tool # pyright: ignore\n",@@ -278,7 +278,7 @@],"metadata": {"kernelspec": {- "display_name": "agnext",+ "display_name": "autogen_core","language": "python","name": "python3"},diff --git a/python/docs/src/cookbook/llamaindex-agent.ipynb b/python/docs/src/cookbook/llamaindex-agent.ipynbindex 177f30f3e..dccd2820d 100644--- a/python/docs/src/cookbook/llamaindex-agent.ipynb+++ b/python/docs/src/cookbook/llamaindex-agent.ipynb@@ -42,9 +42,9 @@"from dataclasses import dataclass\n","from typing import List, Optional\n","\n",- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.base import AgentId, MessageContext\n",- "from agnext.components import RoutedAgent, message_handler\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.base import AgentId, MessageContext\n",+ "from autogen_core.components import RoutedAgent, message_handler\n","from azure.identity import DefaultAzureCredential, get_bearer_token_provider\n","from llama_index.core import Settings\n","from llama_index.core.agent import ReActAgent\n",@@ -511,7 +511,7 @@],"metadata": {"kernelspec": {- "display_name": "agnext",+ "display_name": "autogen_core","language": "python","name": "python3"},diff --git a/python/docs/src/cookbook/openai-assistant-agent.ipynb b/python/docs/src/cookbook/openai-assistant-agent.ipynbindex 6658aa98a..940d6ebd3 100644--- a/python/docs/src/cookbook/openai-assistant-agent.ipynb+++ b/python/docs/src/cookbook/openai-assistant-agent.ipynb@@ -104,8 +104,8 @@"from typing import Any, Callable, List\n","\n","import aiofiles\n",- "from agnext.base import AgentId, MessageContext\n",- "from agnext.components import RoutedAgent, message_handler\n",+ "from autogen_core.base import AgentId, MessageContext\n",+ "from autogen_core.components import RoutedAgent, message_handler\n","from openai import AsyncAssistantEventHandler, AsyncClient\n","from openai.types.beta.thread import ToolResources, ToolResourcesFileSearch\n","\n",@@ -387,7 +387,7 @@"metadata": {},"outputs": [],"source": [- "from agnext.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n","\n","runtime = SingleThreadedAgentRuntime()\n","await runtime.register(\n",@@ -419,7 +419,7 @@"import logging\n","\n","logging.basicConfig(level=logging.WARNING)\n",- "logging.getLogger(\"agnext\").setLevel(logging.DEBUG)"+ "logging.getLogger(\"autogen_core\").setLevel(logging.DEBUG)"]},{@@ -438,8 +438,8 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Sending message of type TextMessage to assistant: {'content': 'Hello, how are you today!', 'source': 'user'}\n",- "INFO:agnext:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"+ "INFO:autogen_core:Sending message of type TextMessage to assistant: {'content': 'Hello, how are you today!', 'source': 'user'}\n",+ "INFO:autogen_core:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"]},{@@ -456,7 +456,7 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Resolving response with message type TextMessage for recipient None from assistant: {'content': \"Hello! I'm here and ready to assist you. How can I help you today?\", 'source': 'assistant'}\n"+ "INFO:autogen_core:Resolving response with message type TextMessage for recipient None from assistant: {'content': \"Hello! I'm here and ready to assist you. How can I help you today?\", 'source': 'assistant'}\n"]}],@@ -485,8 +485,8 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Sending message of type TextMessage to assistant: {'content': 'What is 1332322 x 123212?', 'source': 'user'}\n",- "INFO:agnext:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"+ "INFO:autogen_core:Sending message of type TextMessage to assistant: {'content': 'What is 1332322 x 123212?', 'source': 'user'}\n",+ "INFO:autogen_core:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"]},{@@ -508,7 +508,7 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Resolving response with message type TextMessage for recipient None from assistant: {'content': 'The product of 1,332,322 and 123,212 is 164,158,058,264.', 'source': 'assistant'}\n"+ "INFO:autogen_core:Resolving response with message type TextMessage for recipient None from assistant: {'content': 'The product of 1,332,322 and 123,212 is 164,158,058,264.', 'source': 'assistant'}\n"]}],@@ -556,9 +556,9 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Sending message of type UploadForCodeInterpreter to assistant: {'file_path': 'seattle_city_wages.csv'}\n",- "INFO:agnext:Calling message handler for assistant:default with message type UploadForCodeInterpreter sent by Unknown\n",- "INFO:agnext:Resolving response with message type NoneType for recipient None from assistant: None\n"+ "INFO:autogen_core:Sending message of type UploadForCodeInterpreter to assistant: {'file_path': 'seattle_city_wages.csv'}\n",+ "INFO:autogen_core:Calling message handler for assistant:default with message type UploadForCodeInterpreter sent by Unknown\n",+ "INFO:autogen_core:Resolving response with message type NoneType for recipient None from assistant: None\n"]}],@@ -584,8 +584,8 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Sending message of type TextMessage to assistant: {'content': 'Take a look at the uploaded CSV file.', 'source': 'user'}\n",- "INFO:agnext:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"+ "INFO:autogen_core:Sending message of type TextMessage to assistant: {'content': 'Take a look at the uploaded CSV file.', 'source': 'user'}\n",+ "INFO:autogen_core:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"]},{@@ -630,7 +630,7 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Resolving response with message type TextMessage for recipient None from assistant: {'content': \"The uploaded CSV file contains the following columns:\\n\\n1. **department**: The department in which the individual works.\\n2. **last_name**: The last name of the employee.\\n3. **first_name**: The first name of the employee.\\n4. **job_title**: The job title of the employee.\\n5. **hourly_rate**: The hourly rate for the employee's position.\\n\\nHere are the first few entries from the file:\\n\\n| department | last_name | first_name | job_title | hourly_rate |\\n|--------------------------------|-----------|------------|------------------------------------|-------------|\\n| Police Department | Aagard | Lori | Pol Capt-Precinct | 112.70 |\\n| Police Department | Aakervik | Dag | Pol Ofcr-Detective | 75.61 |\\n| Seattle City Light | Aaltonen | Evan | Pwrline Clear Tree Trimmer | 53.06 |\\n| Seattle Public Utilities | Aar | Abdimallik | Civil Engrng Spec,Sr | 64.43 |\\n| Seattle Dept of Transportation | Abad | Abigail | Admin Spec II-BU | 37.40 |\\n\\nIf you need any specific analysis or information from this data, please let me know!\", 'source': 'assistant'}\n"+ "INFO:autogen_core:Resolving response with message type TextMessage for recipient None from assistant: {'content': \"The uploaded CSV file contains the following columns:\\n\\n1. **department**: The department in which the individual works.\\n2. **last_name**: The last name of the employee.\\n3. **first_name**: The first name of the employee.\\n4. **job_title**: The job title of the employee.\\n5. **hourly_rate**: The hourly rate for the employee's position.\\n\\nHere are the first few entries from the file:\\n\\n| department | last_name | first_name | job_title | hourly_rate |\\n|--------------------------------|-----------|------------|------------------------------------|-------------|\\n| Police Department | Aagard | Lori | Pol Capt-Precinct | 112.70 |\\n| Police Department | Aakervik | Dag | Pol Ofcr-Detective | 75.61 |\\n| Seattle City Light | Aaltonen | Evan | Pwrline Clear Tree Trimmer | 53.06 |\\n| Seattle Public Utilities | Aar | Abdimallik | Civil Engrng Spec,Sr | 64.43 |\\n| Seattle Dept of Transportation | Abad | Abigail | Admin Spec II-BU | 37.40 |\\n\\nIf you need any specific analysis or information from this data, please let me know!\", 'source': 'assistant'}\n"]}],@@ -649,8 +649,8 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Sending message of type TextMessage to assistant: {'content': 'What are the top-10 salaries?', 'source': 'user'}\n",- "INFO:agnext:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"+ "INFO:autogen_core:Sending message of type TextMessage to assistant: {'content': 'What are the top-10 salaries?', 'source': 'user'}\n",+ "INFO:autogen_core:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"]},{@@ -688,7 +688,7 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Resolving response with message type TextMessage for recipient None from assistant: {'content': 'Here are the top 10 salaries based on the hourly rates from the CSV file:\\n\\n| First Name | Last Name | Job Title | Hourly Rate |\\n|------------|-----------|------------------------------------|-------------|\\n| Eric | Barden | Executive4 | 139.61 |\\n| Idris | Beauregard| Executive3 | 115.90 |\\n| Lori | Aagard | Pol Capt-Precinct | 112.70 |\\n| Krista | Bair | Pol Capt-Precinct | 108.74 |\\n| Amy | Bannister | Fire Chief, Dep Adm-80 Hrs | 104.07 |\\n| Ginger | Armbruster| Executive2 | 102.42 |\\n| William | Andersen | Executive2 | 102.42 |\\n| Valarie | Anderson | Executive2 | 102.42 |\\n| Paige | Alderete | Executive2 | 102.42 |\\n| Kathryn | Aisenberg | Executive2 | 100.65 |\\n\\nIf you need any further details or analysis, let me know!', 'source': 'assistant'}\n"+ "INFO:autogen_core:Resolving response with message type TextMessage for recipient None from assistant: {'content': 'Here are the top 10 salaries based on the hourly rates from the CSV file:\\n\\n| First Name | Last Name | Job Title | Hourly Rate |\\n|------------|-----------|------------------------------------|-------------|\\n| Eric | Barden | Executive4 | 139.61 |\\n| Idris | Beauregard| Executive3 | 115.90 |\\n| Lori | Aagard | Pol Capt-Precinct | 112.70 |\\n| Krista | Bair | Pol Capt-Precinct | 108.74 |\\n| Amy | Bannister | Fire Chief, Dep Adm-80 Hrs | 104.07 |\\n| Ginger | Armbruster| Executive2 | 102.42 |\\n| William | Andersen | Executive2 | 102.42 |\\n| Valarie | Anderson | Executive2 | 102.42 |\\n| Paige | Alderete | Executive2 | 102.42 |\\n| Kathryn | Aisenberg | Executive2 | 100.65 |\\n\\nIf you need any further details or analysis, let me know!', 'source': 'assistant'}\n"]}],@@ -735,9 +735,9 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Sending message of type UploadForFileSearch to assistant: {'file_path': 'third_anglo_afghan_war.html', 'vector_store_id': 'vs_h3xxPbJFnd1iZ9WdjsQwNdrp'}\n",- "INFO:agnext:Calling message handler for assistant:default with message type UploadForFileSearch sent by Unknown\n",- "INFO:agnext:Resolving response with message type NoneType for recipient None from assistant: None\n"+ "INFO:autogen_core:Sending message of type UploadForFileSearch to assistant: {'file_path': 'third_anglo_afghan_war.html', 'vector_store_id': 'vs_h3xxPbJFnd1iZ9WdjsQwNdrp'}\n",+ "INFO:autogen_core:Calling message handler for assistant:default with message type UploadForFileSearch sent by Unknown\n",+ "INFO:autogen_core:Resolving response with message type NoneType for recipient None from assistant: None\n"]}],@@ -766,11 +766,11 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Sending message of type Reset to assistant: {}\n",- "INFO:agnext:Calling message handler for assistant:default with message type Reset sent by Unknown\n",- "INFO:agnext:Resolving response with message type NoneType for recipient None from assistant: None\n",- "INFO:agnext:Sending message of type TextMessage to assistant: {'content': 'When and where was the treaty of Rawalpindi signed? Answer using the document provided.', 'source': 'user'}\n",- "INFO:agnext:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"+ "INFO:autogen_core:Sending message of type Reset to assistant: {}\n",+ "INFO:autogen_core:Calling message handler for assistant:default with message type Reset sent by Unknown\n",+ "INFO:autogen_core:Resolving response with message type NoneType for recipient None from assistant: None\n",+ "INFO:autogen_core:Sending message of type TextMessage to assistant: {'content': 'When and where was the treaty of Rawalpindi signed? Answer using the document provided.', 'source': 'user'}\n",+ "INFO:autogen_core:Calling message handler for assistant:default with message type TextMessage sent by Unknown\n"]},{@@ -787,7 +787,7 @@"name": "stderr","output_type": "stream","text": [- "INFO:agnext:Resolving response with message type TextMessage for recipient None from assistant: {'content': 'The Treaty of Rawalpindi was signed on **8 August 1919**. The location of the signing was in **Rawalpindi**, which is in present-day Pakistan【6:0†source】.', 'source': 'assistant'}\n"+ "INFO:autogen_core:Resolving response with message type TextMessage for recipient None from assistant: {'content': 'The Treaty of Rawalpindi was signed on **8 August 1919**. The location of the signing was in **Rawalpindi**, which is in present-day Pakistan【6:0†source】.', 'source': 'assistant'}\n"]},{@@ -820,7 +820,7 @@],"metadata": {"kernelspec": {- "display_name": "agnext",+ "display_name": "autogen_core","language": "python","name": "python3"},diff --git a/python/docs/src/cookbook/termination-with-intervention.md b/python/docs/src/cookbook/termination-with-intervention.mdindex 2ed45ccbc..7ad86447e 100644--- a/python/docs/src/cookbook/termination-with-intervention.md+++ b/python/docs/src/cookbook/termination-with-intervention.md@@ -4,17 +4,17 @@This method is only really valid for single-tenant applications. If multiple parallel users are using the application via namespaces this approach will not work without modification.```-There are many different ways to handle termination in `agnext`. Ultimately, the goal is to detect that the runtime no longer needs to be executed and you can proceed to finalization tasks. One way to do this is to use an `InterventionHandler` to detect a termination message and then act on it.+There are many different ways to handle termination in `autogen_core`. Ultimately, the goal is to detect that the runtime no longer needs to be executed and you can proceed to finalization tasks. One way to do this is to use an `InterventionHandler` to detect a termination message and then act on it.```pythonimport asynciofrom dataclasses import dataclassfrom typing import Any-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import RoutedAgent, message_handler-from agnext.base import AgentId, CancellationToken-from agnext.base.intervention import DefaultInterventionHandler+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import RoutedAgent, message_handler+from autogen_core.base import AgentId, CancellationToken+from autogen_core.base.intervention import DefaultInterventionHandler```First, we define a dataclass that will be used to signal termination.diff --git a/python/docs/src/cookbook/type-routed-agent.md b/python/docs/src/cookbook/type-routed-agent.mdindex 22d04608e..d0b587043 100644--- a/python/docs/src/cookbook/type-routed-agent.md+++ b/python/docs/src/cookbook/type-routed-agent.md@@ -1,15 +1,15 @@# Using Type Routed Agent-To make it easier to implement agents that respond to certain message types there is a base class called {py:class}`~agnext.components.RoutedAgent`. This class provides a simple decorator pattern for associating message types with message handlers.+To make it easier to implement agents that respond to certain message types there is a base class called {py:class}`~autogen_core.components.RoutedAgent`. This class provides a simple decorator pattern for associating message types with message handlers.-The decorator {py:func}`agnext.components.message_handler` should be added to functions in the class that are intended to handle messages. These functions have a specific signature that needs to be followed for it to be recognized as a message handler.+The decorator {py:func}`autogen_core.components.message_handler` should be added to functions in the class that are intended to handle messages. These functions have a specific signature that needs to be followed for it to be recognized as a message handler.- The function must be an `async` function.- The function must be decorated with the `message_handler` decorator.- The function must have exactly 3 arguments.- `self`- `message`: The message to be handled, this must be type hinted with the message type that it is intended to handle.- - `cancellation_token`: A {py:class}`agnext.base.CancellationToken` object+ - `cancellation_token`: A {py:class}`autogen_core.base.CancellationToken` object- The function must be type hinted with what message types it can return.```{tip}@@ -25,8 +25,8 @@ One important thing to point out is that when an agent is constructed it must be```pythonfrom dataclasses import dataclassfrom typing import List, Union-from agnext.components import RoutedAgent, message_handler, Image-from agnext.base import AgentRuntime, CancellationToken+from autogen_core.components import RoutedAgent, message_handler, Image+from autogen_core.base import AgentRuntime, CancellationToken@dataclassclass TextMessage:diff --git a/python/docs/src/core-concepts/architecture.md b/python/docs/src/core-concepts/architecture.mdindex 513e174ce..7bfab6e0e 100644--- a/python/docs/src/core-concepts/architecture.md+++ b/python/docs/src/core-concepts/architecture.md@@ -30,27 +30,27 @@ memory stores, and more.The API consists of the following layers:-- {py:mod}`agnext.base`-- {py:mod}`agnext.application`-- {py:mod}`agnext.components`+- {py:mod}`autogen_core.base`+- {py:mod}`autogen_core.application`+- {py:mod}`autogen_core.components`The following diagram shows the relationship between the layers.-The {py:mod}`agnext.base` layer defines the+The {py:mod}`autogen_core.base` layer defines thecore interfaces and base classes for agents, messages, and runtime.This layer is the foundation of the framework and is used by the other layers.-The {py:mod}`agnext.application` layer provides concrete implementations of+The {py:mod}`autogen_core.application` layer provides concrete implementations ofruntime and utilities like logging for building multi-agent applications.-The {py:mod}`agnext.components` layer provides reusable components for building+The {py:mod}`autogen_core.components` layer provides reusable components for buildingAI agents, including type-routed agents, AI model clients, tools for AI models,code execution sandboxes, and memory stores.The layers are loosely coupled and can be used independently. For example,-you can swap out the runtime in the {py:mod}`agnext.application` layer with your own+you can swap out the runtime in the {py:mod}`autogen_core.application` layer with your ownruntime implementation.-You can also skip the components in the {py:mod}`agnext.components` layer and+You can also skip the components in the {py:mod}`autogen_core.components` layer andbuild your own components.diff --git a/python/docs/src/getting-started/agent-and-agent-runtime.ipynb b/python/docs/src/getting-started/agent-and-agent-runtime.ipynbindex 118c043ab..fc6fb0785 100644--- a/python/docs/src/getting-started/agent-and-agent-runtime.ipynb+++ b/python/docs/src/getting-started/agent-and-agent-runtime.ipynb@@ -16,17 +16,17 @@"cell_type": "markdown","metadata": {},"source": [- "An agent in AGNext is an entity defined by the base class {py:class}`agnext.base.BaseAgent`.\n",- "It has a unique identifier of the type {py:class}`agnext.base.AgentId`,\n",- "a metadata dictionary of the type {py:class}`agnext.base.AgentMetadata`,\n",- "and method for handling messages {py:meth}`agnext.base.BaseAgent.on_message`.\n",+ "An agent in AGNext is an entity defined by the base class {py:class}`autogen_core.base.BaseAgent`.\n",+ "It has a unique identifier of the type {py:class}`autogen_core.base.AgentId`,\n",+ "a metadata dictionary of the type {py:class}`autogen_core.base.AgentMetadata`,\n",+ "and method for handling messages {py:meth}`autogen_core.base.BaseAgent.on_message`.\n","\n","An agent runtime is the execution environment for agents in AGNext.\n","Similar to the runtime environment of a programming language,\n","an agent runtime provides the necessary infrastructure to facilitate communication\n","between agents, manage agent lifecycles, enforce security boundaries, and support monitoring and\n","debugging.\n",- "For local development, developers can use {py:class}`~agnext.application.SingleThreadedAgentRuntime`,\n",+ "For local development, developers can use {py:class}`~autogen_core.application.SingleThreadedAgentRuntime`,\n","which can be embedded in a Python application.\n","\n","```{note}\n",@@ -41,9 +41,9 @@"source": ["## Implementing an Agent\n","\n",- "To implement an agent, developer must subclass the {py:class}`~agnext.base.BaseAgent` class,\n",- "declare the message types it can handle in the {py:attr}`~agnext.base.AgentMetadata.subscriptions` metadata,\n",- "and implement the {py:meth}`~agnext.base.BaseAgent.on_message` method.\n",+ "To implement an agent, developer must subclass the {py:class}`~autogen_core.base.BaseAgent` class,\n",+ "declare the message types it can handle in the {py:attr}`~autogen_core.base.AgentMetadata.subscriptions` metadata,\n",+ "and implement the {py:meth}`~autogen_core.base.BaseAgent.on_message` method.\n","This method is invoked when the agent receives a message. For example,\n","the following agent handles a simple message type and simply prints message it receives:"]@@ -56,7 +56,7 @@"source": ["from dataclasses import dataclass\n","\n",- "from agnext.base import AgentId, BaseAgent, MessageContext\n",+ "from autogen_core.base import AgentId, BaseAgent, MessageContext\n","\n","\n","@dataclass\n",@@ -76,7 +76,7 @@"cell_type": "markdown","metadata": {},"source": [- "For convenience, developers can subclass the {py:class}`~agnext.components.RoutedAgent` class\n",+ "For convenience, developers can subclass the {py:class}`~autogen_core.components.RoutedAgent` class\n","which provides an easy-to use API to implement different message handlers for different message types.\n","See the section on message handlers below."]@@ -88,7 +88,7 @@"## Registering Agent Type\n","\n","To make agents available to the runtime, developers can use the\n",- "{py:meth}`~agnext.base.AgentRuntime.register` method.\n",+ "{py:meth}`~autogen_core.base.AgentRuntime.register` method.\n","The process of registration associates an agent type and a factory function\n","that creates an instance of the agent type.\n","The factory function is used to allow automatic creation of agent instances \n",@@ -97,7 +97,7 @@"about agent type an identity.\n","\n","For example, to register an agent type with the \n",- "{py:class}`~agnext.application.SingleThreadedAgentRuntime`,\n",+ "{py:class}`~autogen_core.application.SingleThreadedAgentRuntime`,\n","the following code can be used:"]},@@ -118,7 +118,7 @@}],"source": [- "from agnext.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n","\n","runtime = SingleThreadedAgentRuntime()\n","await runtime.register(\"my_agent\", lambda: MyAgent())"@@ -129,7 +129,7 @@"metadata": {},"source": ["Once an agent type is registered, we can send a direct message to an agent instance\n",- "using an {py:class}`~agnext.base.AgentId`.\n",+ "using an {py:class}`~autogen_core.base.AgentId`.\n","The runtime will create the instance the first time it delivers a\n","message to this instance."]@@ -159,7 +159,7 @@"metadata": {},"source": ["```{note}\n",- "Because the runtime manages the lifecycle of agents, an {py:class}`~agnext.base.AgentId`\n",+ "Because the runtime manages the lifecycle of agents, an {py:class}`~autogen_core.base.AgentId`\n","is only used to communicate with the agent or retrieve its metadata (e.g., description).\n","```"]@@ -173,7 +173,7 @@"The above code snippet uses `runtime.start()` to start a background task\n","to process and deliver messages to recepients' message handlers.\n","This is a feature of the\n",- "local embedded runtime {py:class}`~agnext.application.SingleThreadedAgentRuntime`.\n",+ "local embedded runtime {py:class}`~autogen_core.application.SingleThreadedAgentRuntime`.\n","\n","To stop the background task immediately, use the `stop()` method:"]@@ -240,7 +240,7 @@],"metadata": {"kernelspec": {- "display_name": "agnext",+ "display_name": "autogen_core","language": "python","name": "python3"},diff --git a/python/docs/src/getting-started/group-chat.ipynb b/python/docs/src/getting-started/group-chat.ipynbindex ed84c9db1..d2f9d53b3 100644--- a/python/docs/src/getting-started/group-chat.ipynb+++ b/python/docs/src/getting-started/group-chat.ipynb@@ -49,8 +49,8 @@"source": ["from dataclasses import dataclass\n","\n",- "from agnext.components import Image\n",- "from agnext.components.models import LLMMessage\n",+ "from autogen_core.components import Image\n",+ "from autogen_core.components.models import LLMMessage\n","\n","\n","@dataclass\n",@@ -85,9 +85,15 @@"source": ["from typing import List\n","\n",- "from agnext.base import MessageContext\n",- "from agnext.components import DefaultTopicId, RoutedAgent, message_handler\n",- "from agnext.components.models import AssistantMessage, ChatCompletionClient, LLMMessage, SystemMessage, UserMessage\n",+ "from autogen_core.base import MessageContext\n",+ "from autogen_core.components import DefaultTopicId, RoutedAgent, message_handler\n",+ "from autogen_core.components.models import (\n",+ " AssistantMessage,\n",+ " ChatCompletionClient,\n",+ " LLMMessage,\n",+ " SystemMessage,\n",+ " UserMessage,\n",+ ")\n","\n","\n","class WriterAgent(RoutedAgent):\n",@@ -216,7 +222,7 @@"metadata": {},"outputs": [],"source": [- "from agnext.base import AgentId\n",+ "from autogen_core.base import AgentId\n","\n","\n","class GroupChatManager(RoutedAgent):\n",@@ -243,7 +249,7 @@"source": ["## Running the Group Chat\n","\n",- "To run the group chat, we create an {py:class}`~agnext.application.SingleThreadedAgentRuntime`\n",+ "To run the group chat, we create an {py:class}`~autogen_core.application.SingleThreadedAgentRuntime`\n","and register the agents' factories and subscriptions.\n","We then start the runtime and publish a `GroupChatMessage` to start the group chat."]@@ -310,10 +316,10 @@}],"source": [- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.base import AgentId\n",- "from agnext.components import DefaultSubscription\n",- "from agnext.components.models import OpenAIChatCompletionClient\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.base import AgentId\n",+ "from autogen_core.components import DefaultSubscription\n",+ "from autogen_core.components.models import OpenAIChatCompletionClient\n","\n","runtime = SingleThreadedAgentRuntime()\n","\n",@@ -377,7 +383,7 @@],"metadata": {"kernelspec": {- "display_name": "agnext",+ "display_name": "autogen_core","language": "python","name": "python3"},diff --git a/python/docs/src/getting-started/installation.md b/python/docs/src/getting-started/installation.mdindex 195e30d5a..3cc57cfee 100644--- a/python/docs/src/getting-started/installation.md+++ b/python/docs/src/getting-started/installation.md@@ -7,13 +7,13 @@ The repo is private, so the installation process is a bit more involved than usuMake a clone of the repo:```sh-git clone https://github.com/microsoft/agnext.git+git clone https://github.com/microsoft/autogen_core.git```You can install the package by running:```sh-cd agnext/python+cd autogen_core/pythonpip install .```@@ -23,7 +23,7 @@ To install the package from GitHub, you will need to authenticate with GitHub.```shGITHUB_TOKEN=$(gh auth token)-pip install "git+https://oauth2:[email protected]/microsoft/agnext.git#subdirectory=python"+pip install "git+https://oauth2:[email protected]/microsoft/autogen_core.git#subdirectory=python"```### Using a Personal Access Token instead of `gh` CLI@@ -32,6 +32,6 @@ If you don't have the `gh` CLI installed, you can generate a personal access tok1. Go to [New fine-grained personal access token](https://github.com/settings/personal-access-tokens/new)2. Set `Resource Owner` to `Microsoft`-3. Set `Repository Access` to `Only select repositories` and select `Microsoft/agnext`+3. Set `Repository Access` to `Only select repositories` and select `Microsoft/autogen_core`4. Set `Permissions` to `Repository permissions` and select `Contents: Read`5. Use the generated token for `GITHUB_TOKEN` in the commad abovediff --git a/python/docs/src/getting-started/message-and-communication.ipynb b/python/docs/src/getting-started/message-and-communication.ipynbindex 3a83773b6..ea266e9f8 100644--- a/python/docs/src/getting-started/message-and-communication.ipynb+++ b/python/docs/src/getting-started/message-and-communication.ipynb@@ -81,9 +81,9 @@"metadata": {},"outputs": [],"source": [- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.base import AgentId, MessageContext\n",- "from agnext.components import RoutedAgent, message_handler\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.base import AgentId, MessageContext\n",+ "from autogen_core.components import RoutedAgent, message_handler\n","\n","\n","class MyAgent(RoutedAgent):\n",@@ -195,9 +195,9 @@"source": ["from dataclasses import dataclass\n","\n",- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.base import MessageContext\n",- "from agnext.components import RoutedAgent, message_handler\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.base import MessageContext\n",+ "from autogen_core.components import RoutedAgent, message_handler\n","\n","\n","@dataclass\n",@@ -318,9 +318,9 @@"metadata": {},"outputs": [],"source": [- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.base import MessageContext, TopicId\n",- "from agnext.components import RoutedAgent, message_handler\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.base import MessageContext, TopicId\n",+ "from autogen_core.components import RoutedAgent, message_handler\n","\n","\n","class BroadcastingAgent(RoutedAgent):\n",@@ -377,7 +377,7 @@}],"source": [- "from agnext.components import TypeSubscription\n",+ "from autogen_core.components import TypeSubscription\n","\n","runtime = SingleThreadedAgentRuntime()\n","\n",@@ -438,7 +438,7 @@"metadata": {},"outputs": [],"source": [- "from agnext.components import DefaultSubscription, DefaultTopicId\n",+ "from autogen_core.components import DefaultSubscription, DefaultTopicId\n","\n","\n","class BroadcastingAgentDefaultTopic(RoutedAgent):\n",diff --git a/python/docs/src/getting-started/model-clients.ipynb b/python/docs/src/getting-started/model-clients.ipynbindex da82443f1..55c41f092 100644--- a/python/docs/src/getting-started/model-clients.ipynb+++ b/python/docs/src/getting-started/model-clients.ipynb@@ -6,9 +6,9 @@"source": ["# Model Clients\n","\n",- "AGNext provides the {py:mod}`agnext.components.models` module with a suite of built-in\n",+ "AGNext provides the {py:mod}`autogen_core.components.models` module with a suite of built-in\n","model clients for using ChatCompletion API.\n",- "All model clients implement the {py:class}`agnext.components.models.ChatCompletionClient` protocol class."+ "All model clients implement the {py:class}`autogen_core.components.models.ChatCompletionClient` protocol class."]},{@@ -18,11 +18,11 @@"## Built-in Model Clients\n","\n","Currently there are two built-in model clients:\n",- "{py:class}`agnext.components.models.OpenAIChatCompletionClient` and\n",- "{py:class}`agnext.components.models.AzureOpenAIChatCompletionClient`.\n",+ "{py:class}`autogen_core.components.models.OpenAIChatCompletionClient` and\n",+ "{py:class}`autogen_core.components.models.AzureOpenAIChatCompletionClient`.\n","Both clients are asynchronous.\n","\n",- "To use the {py:class}`~agnext.components.models.OpenAIChatCompletionClient`, you need to provide the API key\n",+ "To use the {py:class}`~autogen_core.components.models.OpenAIChatCompletionClient`, you need to provide the API key\n","either through the environment variable `OPENAI_API_KEY` or through the `api_key` argument."]},@@ -32,7 +32,7 @@"metadata": {},"outputs": [],"source": [- "from agnext.components.models import OpenAIChatCompletionClient, UserMessage\n",+ "from autogen_core.components.models import OpenAIChatCompletionClient, UserMessage\n","\n","# Create an OpenAI model client.\n","model_client = OpenAIChatCompletionClient(\n",@@ -45,8 +45,8 @@"cell_type": "markdown","metadata": {},"source": [- "You can call the {py:meth}`~agnext.components.models.OpenAIChatCompletionClient.create` method to create a\n",- "chat completion request, and await for an {py:class}`~agnext.components.models.CreateResult` object in return."+ "You can call the {py:meth}`~autogen_core.components.models.OpenAIChatCompletionClient.create` method to create a\n",+ "chat completion request, and await for an {py:class}`~autogen_core.components.models.CreateResult` object in return."]},{@@ -79,7 +79,7 @@"source": ["### Streaming Response\n","\n",- "You can use the {py:meth}`~agnext.components.models.OpenAIChatCompletionClient.create_streaming` method to create a\n",+ "You can use the {py:meth}`~autogen_core.components.models.OpenAIChatCompletionClient.create_streaming` method to create a\n","chat completion request with streaming response."]},@@ -137,7 +137,7 @@"source": ["```{note}\n","The last response in the streaming response is always the final response\n",- "of the type {py:class}`~agnext.components.models.CreateResult`.\n",+ "of the type {py:class}`~autogen_core.components.models.CreateResult`.\n","```"]},@@ -147,7 +147,7 @@"source": ["### Azure OpenAI\n","\n",- "To use the {py:class}`~agnext.components.models.AzureOpenAIChatCompletionClient`, you need to provide\n",+ "To use the {py:class}`~autogen_core.components.models.AzureOpenAIChatCompletionClient`, you need to provide\n","the deployment id, Azure Cognitive Services endpoint, api version, and model capabilities.\n","For authentication, you can either provide an API key or an Azure Active Directory (AAD) token credential.\n","To use AAD authentication, you need to first install the `azure-identity` package."@@ -180,7 +180,7 @@"metadata": {},"outputs": [],"source": [- "from agnext.components.models import AzureOpenAIChatCompletionClient\n",+ "from autogen_core.components.models import AzureOpenAIChatCompletionClient\n","from azure.identity import DefaultAzureCredential, get_bearer_token_provider\n","\n","# Create the token provider\n",@@ -226,10 +226,10 @@"source": ["from dataclasses import dataclass\n","\n",- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.base import MessageContext\n",- "from agnext.components import RoutedAgent, message_handler\n",- "from agnext.components.models import ChatCompletionClient, OpenAIChatCompletionClient, SystemMessage, UserMessage\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.base import MessageContext\n",+ "from autogen_core.components import RoutedAgent, message_handler\n",+ "from autogen_core.components.models import ChatCompletionClient, OpenAIChatCompletionClient, SystemMessage, UserMessage\n","\n","\n","@dataclass\n",@@ -260,12 +260,12 @@"metadata": {},"source": ["The `SimpleAgent` class is a subclass of the\n",- "{py:class}`agnext.components.TypeRoutedAgent` class for the convenience of automatically routing messages to the appropriate handlers.\n",+ "{py:class}`autogen_core.components.TypeRoutedAgent` class for the convenience of automatically routing messages to the appropriate handlers.\n","It has a single handler, `handle_user_message`, which handles message from the user. It uses the `ChatCompletionClient` to generate a response to the message.\n","It then returns the response to the user, following the direct communication model.\n","\n","```{note}\n",- "The `cancellation_token` of the type {py:class}`agnext.base.CancellationToken` is used to cancel\n",+ "The `cancellation_token` of the type {py:class}`autogen_core.base.CancellationToken` is used to cancel\n","asynchronous operations. It is linked to async calls inside the message handlers\n","and can be used by the caller to cancel the handlers.\n","```"@@ -318,7 +318,7 @@],"source": ["# Create the runtime and register the agent.\n",- "from agnext.base import AgentId\n",+ "from autogen_core.base import AgentId\n","\n","runtime = SingleThreadedAgentRuntime()\n","await runtime.register(\n",@@ -343,7 +343,7 @@],"metadata": {"kernelspec": {- "display_name": "agnext",+ "display_name": "autogen_core","language": "python","name": "python3"},diff --git a/python/docs/src/getting-started/quickstart.ipynb b/python/docs/src/getting-started/quickstart.ipynbindex a7e2a5cf6..301a5bc6a 100644--- a/python/docs/src/getting-started/quickstart.ipynb+++ b/python/docs/src/getting-started/quickstart.ipynb@@ -26,10 +26,16 @@"from dataclasses import dataclass\n","from typing import List\n","\n",- "from agnext.base import MessageContext\n",- "from agnext.components import DefaultTopicId, RoutedAgent, message_handler\n",- "from agnext.components.code_executor import CodeExecutor, extract_markdown_code_blocks\n",- "from agnext.components.models import AssistantMessage, ChatCompletionClient, LLMMessage, SystemMessage, UserMessage\n",+ "from autogen_core.base import MessageContext\n",+ "from autogen_core.components import DefaultTopicId, RoutedAgent, message_handler\n",+ "from autogen_core.components.code_executor import CodeExecutor, extract_markdown_code_blocks\n",+ "from autogen_core.components.models import (\n",+ " AssistantMessage,\n",+ " ChatCompletionClient,\n",+ " LLMMessage,\n",+ " SystemMessage,\n",+ " UserMessage,\n",+ ")\n","\n","\n","@dataclass\n",@@ -145,10 +151,10 @@"source": ["import tempfile\n","\n",- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.components import DefaultSubscription\n",- "from agnext.components.code_executor import LocalCommandLineCodeExecutor\n",- "from agnext.components.models import OpenAIChatCompletionClient\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.components import DefaultSubscription\n",+ "from autogen_core.components.code_executor import LocalCommandLineCodeExecutor\n",+ "from autogen_core.components.models import OpenAIChatCompletionClient\n","\n","work_dir = tempfile.mkdtemp()\n","\n",diff --git a/python/docs/src/getting-started/reflection.ipynb b/python/docs/src/getting-started/reflection.ipynbindex b292f9ef7..fdd0b0ea0 100644--- a/python/docs/src/getting-started/reflection.ipynb+++ b/python/docs/src/getting-started/reflection.ipynb@@ -100,9 +100,9 @@"import uuid\n","from typing import Dict, List, Union\n","\n",- "from agnext.base import MessageContext, TopicId\n",- "from agnext.components import RoutedAgent, message_handler\n",- "from agnext.components.models import (\n",+ "from autogen_core.base import MessageContext, TopicId\n",+ "from autogen_core.components import RoutedAgent, message_handler\n",+ "from autogen_core.components.models import (\n"," AssistantMessage,\n"," ChatCompletionClient,\n"," LLMMessage,\n",@@ -367,7 +367,7 @@"import logging\n","\n","logging.basicConfig(level=logging.WARNING)\n",- "logging.getLogger(\"agnext\").setLevel(logging.DEBUG)"+ "logging.getLogger(\"autogen_core\").setLevel(logging.DEBUG)"]},{@@ -471,9 +471,9 @@}],"source": [- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.components._type_subscription import TypeSubscription\n",- "from agnext.components.models import OpenAIChatCompletionClient\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.components._type_subscription import TypeSubscription\n",+ "from autogen_core.components.models import OpenAIChatCompletionClient\n","\n","runtime = SingleThreadedAgentRuntime()\n","await runtime.register(\n",diff --git a/python/docs/src/getting-started/tools.ipynb b/python/docs/src/getting-started/tools.ipynbindex 3d7381639..f1b3cb011 100644--- a/python/docs/src/getting-started/tools.ipynb+++ b/python/docs/src/getting-started/tools.ipynb@@ -12,7 +12,7 @@"In the context of AI agents, tools are designed to be executed by agents in\n","response to model-generated function calls.\n","\n",- "AGNext provides the {py:mod}`agnext.components.tools` module with a suite of built-in\n",+ "AGNext provides the {py:mod}`autogen_core.components.tools` module with a suite of built-in\n","tools and utilities for creating and running custom tools."]},@@ -22,7 +22,7 @@"source": ["## Built-in Tools\n","\n",- "One of the built-in tools is the {py:class}`agnext.components.tools.PythonCodeExecutionTool`,\n",+ "One of the built-in tools is the {py:class}`autogen_core.components.tools.PythonCodeExecutionTool`,\n","which allows agents to execute Python code snippets.\n","\n","Here is how you create the tool and use it."@@ -43,9 +43,9 @@}],"source": [- "from agnext.base import CancellationToken\n",- "from agnext.components.code_executor import LocalCommandLineCodeExecutor\n",- "from agnext.components.tools import PythonCodeExecutionTool\n",+ "from autogen_core.base import CancellationToken\n",+ "from autogen_core.components.code_executor import LocalCommandLineCodeExecutor\n",+ "from autogen_core.components.tools import PythonCodeExecutionTool\n","\n","# Create the tool.\n","code_executor = LocalCommandLineCodeExecutor()\n",@@ -62,10 +62,10 @@"cell_type": "markdown","metadata": {},"source": [- "The {py:class}`~agnext.components.code_executor.LocalCommandLineCodeExecutor`\n",+ "The {py:class}`~autogen_core.components.code_executor.LocalCommandLineCodeExecutor`\n","class is a built-in code executor that runs Python code snippets in a subprocess\n","in the local command line environment.\n",- "The {py:class}`~agnext.components.tools.PythonCodeExecutionTool` class wraps the code executor\n",+ "The {py:class}`~autogen_core.components.tools.PythonCodeExecutionTool` class wraps the code executor\n","and provides a simple interface to execute Python code snippets.\n","\n","Other built-in tools will be added in the future."@@ -79,7 +79,7 @@"\n","A tool can also be a simple Python function that performs a specific action.\n","To create a custom function tool, you just need to create a Python function\n",- "and use the {py:class}`agnext.components.tools.FunctionTool` class to wrap it.\n",+ "and use the {py:class}`autogen_core.components.tools.FunctionTool` class to wrap it.\n","\n","For example, a simple tool to obtain the stock price of a company might look like this:"]@@ -100,8 +100,8 @@"source": ["import random\n","\n",- "from agnext.base import CancellationToken\n",- "from agnext.components.tools import FunctionTool\n",+ "from autogen_core.base import CancellationToken\n",+ "from autogen_core.components.tools import FunctionTool\n","from typing_extensions import Annotated\n","\n","\n",@@ -127,9 +127,9 @@"source": ["## Tool-Equipped Agent\n","\n",- "To use tools with an agent, you can use {py:class}`agnext.components.tool_agent.ToolAgent`,\n",+ "To use tools with an agent, you can use {py:class}`autogen_core.components.tool_agent.ToolAgent`,\n","by using it in a composition pattern.\n",- "Here is an example tool-use agent that uses {py:class}`~agnext.components.tool_agent.ToolAgent`\n",+ "Here is an example tool-use agent that uses {py:class}`~autogen_core.components.tool_agent.ToolAgent`\n","as an inner agent for executing tools."]},@@ -142,18 +142,18 @@"from dataclasses import dataclass\n","from typing import List\n","\n",- "from agnext.application import SingleThreadedAgentRuntime\n",- "from agnext.base import AgentId, AgentInstantiationContext, MessageContext\n",- "from agnext.components import RoutedAgent, message_handler\n",- "from agnext.components.models import (\n",+ "from autogen_core.application import SingleThreadedAgentRuntime\n",+ "from autogen_core.base import AgentId, AgentInstantiationContext, MessageContext\n",+ "from autogen_core.components import RoutedAgent, message_handler\n",+ "from autogen_core.components.models import (\n"," ChatCompletionClient,\n"," LLMMessage,\n"," OpenAIChatCompletionClient,\n"," SystemMessage,\n"," UserMessage,\n",")\n",- "from agnext.components.tool_agent import ToolAgent, tool_agent_caller_loop\n",- "from agnext.components.tools import FunctionTool, Tool, ToolSchema\n",+ "from autogen_core.components.tool_agent import ToolAgent, tool_agent_caller_loop\n",+ "from autogen_core.components.tools import FunctionTool, Tool, ToolSchema\n","\n","\n","@dataclass\n",@@ -191,7 +191,7 @@"cell_type": "markdown","metadata": {},"source": [- "The `ToolUseAgent` class uses a convenience function {py:meth}`agnext.components.tool_agent.tool_agent_caller_loop`, \n",+ "The `ToolUseAgent` class uses a convenience function {py:meth}`autogen_core.components.tool_agent.tool_agent_caller_loop`, \n","to handle the interaction between the model and the tool agent.\n","The core idea can be described using a simple control flow graph:\n","\n",@@ -200,7 +200,7 @@"The `ToolUseAgent`'s `handle_user_message` handler handles messages from the user,\n","and determines whether the model has generated a tool call.\n","If the model has generated tool calls, then the handler sends a function call\n",- "message to the {py:class}`~agnext.components.tool_agent.ToolAgent` agent\n",+ "message to the {py:class}`~autogen_core.components.tool_agent.ToolAgent` agent\n","to execute the tools,\n","and then queries the model again with the results of the tool calls.\n","This process continues until the model stops generating tool calls,\n",@@ -256,7 +256,7 @@"cell_type": "markdown","metadata": {},"source": [- "This example uses the {py:class}`agnext.components.models.OpenAIChatCompletionClient`,\n",+ "This example uses the {py:class}`autogen_core.components.models.OpenAIChatCompletionClient`,\n","for Azure OpenAI and other clients, see [Model Clients](./model-clients.ipynb).\n","Let's test the agent with a question about stock price."]@@ -289,7 +289,7 @@"cell_type": "markdown","metadata": {},"source": [- "See [samples](https://github.com/microsoft/agnext/tree/main/python/samples#tool-use-examples)\n",+ "See [samples](https://github.com/microsoft/autogen_core/tree/main/python/samples#tool-use-examples)\n","for more examples of using tools with agents, including how to use\n","broadcast communication model for tool execution, and how to intercept tool\n","execution for human-in-the-loop approval."@@ -298,7 +298,7 @@],"metadata": {"kernelspec": {- "display_name": "agnext",+ "display_name": "autogen_core","language": "python","name": "python3"},diff --git a/python/docs/src/guides/logging.md b/python/docs/src/guides/logging.mdindex 8c284dd88..4241c8ada 100644--- a/python/docs/src/guides/logging.md+++ b/python/docs/src/guides/logging.md@@ -5,11 +5,11 @@ AGNext uses Python's built-in [`logging`](https://docs.python.org/3/library/loggThere are two kinds of logging:- **Trace logging**: This is used for debugging and is human readable messages to indicate what is going on. This is intended for a developer to understand what is happening in the code. The content and format of these logs should not be depended on by other systems.- - Name: {py:attr}`~agnext.application.logging.TRACE_LOGGER_NAME`.+ - Name: {py:attr}`~autogen_core.application.logging.TRACE_LOGGER_NAME`.- **Structured logging**: This logger emits structured events that can be consumed by other systems. The content and format of these logs should be can be depended on by other systems.- - Name: {py:attr}`~agnext.application.logging.EVENT_LOGGER_NAME`.- - See the module {py:mod}`agnext.application.logging.events` to see the available events.-- {py:attr}`~agnext.application.logging.ROOT_LOGGER` can be used to enable or disable all logs at the same time.+ - Name: {py:attr}`~autogen_core.application.logging.EVENT_LOGGER_NAME`.+ - See the module {py:mod}`autogen_core.application.logging.events` to see the available events.+- {py:attr}`~autogen_core.application.logging.ROOT_LOGGER` can be used to enable or disable all logs at the same time.## Enabling logging output@@ -18,7 +18,7 @@ To enable trace logging, you can use the following code:```pythonimport logging-from agnext.application.logging import TRACE_LOGGER_NAME+from autogen_core.application.logging import TRACE_LOGGER_NAMElogging.basicConfig(level=logging.WARNING)logger = logging.getLogger(TRACE_LOGGER_NAME)@@ -70,7 +70,7 @@ These two names are the root loggers for these types. Code that emits logs shoul```pythonimport logging-from agnext.application.logging import TRACE_LOGGER_NAME+from autogen_core.application.logging import TRACE_LOGGER_NAMElogger = logging.getLogger(f"{TRACE_LOGGER_NAME}.my_module")```@@ -90,7 +90,7 @@ class MyEvent:Then it could be emitted in code like this:```python-from agnext.application.logging import EVENT_LOGGER_NAME+from autogen_core.application.logging import EVENT_LOGGER_NAMElogger = logging.getLogger(EVENT_LOGGER_NAME + ".my_module")logger.info(MyEvent("timestamp", "message"))diff --git a/python/docs/src/index.rst b/python/docs/src/index.rstindex 11ad69db3..0efc3a2f1 100644--- a/python/docs/src/index.rst+++ b/python/docs/src/index.rst@@ -64,9 +64,9 @@ from `Agent and Multi-Agent Application <core-concepts/agent-and-multi-agent-app:caption: Reference:hidden:- reference/agnext.components- reference/agnext.application- reference/agnext.base+ reference/autogen_core.components+ reference/autogen_core.application+ reference/autogen_core.base.. toctree:::caption: Otherdiff --git a/python/pyproject.toml b/python/pyproject.tomlindex e8b04e329..796d4807d 100644--- a/python/pyproject.toml+++ b/python/pyproject.toml@@ -3,7 +3,7 @@ requires = ["hatchling"]build-backend = "hatchling.build"[project]-name = "agnext"+name = "autogen-core"version = "0.0.1"description = "A small example package"readme = "README.md"@@ -112,7 +112,7 @@ check = [installer = "uv"detached = truedependencies = [- "agnext@{root:uri}",+ "autogen_core@{root:uri}","agbench@{root:uri}/tools/agbench","team-one@{root:uri}/teams/team-one",]@@ -121,14 +121,14 @@ dependencies = [installer = "uv"detached = truedependencies = [- "agnext@{root:uri}",+ "autogen_core@{root:uri}","agbench@{root:uri}/tools/agbench",][tool.ruff]line-length = 120fix = true-exclude = ["build", "dist", "src/agnext/application/protos"]+exclude = ["build", "dist", "src/autogen_core/application/protos"]target-version = "py310"include = ["src/**", "samples/*.py", "docs/**/*.ipynb"]@@ -145,7 +145,7 @@ ignore = ["F401", "E501"][tool.mypy]files = ["src", "samples", "tests"]-exclude = ["src/agnext/application/protos"]+exclude = ["src/autogen_core/application/protos"]strict = truepython_version = "3.10"@@ -168,7 +168,7 @@ include = ["src", "tests", "samples"]typeCheckingMode = "strict"reportUnnecessaryIsInstance = falsereportMissingTypeStubs = false-exclude = ["src/agnext/application/protos"]+exclude = ["src/autogen_core/application/protos"][tool.pytest.ini_options]minversion = "6.0"@@ -178,7 +178,7 @@ testpaths = ["tests"]dependencies = ["hatch-protobuf", "mypy-protobuf~=3.0"]generate_pyi = falseproto_paths = ["../protos"]-output_path = "src/agnext/application/protos"+output_path = "src/autogen_core/application/protos"[[tool.hatch.build.hooks.protobuf.generators]]diff --git a/python/samples/byoa/langgraph_agent.py b/python/samples/byoa/langgraph_agent.pyindex f07b1f76d..da13c065b 100644--- a/python/samples/byoa/langgraph_agent.py+++ b/python/samples/byoa/langgraph_agent.py@@ -8,9 +8,9 @@ import asynciofrom dataclasses import dataclassfrom typing import Any, Callable, List, Literal-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId, MessageContext-from agnext.components import RoutedAgent, message_handler+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId, MessageContext+from autogen_core.components import RoutedAgent, message_handlerfrom langchain_core.messages import HumanMessage, SystemMessagefrom langchain_core.tools import tool # pyright: ignorefrom langchain_openai import ChatOpenAI@@ -132,5 +132,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/byoa/llamaindex_agent.py b/python/samples/byoa/llamaindex_agent.pyindex 0d98fe64f..ca9c784e2 100644--- a/python/samples/byoa/llamaindex_agent.py+++ b/python/samples/byoa/llamaindex_agent.py@@ -7,9 +7,9 @@ import osfrom dataclasses import dataclassfrom typing import List, Optional-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId, MessageContext-from agnext.components import RoutedAgent, message_handler+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId, MessageContext+from autogen_core.components import RoutedAgent, message_handlerfrom llama_index.core import Settingsfrom llama_index.core.agent import ReActAgentfrom llama_index.core.agent.runner.base import AgentRunner@@ -144,5 +144,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/common/agents/_chat_completion_agent.py b/python/samples/common/agents/_chat_completion_agent.pyindex b7ffb36a4..db4a418f6 100644--- a/python/samples/common/agents/_chat_completion_agent.py+++ b/python/samples/common/agents/_chat_completion_agent.py@@ -2,21 +2,21 @@ import asyncioimport jsonfrom typing import Any, Coroutine, Dict, List, Mapping, Sequence, Tuple-from agnext.base import AgentId, CancellationToken, MessageContext-from agnext.components import (+from autogen_core.base import AgentId, CancellationToken, MessageContext+from autogen_core.components import (DefaultTopicId,FunctionCall,RoutedAgent,message_handler,)-from agnext.components.memory import ChatMemory-from agnext.components.models import (+from autogen_core.components.memory import ChatMemory+from autogen_core.components.models import (ChatCompletionClient,FunctionExecutionResult,FunctionExecutionResultMessage,SystemMessage,)-from agnext.components.tools import Tool+from autogen_core.components.tools import Toolfrom ..types import (FunctionCallMessage,diff --git a/python/samples/common/agents/_image_generation_agent.py b/python/samples/common/agents/_image_generation_agent.pyindex 648c14258..6e99fa86a 100644--- a/python/samples/common/agents/_image_generation_agent.py+++ b/python/samples/common/agents/_image_generation_agent.py@@ -1,14 +1,14 @@from typing import Literalimport openai-from agnext.base import CancellationToken, MessageContext-from agnext.components import (+from autogen_core.base import CancellationToken, MessageContext+from autogen_core.components import (DefaultTopicId,Image,RoutedAgent,message_handler,)-from agnext.components.memory import ChatMemory+from autogen_core.components.memory import ChatMemoryfrom ..types import (Message,diff --git a/python/samples/common/agents/_oai_assistant.py b/python/samples/common/agents/_oai_assistant.pyindex 689275ca3..b5a53354b 100644--- a/python/samples/common/agents/_oai_assistant.py+++ b/python/samples/common/agents/_oai_assistant.py@@ -1,11 +1,11 @@from typing import Any, Callable, List, Mappingimport openai-from agnext.base import (+from autogen_core.base import (CancellationToken,MessageContext, # type: ignore)-from agnext.components import DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components import DefaultTopicId, RoutedAgent, message_handlerfrom openai import AsyncAssistantEventHandlerfrom openai.types import ResponseFormatJSONObject, ResponseFormatTextdiff --git a/python/samples/common/agents/_user_proxy.py b/python/samples/common/agents/_user_proxy.pyindex 1bf6ea23f..8cf32dc92 100644--- a/python/samples/common/agents/_user_proxy.py+++ b/python/samples/common/agents/_user_proxy.py@@ -1,7 +1,7 @@import asyncio-from agnext.base import MessageContext-from agnext.components import DefaultTopicId, RoutedAgent, message_handler+from autogen_core.base import MessageContext+from autogen_core.components import DefaultTopicId, RoutedAgent, message_handlerfrom ..types import PublishNow, TextMessagediff --git a/python/samples/common/memory/_buffered.py b/python/samples/common/memory/_buffered.pyindex 1e80595e5..8470757bc 100644--- a/python/samples/common/memory/_buffered.py+++ b/python/samples/common/memory/_buffered.py@@ -1,7 +1,7 @@from typing import Any, List, Mapping-from agnext.components.memory import ChatMemory-from agnext.components.models import FunctionExecutionResultMessage+from autogen_core.components.memory import ChatMemory+from autogen_core.components.models import FunctionExecutionResultMessagefrom ..types import Messagediff --git a/python/samples/common/memory/_head_and_tail.py b/python/samples/common/memory/_head_and_tail.pyindex c1e9b22b4..88b292b71 100644--- a/python/samples/common/memory/_head_and_tail.py+++ b/python/samples/common/memory/_head_and_tail.py@@ -1,7 +1,7 @@from typing import Any, List, Mapping-from agnext.components.memory import ChatMemory-from agnext.components.models import FunctionExecutionResultMessage+from autogen_core.components.memory import ChatMemory+from autogen_core.components.models import FunctionExecutionResultMessagefrom ..types import FunctionCallMessage, Message, TextMessagediff --git a/python/samples/common/patterns/_group_chat_manager.py b/python/samples/common/patterns/_group_chat_manager.pyindex 62c5d0b07..9a9311d18 100644--- a/python/samples/common/patterns/_group_chat_manager.py+++ b/python/samples/common/patterns/_group_chat_manager.py@@ -1,10 +1,10 @@import loggingfrom typing import Any, Callable, List, Mapping-from agnext.base import AgentId, AgentProxy, MessageContext-from agnext.components import RoutedAgent, message_handler-from agnext.components.memory import ChatMemory-from agnext.components.models import ChatCompletionClient+from autogen_core.base import AgentId, AgentProxy, MessageContext+from autogen_core.components import RoutedAgent, message_handler+from autogen_core.components.memory import ChatMemory+from autogen_core.components.models import ChatCompletionClientfrom ..types import (Message,@@ -15,7 +15,7 @@ from ..types import ()from ._group_chat_utils import select_speaker-logger = logging.getLogger("agnext.events")+logger = logging.getLogger("autogen_core.events")class GroupChatManager(RoutedAgent):diff --git a/python/samples/common/patterns/_group_chat_utils.py b/python/samples/common/patterns/_group_chat_utils.pyindex c61d7ff26..624e45644 100644--- a/python/samples/common/patterns/_group_chat_utils.py+++ b/python/samples/common/patterns/_group_chat_utils.py@@ -3,9 +3,9 @@import refrom typing import Dict, List-from agnext.base import AgentProxy-from agnext.components.memory import ChatMemory-from agnext.components.models import ChatCompletionClient, SystemMessage+from autogen_core.base import AgentProxy+from autogen_core.components.memory import ChatMemory+from autogen_core.components.models import ChatCompletionClient, SystemMessagefrom ..types import Message, TextMessagediff --git a/python/samples/common/patterns/_orchestrator_chat.py b/python/samples/common/patterns/_orchestrator_chat.pyindex 3275f0358..687503279 100644--- a/python/samples/common/patterns/_orchestrator_chat.py+++ b/python/samples/common/patterns/_orchestrator_chat.py@@ -1,8 +1,8 @@import jsonfrom typing import Any, Sequence, Tuple-from agnext.base import AgentId, AgentRuntime, MessageContext-from agnext.components import RoutedAgent, message_handler+from autogen_core.base import AgentId, AgentRuntime, MessageContext+from autogen_core.components import RoutedAgent, message_handlerfrom ..types import Reset, RespondNow, ResponseFormat, TextMessagediff --git a/python/samples/common/types.py b/python/samples/common/types.pyindex 02b0d1eba..028f0ab7b 100644--- a/python/samples/common/types.py+++ b/python/samples/common/types.py@@ -4,8 +4,8 @@ from dataclasses import dataclass, fieldfrom enum import Enumfrom typing import List, Union-from agnext.components import FunctionCall, Image-from agnext.components.models import FunctionExecutionResultMessage+from autogen_core.components import FunctionCall, Image+from autogen_core.components.models import FunctionExecutionResultMessage@dataclass(kw_only=True)diff --git a/python/samples/common/utils.py b/python/samples/common/utils.pyindex c91b18b55..4e77ac332 100644--- a/python/samples/common/utils.py+++ b/python/samples/common/utils.py@@ -1,7 +1,7 @@import osfrom typing import Any, List, Optional, Union-from agnext.components.models import (+from autogen_core.components.models import (AssistantMessage,AzureOpenAIChatCompletionClient,ChatCompletionClient,diff --git a/python/samples/core/inner_outer_direct.py b/python/samples/core/inner_outer_direct.pyindex d87d73372..4d2a1f933 100644--- a/python/samples/core/inner_outer_direct.py+++ b/python/samples/core/inner_outer_direct.py@@ -10,9 +10,9 @@ import asyncioimport loggingfrom dataclasses import dataclass-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId, AgentInstantiationContext, MessageContext-from agnext.components import RoutedAgent, message_handler+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId, AgentInstantiationContext, MessageContext+from autogen_core.components import RoutedAgent, message_handler@dataclass@@ -60,5 +60,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/core/one_agent_direct.py b/python/samples/core/one_agent_direct.pyindex 4b31febaa..a530a83b3 100644--- a/python/samples/core/one_agent_direct.py+++ b/python/samples/core/one_agent_direct.py@@ -10,10 +10,10 @@ import osimport sysfrom dataclasses import dataclass-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId-from agnext.components import RoutedAgent, message_handler-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId+from autogen_core.components import RoutedAgent, message_handler+from autogen_core.components.models import (ChatCompletionClient,SystemMessage,UserMessage,@@ -21,7 +21,7 @@ from agnext.components.models import (sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom common.utils import get_chat_completion_client_from_envs@@ -67,5 +67,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/core/two_agents_pub_sub.py b/python/samples/core/two_agents_pub_sub.pyindex fe3134f72..70fcca88c 100644--- a/python/samples/core/two_agents_pub_sub.py+++ b/python/samples/core/two_agents_pub_sub.py@@ -16,10 +16,10 @@ import sysfrom dataclasses import dataclassfrom typing import List-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId-from agnext.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId+from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components.models import (AssistantMessage,ChatCompletionClient,LLMMessage,@@ -29,7 +29,7 @@ from agnext.components.models import (sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom common.utils import get_chat_completion_client_from_envs@@ -121,5 +121,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/demos/assistant.py b/python/samples/demos/assistant.pyindex 29918bef5..fefdc7b16 100644--- a/python/samples/demos/assistant.py+++ b/python/samples/demos/assistant.py@@ -11,9 +11,9 @@ from typing import Listimport aiofilesimport openai-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId, AgentRuntime, MessageContext-from agnext.components import DefaultTopicId, RoutedAgent, message_handler+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId, AgentRuntime, MessageContext+from autogen_core.components import DefaultTopicId, RoutedAgent, message_handlerfrom openai import AsyncAssistantEventHandlerfrom openai.types.beta.thread import ToolResourcesfrom openai.types.beta.threads import Message, Text, TextDelta@@ -22,7 +22,7 @@ from typing_extensions import overridesys.path.append(os.path.join(os.path.dirname(__file__), ".."))-from agnext.base import AgentInstantiationContext+from autogen_core.base import AgentInstantiationContextfrom common.agents import OpenAIAssistantAgentfrom common.memory import BufferedChatMemoryfrom common.patterns._group_chat_manager import GroupChatManager@@ -246,7 +246,7 @@ if __name__ == "__main__":args = parser.parse_args()if args.verbose:logging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)handler = logging.FileHandler("assistant.log")- logging.getLogger("agnext").addHandler(handler)+ logging.getLogger("autogen_core").addHandler(handler)asyncio.run(main())diff --git a/python/samples/demos/chat_room.py b/python/samples/demos/chat_room.pyindex 5a9ddbe45..350e86366 100644--- a/python/samples/demos/chat_room.py+++ b/python/samples/demos/chat_room.py@@ -5,16 +5,16 @@ import loggingimport osimport sys-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId, AgentInstantiationContext, AgentProxy, AgentRuntime-from agnext.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler-from agnext.components.memory import ChatMemory-from agnext.components.models import ChatCompletionClient, SystemMessage+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId, AgentInstantiationContext, AgentProxy, AgentRuntime+from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components.memory import ChatMemory+from autogen_core.components.models import ChatCompletionClient, SystemMessagesys.path.append(os.path.abspath(os.path.dirname(__file__)))sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom common.memory import BufferedChatMemoryfrom common.types import Message, TextMessagefrom common.utils import convert_messages_to_llm_messages, get_chat_completion_client_from_envs@@ -160,7 +160,7 @@ if __name__ == "__main__":args = parser.parse_args()if args.verbose:logging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)handler = logging.FileHandler("chat_room.log")- logging.getLogger("agnext").addHandler(handler)+ logging.getLogger("autogen_core").addHandler(handler)asyncio.run(main())diff --git a/python/samples/demos/chess_game.py b/python/samples/demos/chess_game.pyindex 566b096de..55765cc64 100644--- a/python/samples/demos/chess_game.py+++ b/python/samples/demos/chess_game.py@@ -9,17 +9,17 @@ import osimport sysfrom typing import Annotated, Literal-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentInstantiationContext, AgentRuntime-from agnext.components import DefaultSubscription, DefaultTopicId-from agnext.components.models import SystemMessage-from agnext.components.tools import FunctionTool+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentInstantiationContext, AgentRuntime+from autogen_core.components import DefaultSubscription, DefaultTopicId+from autogen_core.components.models import SystemMessage+from autogen_core.components.tools import FunctionToolfrom chess import BLACK, SQUARE_NAMES, WHITE, Board, Movefrom chess import piece_name as get_piece_namesys.path.append(os.path.join(os.path.dirname(__file__), ".."))-from agnext.base import AgentId+from autogen_core.base import AgentIdfrom common.agents._chat_completion_agent import ChatCompletionAgentfrom common.memory import BufferedChatMemoryfrom common.patterns._group_chat_manager import GroupChatManager@@ -224,8 +224,8 @@ if __name__ == "__main__":args = parser.parse_args()if args.verbose:logging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)handler = logging.FileHandler("chess_game.log")- logging.getLogger("agnext").addHandler(handler)+ logging.getLogger("autogen_core").addHandler(handler)asyncio.run(main())diff --git a/python/samples/demos/illustrator_critics.py b/python/samples/demos/illustrator_critics.pyindex af49daa53..7a3c2447e 100644--- a/python/samples/demos/illustrator_critics.py+++ b/python/samples/demos/illustrator_critics.py@@ -5,14 +5,14 @@ import osimport sysimport openai-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentInstantiationContext, AgentRuntime-from agnext.components.models import SystemMessage+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentInstantiationContext, AgentRuntime+from autogen_core.components.models import SystemMessagesys.path.append(os.path.abspath(os.path.dirname(__file__)))sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import AgentId, AgentProxy+from autogen_core.base import AgentId, AgentProxyfrom common.agents import ChatCompletionAgent, ImageGenerationAgentfrom common.memory import BufferedChatMemoryfrom common.patterns._group_chat_manager import GroupChatManager@@ -116,7 +116,7 @@ if __name__ == "__main__":args = parser.parse_args()if args.verbose:logging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)handler = logging.FileHandler("illustrator_critics.log")- logging.getLogger("agnext").addHandler(handler)+ logging.getLogger("autogen_core").addHandler(handler)asyncio.run(main())diff --git a/python/samples/demos/software_consultancy.py b/python/samples/demos/software_consultancy.pyindex d3fcb7985..5ac071a65 100644--- a/python/samples/demos/software_consultancy.py+++ b/python/samples/demos/software_consultancy.py@@ -16,10 +16,10 @@ import sysimport aiofilesimport aiohttpimport openai-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentInstantiationContext, AgentRuntime-from agnext.components.models import SystemMessage-from agnext.components.tools import FunctionTool+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentInstantiationContext, AgentRuntime+from autogen_core.components.models import SystemMessage+from autogen_core.components.tools import FunctionToolfrom markdownify import markdownify # type: ignorefrom tqdm import tqdmfrom typing_extensions import Annotated@@ -27,7 +27,7 @@ from typing_extensions import Annotatedsys.path.append(os.path.abspath(os.path.dirname(__file__)))sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import AgentId+from autogen_core.base import AgentIdfrom common.agents import ChatCompletionAgentfrom common.memory import HeadAndTailChatMemoryfrom common.patterns._group_chat_manager import GroupChatManager@@ -299,7 +299,7 @@ if __name__ == "__main__":args = parser.parse_args()if args.verbose:logging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)handler = logging.FileHandler("software_consultancy.log")- logging.getLogger("agnext").addHandler(handler)+ logging.getLogger("autogen_core").addHandler(handler)asyncio.run(main())diff --git a/python/samples/demos/utils.py b/python/samples/demos/utils.pyindex a5a7ab285..ef55b7b9a 100644--- a/python/samples/demos/utils.py+++ b/python/samples/demos/utils.py@@ -4,8 +4,8 @@ import randomimport sysfrom asyncio import Future-from agnext.base import AgentRuntime, CancellationToken-from agnext.components import DefaultTopicId, Image, RoutedAgent, message_handler+from autogen_core.base import AgentRuntime, CancellationToken+from autogen_core.components import DefaultTopicId, Image, RoutedAgent, message_handlerfrom textual.app import App, ComposeResultfrom textual.containers import ScrollableContainerfrom textual.widgets import Button, Footer, Header, Input, Markdown, Staticdiff --git a/python/samples/marketing-agents/app.py b/python/samples/marketing-agents/app.pyindex 18adbf38f..221b3313a 100644--- a/python/samples/marketing-agents/app.py+++ b/python/samples/marketing-agents/app.py@@ -1,9 +1,9 @@import os-from agnext.base import AgentRuntime-from agnext.components import DefaultSubscription-from agnext.components.models import AzureOpenAIChatCompletionClientfrom auditor import AuditAgent+from autogen_core.base import AgentRuntime+from autogen_core.components import DefaultSubscription+from autogen_core.components.models import AzureOpenAIChatCompletionClientfrom graphic_designer import GraphicDesignerAgentfrom openai import AsyncAzureOpenAIdiff --git a/python/samples/marketing-agents/auditor.py b/python/samples/marketing-agents/auditor.pyindex 088a89218..e8b169438 100644--- a/python/samples/marketing-agents/auditor.py+++ b/python/samples/marketing-agents/auditor.py@@ -1,7 +1,7 @@-from agnext.base import MessageContext-from agnext.components import DefaultTopicId, RoutedAgent, message_handler-from agnext.components.models import ChatCompletionClient-from agnext.components.models._types import SystemMessage+from autogen_core.base import MessageContext+from autogen_core.components import DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components.models import ChatCompletionClient+from autogen_core.components.models._types import SystemMessagefrom messages import AuditorAlert, AuditTextauditor_prompt = """You are an Auditor in a Marketing teamdiff --git a/python/samples/marketing-agents/graphic_designer.py b/python/samples/marketing-agents/graphic_designer.pyindex 203d34afb..4da585ca3 100644--- a/python/samples/marketing-agents/graphic_designer.py+++ b/python/samples/marketing-agents/graphic_designer.py@@ -2,8 +2,8 @@ import loggingfrom typing import Literalimport openai-from agnext.base import MessageContext-from agnext.components import (+from autogen_core.base import MessageContext+from autogen_core.components import (DefaultTopicId,RoutedAgent,message_handler,diff --git a/python/samples/marketing-agents/test_usage.py b/python/samples/marketing-agents/test_usage.pyindex 70806c36f..30d936099 100644--- a/python/samples/marketing-agents/test_usage.py+++ b/python/samples/marketing-agents/test_usage.py@@ -1,10 +1,10 @@import asyncioimport os-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import MessageContext-from agnext.components import DefaultTopicId, Image, RoutedAgent, message_handlerfrom app import build_app+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import MessageContext+from autogen_core.components import DefaultTopicId, Image, RoutedAgent, message_handlerfrom dotenv import load_dotenvfrom messages import ArticleCreated, AuditorAlert, AuditText, GraphicDesignCreateddiff --git a/python/samples/marketing-agents/worker.py b/python/samples/marketing-agents/worker.pyindex c8b44989e..e80a7dbd7 100644--- a/python/samples/marketing-agents/worker.py+++ b/python/samples/marketing-agents/worker.py@@ -1,13 +1,13 @@import asyncioimport logging-from agnext.application import WorkerAgentRuntime-from agnext.base import MESSAGE_TYPE_REGISTRYfrom app import build_app+from autogen_core.application import WorkerAgentRuntime+from autogen_core.base import MESSAGE_TYPE_REGISTRYfrom dotenv import load_dotenvfrom messages import ArticleCreated, AuditorAlert, AuditText, GraphicDesignCreated-agnext_logger = logging.getLogger("agnext")+agnext_logger = logging.getLogger("autogen_core")async def main() -> None:diff --git a/python/samples/patterns/coder_executor.py b/python/samples/patterns/coder_executor.pyindex 44ae4c057..9d96c3d39 100644--- a/python/samples/patterns/coder_executor.py+++ b/python/samples/patterns/coder_executor.py@@ -20,10 +20,10 @@ import uuidfrom dataclasses import dataclassfrom typing import Dict, List-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler-from agnext.components.code_executor import CodeBlock, CodeExecutor, LocalCommandLineCodeExecutor-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components.code_executor import CodeBlock, CodeExecutor, LocalCommandLineCodeExecutor+from autogen_core.components.models import (AssistantMessage,ChatCompletionClient,LLMMessage,@@ -33,7 +33,7 @@ from agnext.components.models import (sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom common.utils import get_chat_completion_client_from_envs@@ -210,7 +210,7 @@ if __name__ == "__main__":from datetime import datetimelogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)task = f"Today is {datetime.today()}, create a plot of NVDA and TSLA stock prices YTD using yfinance."diff --git a/python/samples/patterns/coder_reviewer.py b/python/samples/patterns/coder_reviewer.pyindex 4516368d3..679f68d62 100644--- a/python/samples/patterns/coder_reviewer.py+++ b/python/samples/patterns/coder_reviewer.py@@ -20,9 +20,9 @@ import uuidfrom dataclasses import dataclassfrom typing import Dict, List, Union-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components.models import (AssistantMessage,ChatCompletionClient,LLMMessage,@@ -32,7 +32,7 @@ from agnext.components.models import (sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom common.utils import get_chat_completion_client_from_envs@@ -291,5 +291,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/patterns/group_chat.py b/python/samples/patterns/group_chat.pyindex d84aa7508..1680398d6 100644--- a/python/samples/patterns/group_chat.py+++ b/python/samples/patterns/group_chat.py@@ -17,10 +17,10 @@ import sysfrom dataclasses import dataclassfrom typing import List-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId, AgentInstantiationContext-from agnext.components import DefaultTopicId, RoutedAgent, message_handler-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId, AgentInstantiationContext+from autogen_core.components import DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components.models import (AssistantMessage,ChatCompletionClient,LLMMessage,@@ -30,7 +30,7 @@ from agnext.components.models import (sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom common.utils import get_chat_completion_client_from_envs@@ -167,5 +167,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/patterns/mixture_of_agents.py b/python/samples/patterns/mixture_of_agents.pyindex f208e82ff..d88fe1c13 100644--- a/python/samples/patterns/mixture_of_agents.py+++ b/python/samples/patterns/mixture_of_agents.py@@ -14,10 +14,10 @@ import uuidfrom dataclasses import dataclassfrom typing import Dict, List-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import MessageContext-from agnext.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler-from agnext.components.models import ChatCompletionClient, SystemMessage, UserMessage+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import MessageContext+from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components.models import ChatCompletionClient, SystemMessage, UserMessagesys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))@@ -164,5 +164,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/patterns/multi_agent_debate.py b/python/samples/patterns/multi_agent_debate.pyindex a5c5f523a..2b236e0b1 100644--- a/python/samples/patterns/multi_agent_debate.py+++ b/python/samples/patterns/multi_agent_debate.py@@ -39,9 +39,9 @@ import uuidfrom dataclasses import dataclassfrom typing import Dict, List, Tuple-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components.models import (AssistantMessage,ChatCompletionClient,LLMMessage,@@ -51,7 +51,7 @@ from agnext.components.models import (sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom common.utils import get_chat_completion_client_from_envslogger = logging.getLogger(__name__)@@ -271,7 +271,7 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main("Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?"diff --git a/python/samples/tool-use/coding_direct.py b/python/samples/tool-use/coding_direct.pyindex a2b76d215..24c347250 100644--- a/python/samples/tool-use/coding_direct.py+++ b/python/samples/tool-use/coding_direct.py@@ -16,11 +16,11 @@ import sysfrom dataclasses import dataclassfrom typing import List-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId, AgentInstantiationContext-from agnext.components import FunctionCall, RoutedAgent, message_handler-from agnext.components.code_executor import LocalCommandLineCodeExecutor-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId, AgentInstantiationContext+from autogen_core.components import FunctionCall, RoutedAgent, message_handler+from autogen_core.components.code_executor import LocalCommandLineCodeExecutor+from autogen_core.components.models import (AssistantMessage,ChatCompletionClient,FunctionExecutionResult,@@ -29,12 +29,12 @@ from agnext.components.models import (SystemMessage,UserMessage,)-from agnext.components.tool_agent import ToolAgent, ToolException-from agnext.components.tools import PythonCodeExecutionTool, Tool, ToolSchema+from autogen_core.components.tool_agent import ToolAgent, ToolException+from autogen_core.components.tools import PythonCodeExecutionTool, Tool, ToolSchemasys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom common.utils import get_chat_completion_client_from_envs@@ -141,5 +141,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/tool-use/coding_direct_with_intercept.py b/python/samples/tool-use/coding_direct_with_intercept.pyindex c4341084a..617908b50 100644--- a/python/samples/tool-use/coding_direct_with_intercept.py+++ b/python/samples/tool-use/coding_direct_with_intercept.py@@ -10,14 +10,14 @@ import osimport sysfrom typing import Any, List-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId, AgentInstantiationContext-from agnext.base.intervention import DefaultInterventionHandler, DropMessage-from agnext.components import FunctionCall-from agnext.components.code_executor import LocalCommandLineCodeExecutor-from agnext.components.models import SystemMessage-from agnext.components.tool_agent import ToolAgent, ToolException-from agnext.components.tools import PythonCodeExecutionTool, Tool+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId, AgentInstantiationContext+from autogen_core.base.intervention import DefaultInterventionHandler, DropMessage+from autogen_core.components import FunctionCall+from autogen_core.components.code_executor import LocalCommandLineCodeExecutor+from autogen_core.components.models import SystemMessage+from autogen_core.components.tool_agent import ToolAgent, ToolException+from autogen_core.components.tools import PythonCodeExecutionTool, Toolsys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))@@ -82,5 +82,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/tool-use/coding_pub_sub.py b/python/samples/tool-use/coding_pub_sub.pyindex 810d8f69f..d6e3847dd 100644--- a/python/samples/tool-use/coding_pub_sub.py+++ b/python/samples/tool-use/coding_pub_sub.py@@ -19,10 +19,10 @@ import uuidfrom dataclasses import dataclassfrom typing import Dict, List-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import DefaultSubscription, DefaultTopicId, FunctionCall, RoutedAgent, message_handler-from agnext.components.code_executor import LocalCommandLineCodeExecutor-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import DefaultSubscription, DefaultTopicId, FunctionCall, RoutedAgent, message_handler+from autogen_core.components.code_executor import LocalCommandLineCodeExecutor+from autogen_core.components.models import (AssistantMessage,ChatCompletionClient,FunctionExecutionResult,@@ -31,11 +31,11 @@ from agnext.components.models import (SystemMessage,UserMessage,)-from agnext.components.tools import PythonCodeExecutionTool, Tool+from autogen_core.components.tools import PythonCodeExecutionTool, Toolsys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom common.utils import get_chat_completion_client_from_envs@@ -219,5 +219,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/tool-use/custom_tool_direct.py b/python/samples/tool-use/custom_tool_direct.pyindex 0cc882c38..fcad68ce9 100644--- a/python/samples/tool-use/custom_tool_direct.py+++ b/python/samples/tool-use/custom_tool_direct.py@@ -9,19 +9,19 @@ import randomimport sysfrom typing import List-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentInstantiationContext-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentInstantiationContext+from autogen_core.components.models import (SystemMessage,)-from agnext.components.tool_agent import ToolAgent-from agnext.components.tools import FunctionTool, Tool+from autogen_core.components.tool_agent import ToolAgent+from autogen_core.components.tools import FunctionTool, Toolfrom typing_extensions import Annotatedsys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__))))sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))-from agnext.base import AgentId+from autogen_core.base import AgentIdfrom coding_direct import Message, ToolUseAgentfrom common.utils import get_chat_completion_client_from_envs@@ -79,5 +79,5 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/worker/run_host.py b/python/samples/worker/run_host.pyindex eed1d586e..7da6492b5 100644--- a/python/samples/worker/run_host.py+++ b/python/samples/worker/run_host.py@@ -2,8 +2,8 @@ import asyncioimport signalimport grpc-from agnext.application import HostRuntimeServicer-from agnext.application.protos import agent_worker_pb2_grpc+from autogen_core.application import HostRuntimeServicer+from autogen_core.application.protos import agent_worker_pb2_grpcasync def serve(server: grpc.aio.Server) -> None: # type: ignore@@ -45,7 +45,7 @@ if __name__ == "__main__":import logginglogging.basicConfig(level=logging.WARNING)- logging.getLogger("agnext").setLevel(logging.DEBUG)+ logging.getLogger("autogen_core").setLevel(logging.DEBUG)try:asyncio.run(main())diff --git a/python/samples/worker/run_worker_pub_sub.py b/python/samples/worker/run_worker_pub_sub.pyindex 455715c4a..94dbb128c 100644--- a/python/samples/worker/run_worker_pub_sub.py+++ b/python/samples/worker/run_worker_pub_sub.py@@ -3,9 +3,9 @@ import loggingfrom dataclasses import dataclassfrom typing import Any, NoReturn-from agnext.application import WorkerAgentRuntime-from agnext.base import MESSAGE_TYPE_REGISTRY, MessageContext-from agnext.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler+from autogen_core.application import WorkerAgentRuntime+from autogen_core.base import MESSAGE_TYPE_REGISTRY, MessageContext+from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler@dataclass@@ -89,6 +89,6 @@ async def main() -> None:if __name__ == "__main__":logging.basicConfig(level=logging.DEBUG)- logger = logging.getLogger("agnext")+ logger = logging.getLogger("autogen_core")logger.setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/samples/worker/run_worker_rpc.py b/python/samples/worker/run_worker_rpc.pyindex d349878ad..b00f0ef64 100644--- a/python/samples/worker/run_worker_rpc.py+++ b/python/samples/worker/run_worker_rpc.py@@ -3,9 +3,9 @@ import loggingfrom dataclasses import dataclassfrom typing import Any, NoReturn-from agnext.application import WorkerAgentRuntime-from agnext.base import MESSAGE_TYPE_REGISTRY, AgentId, AgentInstantiationContext, MessageContext-from agnext.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler+from autogen_core.application import WorkerAgentRuntime+from autogen_core.base import MESSAGE_TYPE_REGISTRY, AgentId, AgentInstantiationContext, MessageContext+from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler@dataclass@@ -78,6 +78,6 @@ async def main() -> None:if __name__ == "__main__":logging.basicConfig(level=logging.DEBUG)- logger = logging.getLogger("agnext")+ logger = logging.getLogger("autogen_core")logger.setLevel(logging.DEBUG)asyncio.run(main())diff --git a/python/src/agnext/__init__.py b/python/src/autogen_core/__init__.pysimilarity index 100%rename from python/src/agnext/__init__.pyrename to python/src/autogen_core/__init__.pydiff --git a/python/src/agnext/application/__init__.py b/python/src/autogen_core/application/__init__.pysimilarity index 68%rename from python/src/agnext/application/__init__.pyrename to python/src/autogen_core/application/__init__.pyindex b7379f251..c1b2c14f1 100644--- a/python/src/agnext/application/__init__.py+++ b/python/src/autogen_core/application/__init__.py@@ -1,5 +1,5 @@"""-The :mod:`agnext.application` module provides implementations of core components that are used to compose an application+The :mod:`autogen_core.application` module provides implementations of core components that are used to compose an application"""from ._host_runtime_servicer import HostRuntimeServicerdiff --git a/python/src/agnext/application/_helpers.py b/python/src/autogen_core/application/_helpers.pysimilarity index 100%rename from python/src/agnext/application/_helpers.pyrename to python/src/autogen_core/application/_helpers.pydiff --git a/python/src/agnext/application/_host_runtime_servicer.py b/python/src/autogen_core/application/_host_runtime_servicer.pysimilarity index 99%rename from python/src/agnext/application/_host_runtime_servicer.pyrename to python/src/autogen_core/application/_host_runtime_servicer.pyindex 46e8547bc..09b33ea56 100644--- a/python/src/agnext/application/_host_runtime_servicer.py+++ b/python/src/autogen_core/application/_host_runtime_servicer.py@@ -11,8 +11,8 @@ from ..components import TypeSubscriptionfrom ._helpers import SubscriptionManagerfrom .protos import agent_worker_pb2, agent_worker_pb2_grpc-logger = logging.getLogger("agnext")-event_logger = logging.getLogger("agnext.events")+logger = logging.getLogger("autogen_core")+event_logger = logging.getLogger("autogen_core.events")class HostRuntimeServicer(agent_worker_pb2_grpc.AgentRpcServicer):diff --git a/python/src/agnext/application/_single_threaded_agent_runtime.py b/python/src/autogen_core/application/_single_threaded_agent_runtime.pysimilarity index 99%rename from python/src/agnext/application/_single_threaded_agent_runtime.pyrename to python/src/autogen_core/application/_single_threaded_agent_runtime.pyindex f1cb27237..f951e5555 100644--- a/python/src/agnext/application/_single_threaded_agent_runtime.py+++ b/python/src/autogen_core/application/_single_threaded_agent_runtime.py@@ -29,8 +29,8 @@ from ..base.exceptions import MessageDroppedExceptionfrom ..base.intervention import DropMessage, InterventionHandlerfrom ._helpers import SubscriptionManager, get_impl-logger = logging.getLogger("agnext")-event_logger = logging.getLogger("agnext.events")+logger = logging.getLogger("autogen_core")+event_logger = logging.getLogger("autogen_core.events")@dataclass(kw_only=True)diff --git a/python/src/agnext/application/_worker_runtime.py b/python/src/autogen_core/application/_worker_runtime.pysimilarity index 99%rename from python/src/agnext/application/_worker_runtime.pyrename to python/src/autogen_core/application/_worker_runtime.pyindex c5c28466f..c6edf6fd0 100644--- a/python/src/agnext/application/_worker_runtime.py+++ b/python/src/autogen_core/application/_worker_runtime.py@@ -50,8 +50,8 @@ from .protos import agent_worker_pb2, agent_worker_pb2_grpcif TYPE_CHECKING:from .protos.agent_worker_pb2_grpc import AgentRpcAsyncStub-logger = logging.getLogger("agnext")-event_logger = logging.getLogger("agnext.events")+logger = logging.getLogger("autogen_core")+event_logger = logging.getLogger("autogen_core.events")P = ParamSpec("P")T = TypeVar("T", bound=Agent)diff --git a/python/src/agnext/application/logging/__init__.py b/python/src/autogen_core/application/logging/__init__.pysimilarity index 77%rename from python/src/agnext/application/logging/__init__.pyrename to python/src/autogen_core/application/logging/__init__.pyindex 3daa29146..1a5f08054 100644--- a/python/src/agnext/application/logging/__init__.py+++ b/python/src/autogen_core/application/logging/__init__.py@@ -1,13 +1,13 @@from ._llm_usage import LLMUsageTracker-ROOT_LOGGER_NAME = "agnext"+ROOT_LOGGER_NAME = "autogen_core""""str: Logger name used for structured event logging"""-EVENT_LOGGER_NAME = "agnext.events"+EVENT_LOGGER_NAME = "autogen_core.events""""str: Logger name used for structured event logging"""-TRACE_LOGGER_NAME = "agnext.trace"+TRACE_LOGGER_NAME = "autogen_core.trace""""str: Logger name used for developer intended trace logging. The content and format of this log should not be depended upon."""__all__ = [diff --git a/python/src/agnext/application/logging/_llm_usage.py b/python/src/autogen_core/application/logging/_llm_usage.pysimilarity index 94%rename from python/src/agnext/application/logging/_llm_usage.pyrename to python/src/autogen_core/application/logging/_llm_usage.pyindex 04eb7b423..593739a23 100644--- a/python/src/agnext/application/logging/_llm_usage.py+++ b/python/src/autogen_core/application/logging/_llm_usage.py@@ -11,7 +11,7 @@ class LLMUsageTracker(logging.Handler):.. code-block:: python- from agnext.application.logging import LLMUsageTracker, EVENT_LOGGER_NAME+ from autogen_core.application.logging import LLMUsageTracker, EVENT_LOGGER_NAME# Set up the logging configuration to use the custom handlerlogger = logging.getLogger(EVENT_LOGGER_NAME)diff --git a/python/src/agnext/application/logging/events.py b/python/src/autogen_core/application/logging/events.pysimilarity index 94%rename from python/src/agnext/application/logging/events.pyrename to python/src/autogen_core/application/logging/events.pyindex 4d33ba3c0..b1446bbb9 100644--- a/python/src/agnext/application/logging/events.py+++ b/python/src/autogen_core/application/logging/events.py@@ -2,7 +2,7 @@ import jsonfrom enum import Enumfrom typing import Any, cast-from agnext.base import AgentId+from autogen_core.base import AgentIdclass LLMCallEvent:@@ -17,7 +17,7 @@ class LLMCallEvent:.. code-block:: python- from agnext.application.logging import LLMCallEvent, EVENT_LOGGER_NAME+ from autogen_core.application.logging import LLMCallEvent, EVENT_LOGGER_NAMElogger = logging.getLogger(EVENT_LOGGER_NAME)logger.info(LLMCallEvent(prompt_tokens=10, completion_tokens=20))diff --git a/python/src/agnext/application/protos/__init__.py b/python/src/autogen_core/application/protos/__init__.pysimilarity index 86%rename from python/src/agnext/application/protos/__init__.pyrename to python/src/autogen_core/application/protos/__init__.pyindex d03694c3d..71c260216 100644--- a/python/src/agnext/application/protos/__init__.py+++ b/python/src/autogen_core/application/protos/__init__.py@@ -1,5 +1,5 @@"""-The :mod:`agnext.worker.protos` module provides Google Protobuf classes for agent-worker communication+The :mod:`autogen_core.worker.protos` module provides Google Protobuf classes for agent-worker communication"""import osdiff --git a/python/src/agnext/application/protos/agent_worker_pb2.py b/python/src/autogen_core/application/protos/agent_worker_pb2.pysimilarity index 100%rename from python/src/agnext/application/protos/agent_worker_pb2.pyrename to python/src/autogen_core/application/protos/agent_worker_pb2.pydiff --git a/python/src/agnext/application/protos/agent_worker_pb2.pyi b/python/src/autogen_core/application/protos/agent_worker_pb2.pyisimilarity index 100%rename from python/src/agnext/application/protos/agent_worker_pb2.pyirename to python/src/autogen_core/application/protos/agent_worker_pb2.pyidiff --git a/python/src/agnext/application/protos/agent_worker_pb2_grpc.py b/python/src/autogen_core/application/protos/agent_worker_pb2_grpc.pysimilarity index 100%rename from python/src/agnext/application/protos/agent_worker_pb2_grpc.pyrename to python/src/autogen_core/application/protos/agent_worker_pb2_grpc.pydiff --git a/python/src/agnext/application/protos/agent_worker_pb2_grpc.pyi b/python/src/autogen_core/application/protos/agent_worker_pb2_grpc.pyisimilarity index 100%rename from python/src/agnext/application/protos/agent_worker_pb2_grpc.pyirename to python/src/autogen_core/application/protos/agent_worker_pb2_grpc.pyidiff --git a/python/src/agnext/base/__init__.py b/python/src/autogen_core/base/__init__.pysimilarity index 88%rename from python/src/agnext/base/__init__.pyrename to python/src/autogen_core/base/__init__.pyindex a84d49b11..a75807d61 100644--- a/python/src/agnext/base/__init__.py+++ b/python/src/autogen_core/base/__init__.py@@ -1,5 +1,5 @@"""-The :mod:`agnext.base` module provides the foundational generic interfaces upon which all else is built. This module must not depend on any other module.+The :mod:`autogen_core.base` module provides the foundational generic interfaces upon which all else is built. This module must not depend on any other module."""from ._agent import Agentdiff --git a/python/src/agnext/base/_agent.py b/python/src/autogen_core/base/_agent.pysimilarity index 100%rename from python/src/agnext/base/_agent.pyrename to python/src/autogen_core/base/_agent.pydiff --git a/python/src/agnext/base/_agent_id.py b/python/src/autogen_core/base/_agent_id.pysimilarity index 100%rename from python/src/agnext/base/_agent_id.pyrename to python/src/autogen_core/base/_agent_id.pydiff --git a/python/src/agnext/base/_agent_instantiation.py b/python/src/autogen_core/base/_agent_instantiation.pysimilarity index 100%rename from python/src/agnext/base/_agent_instantiation.pyrename to python/src/autogen_core/base/_agent_instantiation.pydiff --git a/python/src/agnext/base/_agent_metadata.py b/python/src/autogen_core/base/_agent_metadata.pysimilarity index 100%rename from python/src/agnext/base/_agent_metadata.pyrename to python/src/autogen_core/base/_agent_metadata.pydiff --git a/python/src/agnext/base/_agent_props.py b/python/src/autogen_core/base/_agent_props.pysimilarity index 100%rename from python/src/agnext/base/_agent_props.pyrename to python/src/autogen_core/base/_agent_props.pydiff --git a/python/src/agnext/base/_agent_proxy.py b/python/src/autogen_core/base/_agent_proxy.pysimilarity index 100%rename from python/src/agnext/base/_agent_proxy.pyrename to python/src/autogen_core/base/_agent_proxy.pydiff --git a/python/src/agnext/base/_agent_runtime.py b/python/src/autogen_core/base/_agent_runtime.pysimilarity index 98%rename from python/src/agnext/base/_agent_runtime.pyrename to python/src/autogen_core/base/_agent_runtime.pyindex d9734e1fb..d599d05d0 100644--- a/python/src/agnext/base/_agent_runtime.py+++ b/python/src/autogen_core/base/_agent_runtime.py@@ -79,7 +79,7 @@ class AgentRuntime(Protocol):Args:type (str): The type of agent this factory creates. It is not the same as agent class name. The `type` parameter is used to differentiate between different factory functions rather than agent classes.- agent_factory (Callable[[], T]): The factory that creates the agent, where T is a concrete Agent type. Inside the factory, use `agnext.base.AgentInstantiationContext` to access variables like the current runtime and agent ID.+ agent_factory (Callable[[], T]): The factory that creates the agent, where T is a concrete Agent type. Inside the factory, use `autogen_core.base.AgentInstantiationContext` to access variables like the current runtime and agent ID.subscriptions (Callable[[], list[Subscription]] | list[Subscription] | None, optional): The subscriptions that the agent should be subscribed to. Defaults to None.diff --git a/python/src/agnext/base/_agent_type.py b/python/src/autogen_core/base/_agent_type.pysimilarity index 100%rename from python/src/agnext/base/_agent_type.pyrename to python/src/autogen_core/base/_agent_type.pydiff --git a/python/src/agnext/base/_base_agent.py b/python/src/autogen_core/base/_base_agent.pysimilarity index 96%rename from python/src/agnext/base/_base_agent.pyrename to python/src/autogen_core/base/_base_agent.pyindex 7dec8d5d3..604d2c8ec 100644--- a/python/src/agnext/base/_base_agent.py+++ b/python/src/autogen_core/base/_base_agent.py@@ -55,7 +55,7 @@ class BaseAgent(ABC, Agent):*,cancellation_token: CancellationToken | None = None,) -> Any:- """See :py:meth:`agnext.base.AgentRuntime.send_message` for more information."""+ """See :py:meth:`autogen_core.base.AgentRuntime.send_message` for more information."""if cancellation_token is None:cancellation_token = CancellationToken()diff --git a/python/src/agnext/base/_cancellation_token.py b/python/src/autogen_core/base/_cancellation_token.pysimilarity index 100%rename from python/src/agnext/base/_cancellation_token.pyrename to python/src/autogen_core/base/_cancellation_token.pydiff --git a/python/src/agnext/base/_message_context.py b/python/src/autogen_core/base/_message_context.pysimilarity index 100%rename from python/src/agnext/base/_message_context.pyrename to python/src/autogen_core/base/_message_context.pydiff --git a/python/src/agnext/base/_message_handler_context.py b/python/src/autogen_core/base/_message_handler_context.pysimilarity index 100%rename from python/src/agnext/base/_message_handler_context.pyrename to python/src/autogen_core/base/_message_handler_context.pydiff --git a/python/src/agnext/base/_serialization.py b/python/src/autogen_core/base/_serialization.pysimilarity index 100%rename from python/src/agnext/base/_serialization.pyrename to python/src/autogen_core/base/_serialization.pydiff --git a/python/src/agnext/base/_subscription.py b/python/src/autogen_core/base/_subscription.pysimilarity index 97%rename from python/src/agnext/base/_subscription.pyrename to python/src/autogen_core/base/_subscription.pyindex 9595a9795..cbd5c6eeb 100644--- a/python/src/agnext/base/_subscription.py+++ b/python/src/autogen_core/base/_subscription.py@@ -1,6 +1,6 @@from typing import Protocol, runtime_checkable-from agnext.base import AgentId+from autogen_core.base import AgentIdfrom ._topic import TopicIddiff --git a/python/src/agnext/base/_subscription_context.py b/python/src/autogen_core/base/_subscription_context.pysimilarity index 96%rename from python/src/agnext/base/_subscription_context.pyrename to python/src/autogen_core/base/_subscription_context.pyindex 0b560c685..1e7e563a5 100644--- a/python/src/agnext/base/_subscription_context.py+++ b/python/src/autogen_core/base/_subscription_context.py@@ -2,7 +2,7 @@ from contextlib import contextmanagerfrom contextvars import ContextVarfrom typing import Any, ClassVar, Generator-from agnext.base._agent_type import AgentType+from autogen_core.base._agent_type import AgentTypeclass SubscriptionInstantiationContext:diff --git a/python/src/agnext/base/_topic.py b/python/src/autogen_core/base/_topic.pysimilarity index 100%rename from python/src/agnext/base/_topic.pyrename to python/src/autogen_core/base/_topic.pydiff --git a/python/src/agnext/base/exceptions.py b/python/src/autogen_core/base/exceptions.pysimilarity index 100%rename from python/src/agnext/base/exceptions.pyrename to python/src/autogen_core/base/exceptions.pydiff --git a/python/src/agnext/base/intervention.py b/python/src/autogen_core/base/intervention.pysimilarity index 96%rename from python/src/agnext/base/intervention.pyrename to python/src/autogen_core/base/intervention.pyindex 5e1677c9d..c9600ac9e 100644--- a/python/src/agnext/base/intervention.py+++ b/python/src/autogen_core/base/intervention.py@@ -1,6 +1,6 @@from typing import Any, Awaitable, Callable, Protocol, final-from agnext.base import AgentId+from autogen_core.base import AgentId__all__ = ["DropMessage",diff --git a/python/src/agnext/components/__init__.py b/python/src/autogen_core/components/__init__.pysimilarity index 85%rename from python/src/agnext/components/__init__.pyrename to python/src/autogen_core/components/__init__.pyindex 4d61b3180..db5214483 100644--- a/python/src/agnext/components/__init__.py+++ b/python/src/autogen_core/components/__init__.py@@ -1,5 +1,5 @@"""-The :mod:`agnext.components` module provides building blocks for creating single agents+The :mod:`autogen_core.components` module provides building blocks for creating single agents"""from ._closure_agent import ClosureAgentdiff --git a/python/src/agnext/components/_closure_agent.py b/python/src/autogen_core/components/_closure_agent.pysimilarity index 98%rename from python/src/agnext/components/_closure_agent.pyrename to python/src/autogen_core/components/_closure_agent.pyindex 73400b5e1..ab8622fcd 100644--- a/python/src/agnext/components/_closure_agent.py+++ b/python/src/autogen_core/components/_closure_agent.py@@ -1,7 +1,7 @@import inspectfrom typing import Any, Awaitable, Callable, Mapping, Sequence, TypeVar, get_type_hints-from agnext.base import MessageContext+from autogen_core.base import MessageContextfrom ..base._agent import Agentfrom ..base._agent_id import AgentIddiff --git a/python/src/agnext/components/_default_subscription.py b/python/src/autogen_core/components/_default_subscription.pysimilarity index 95%rename from python/src/agnext/components/_default_subscription.pyrename to python/src/autogen_core/components/_default_subscription.pyindex f85585077..7d3b801d9 100644--- a/python/src/agnext/components/_default_subscription.py+++ b/python/src/autogen_core/components/_default_subscription.py@@ -1,4 +1,4 @@-from agnext.base.exceptions import CantHandleException+from autogen_core.base.exceptions import CantHandleExceptionfrom ..base import SubscriptionInstantiationContextfrom ._type_subscription import TypeSubscriptiondiff --git a/python/src/agnext/components/_default_topic.py b/python/src/autogen_core/components/_default_topic.pysimilarity index 100%rename from python/src/agnext/components/_default_topic.pyrename to python/src/autogen_core/components/_default_topic.pydiff --git a/python/src/agnext/components/_function_utils.py b/python/src/autogen_core/components/_function_utils.pysimilarity index 100%rename from python/src/agnext/components/_function_utils.pyrename to python/src/autogen_core/components/_function_utils.pydiff --git a/python/src/agnext/components/_image.py b/python/src/autogen_core/components/_image.pysimilarity index 100%rename from python/src/agnext/components/_image.pyrename to python/src/autogen_core/components/_image.pydiff --git a/python/src/agnext/components/_pydantic_compat.py b/python/src/autogen_core/components/_pydantic_compat.pysimilarity index 100%rename from python/src/agnext/components/_pydantic_compat.pyrename to python/src/autogen_core/components/_pydantic_compat.pydiff --git a/python/src/agnext/components/_routed_agent.py b/python/src/autogen_core/components/_routed_agent.pysimilarity index 99%rename from python/src/agnext/components/_routed_agent.pyrename to python/src/autogen_core/components/_routed_agent.pyindex c45aa408a..fb16b11c1 100644--- a/python/src/agnext/components/_routed_agent.py+++ b/python/src/autogen_core/components/_routed_agent.py@@ -21,7 +21,7 @@ from ..base import MESSAGE_TYPE_REGISTRY, BaseAgent, MessageContextfrom ..base.exceptions import CantHandleExceptionfrom ._type_helpers import AnyType, get_types-logger = logging.getLogger("agnext")+logger = logging.getLogger("autogen_core")ReceivesT = TypeVar("ReceivesT", contravariant=True)ProducesT = TypeVar("ProducesT", covariant=True)diff --git a/python/src/agnext/components/_type_helpers.py b/python/src/autogen_core/components/_type_helpers.pysimilarity index 100%rename from python/src/agnext/components/_type_helpers.pyrename to python/src/autogen_core/components/_type_helpers.pydiff --git a/python/src/agnext/components/_type_subscription.py b/python/src/autogen_core/components/_type_subscription.pysimilarity index 96%rename from python/src/agnext/components/_type_subscription.pyrename to python/src/autogen_core/components/_type_subscription.pyindex de619f6f2..277788222 100644--- a/python/src/agnext/components/_type_subscription.py+++ b/python/src/autogen_core/components/_type_subscription.py@@ -1,6 +1,6 @@import uuid-from agnext.base.exceptions import CantHandleException+from autogen_core.base.exceptions import CantHandleExceptionfrom ..base import AgentId, Subscription, TopicIddiff --git a/python/src/agnext/components/_types.py b/python/src/autogen_core/components/_types.pysimilarity index 100%rename from python/src/agnext/components/_types.pyrename to python/src/autogen_core/components/_types.pydiff --git a/python/src/agnext/components/code_executor/__init__.py b/python/src/autogen_core/components/code_executor/__init__.pysimilarity index 100%rename from python/src/agnext/components/code_executor/__init__.pyrename to python/src/autogen_core/components/code_executor/__init__.pydiff --git a/python/src/agnext/components/code_executor/_base.py b/python/src/autogen_core/components/code_executor/_base.pysimilarity index 96%rename from python/src/agnext/components/code_executor/_base.pyrename to python/src/autogen_core/components/code_executor/_base.pyindex 851b94fde..af9307706 100644--- a/python/src/agnext/components/code_executor/_base.py+++ b/python/src/autogen_core/components/code_executor/_base.py@@ -6,7 +6,7 @@ from __future__ import annotationsfrom dataclasses import dataclassfrom typing import List, Protocol, runtime_checkable-from agnext.base import CancellationToken+from autogen_core.base import CancellationToken@dataclassdiff --git a/python/src/agnext/components/code_executor/_func_with_reqs.py b/python/src/autogen_core/components/code_executor/_func_with_reqs.pysimilarity index 100%rename from python/src/agnext/components/code_executor/_func_with_reqs.pyrename to python/src/autogen_core/components/code_executor/_func_with_reqs.pydiff --git a/python/src/agnext/components/code_executor/_impl/__init__.py b/python/src/autogen_core/components/code_executor/_impl/__init__.pysimilarity index 100%rename from python/src/agnext/components/code_executor/_impl/__init__.pyrename to python/src/autogen_core/components/code_executor/_impl/__init__.pydiff --git a/python/src/agnext/components/code_executor/_impl/azure_container_code_executor.py b/python/src/autogen_core/components/code_executor/_impl/azure_container_code_executor.pysimilarity index 100%rename from python/src/agnext/components/code_executor/_impl/azure_container_code_executor.pyrename to python/src/autogen_core/components/code_executor/_impl/azure_container_code_executor.pydiff --git a/python/src/agnext/components/code_executor/_impl/command_line_code_result.py b/python/src/autogen_core/components/code_executor/_impl/command_line_code_result.pysimilarity index 100%rename from python/src/agnext/components/code_executor/_impl/command_line_code_result.pyrename to python/src/autogen_core/components/code_executor/_impl/command_line_code_result.pydiff --git a/python/src/agnext/components/code_executor/_impl/local_commandline_code_executor.py b/python/src/autogen_core/components/code_executor/_impl/local_commandline_code_executor.pysimilarity index 100%rename from python/src/agnext/components/code_executor/_impl/local_commandline_code_executor.pyrename to python/src/autogen_core/components/code_executor/_impl/local_commandline_code_executor.pydiff --git a/python/src/agnext/components/code_executor/_impl/utils.py b/python/src/autogen_core/components/code_executor/_impl/utils.pysimilarity index 100%rename from python/src/agnext/components/code_executor/_impl/utils.pyrename to python/src/autogen_core/components/code_executor/_impl/utils.pydiff --git a/python/src/agnext/components/code_executor/_utils.py b/python/src/autogen_core/components/code_executor/_utils.pysimilarity index 100%rename from python/src/agnext/components/code_executor/_utils.pyrename to python/src/autogen_core/components/code_executor/_utils.pydiff --git a/python/src/agnext/components/memory/__init__.py b/python/src/autogen_core/components/memory/__init__.pysimilarity index 100%rename from python/src/agnext/components/memory/__init__.pyrename to python/src/autogen_core/components/memory/__init__.pydiff --git a/python/src/agnext/components/memory/_base.py b/python/src/autogen_core/components/memory/_base.pysimilarity index 100%rename from python/src/agnext/components/memory/_base.pyrename to python/src/autogen_core/components/memory/_base.pydiff --git a/python/src/agnext/components/models/__init__.py b/python/src/autogen_core/components/models/__init__.pysimilarity index 100%rename from python/src/agnext/components/models/__init__.pyrename to python/src/autogen_core/components/models/__init__.pydiff --git a/python/src/agnext/components/models/_model_client.py b/python/src/autogen_core/components/models/_model_client.pysimilarity index 100%rename from python/src/agnext/components/models/_model_client.pyrename to python/src/autogen_core/components/models/_model_client.pydiff --git a/python/src/agnext/components/models/_model_info.py b/python/src/autogen_core/components/models/_model_info.pysimilarity index 100%rename from python/src/agnext/components/models/_model_info.pyrename to python/src/autogen_core/components/models/_model_info.pydiff --git a/python/src/agnext/components/models/_openai_client.py b/python/src/autogen_core/components/models/_openai_client.pysimilarity index 100%rename from python/src/agnext/components/models/_openai_client.pyrename to python/src/autogen_core/components/models/_openai_client.pydiff --git a/python/src/agnext/components/models/_types.py b/python/src/autogen_core/components/models/_types.pysimilarity index 100%rename from python/src/agnext/components/models/_types.pyrename to python/src/autogen_core/components/models/_types.pydiff --git a/python/src/agnext/components/models/config/__init__.py b/python/src/autogen_core/components/models/config/__init__.pysimilarity index 100%rename from python/src/agnext/components/models/config/__init__.pyrename to python/src/autogen_core/components/models/config/__init__.pydiff --git a/python/src/agnext/components/tool_agent/__init__.py b/python/src/autogen_core/components/tool_agent/__init__.pysimilarity index 100%rename from python/src/agnext/components/tool_agent/__init__.pyrename to python/src/autogen_core/components/tool_agent/__init__.pydiff --git a/python/src/agnext/components/tool_agent/_caller_loop.py b/python/src/autogen_core/components/tool_agent/_caller_loop.pysimilarity index 100%rename from python/src/agnext/components/tool_agent/_caller_loop.pyrename to python/src/autogen_core/components/tool_agent/_caller_loop.pydiff --git a/python/src/agnext/components/tool_agent/_tool_agent.py b/python/src/autogen_core/components/tool_agent/_tool_agent.pysimilarity index 100%rename from python/src/agnext/components/tool_agent/_tool_agent.pyrename to python/src/autogen_core/components/tool_agent/_tool_agent.pydiff --git a/python/src/agnext/components/tools/__init__.py b/python/src/autogen_core/components/tools/__init__.pysimilarity index 100%rename from python/src/agnext/components/tools/__init__.pyrename to python/src/autogen_core/components/tools/__init__.pydiff --git a/python/src/agnext/components/tools/_base.py b/python/src/autogen_core/components/tools/_base.pysimilarity index 100%rename from python/src/agnext/components/tools/_base.pyrename to python/src/autogen_core/components/tools/_base.pydiff --git a/python/src/agnext/components/tools/_code_execution.py b/python/src/autogen_core/components/tools/_code_execution.pysimilarity index 100%rename from python/src/agnext/components/tools/_code_execution.pyrename to python/src/autogen_core/components/tools/_code_execution.pydiff --git a/python/src/agnext/components/tools/_function_tool.py b/python/src/autogen_core/components/tools/_function_tool.pysimilarity index 100%rename from python/src/agnext/components/tools/_function_tool.pyrename to python/src/autogen_core/components/tools/_function_tool.pydiff --git a/python/src/agnext/py.typed b/python/src/autogen_core/py.typedsimilarity index 100%rename from python/src/agnext/py.typedrename to python/src/autogen_core/py.typeddiff --git a/python/teams/team-one/examples/example.py b/python/teams/team-one/examples/example.pyindex cf524a0a7..f9e6e65e2 100644--- a/python/teams/team-one/examples/example.py+++ b/python/teams/team-one/examples/example.py@@ -1,10 +1,10 @@import asyncioimport logging-from agnext.application import SingleThreadedAgentRuntime-from agnext.application.logging import EVENT_LOGGER_NAME-from agnext.base import AgentId, AgentProxy-from agnext.components import DefaultSubscription+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.application.logging import EVENT_LOGGER_NAME+from autogen_core.base import AgentId, AgentProxy+from autogen_core.components import DefaultSubscriptionfrom team_one.agents.coder import Coder, Executorfrom team_one.agents.orchestrator import LedgerOrchestratorfrom team_one.agents.user_proxy import UserProxydiff --git a/python/teams/team-one/examples/example_coder.py b/python/teams/team-one/examples/example_coder.pyindex 5964d5686..b80c71e81 100644--- a/python/teams/team-one/examples/example_coder.py+++ b/python/teams/team-one/examples/example_coder.py@@ -1,10 +1,10 @@import asyncioimport logging-from agnext.application import SingleThreadedAgentRuntime-from agnext.application.logging import EVENT_LOGGER_NAME-from agnext.base import AgentId, AgentProxy-from agnext.components import DefaultSubscription+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.application.logging import EVENT_LOGGER_NAME+from autogen_core.base import AgentId, AgentProxy+from autogen_core.components import DefaultSubscriptionfrom team_one.agents.coder import Coder, Executorfrom team_one.agents.orchestrator import RoundRobinOrchestratorfrom team_one.agents.user_proxy import UserProxydiff --git a/python/teams/team-one/examples/example_file_surfer.py b/python/teams/team-one/examples/example_file_surfer.pyindex 9a1db1533..c49ed30fb 100644--- a/python/teams/team-one/examples/example_file_surfer.py+++ b/python/teams/team-one/examples/example_file_surfer.py@@ -1,10 +1,10 @@import asyncioimport logging-from agnext.application import SingleThreadedAgentRuntime-from agnext.application.logging import EVENT_LOGGER_NAME-from agnext.base import AgentId, AgentProxy-from agnext.components import DefaultSubscription+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.application.logging import EVENT_LOGGER_NAME+from autogen_core.base import AgentId, AgentProxy+from autogen_core.components import DefaultSubscriptionfrom team_one.agents.file_surfer import FileSurferfrom team_one.agents.orchestrator import RoundRobinOrchestratorfrom team_one.agents.user_proxy import UserProxydiff --git a/python/teams/team-one/examples/example_reflexagents.py b/python/teams/team-one/examples/example_reflexagents.pyindex dc6df5ca2..3346a0926 100644--- a/python/teams/team-one/examples/example_reflexagents.py+++ b/python/teams/team-one/examples/example_reflexagents.py@@ -1,11 +1,11 @@import asyncioimport logging-from agnext.application import SingleThreadedAgentRuntime-from agnext.application.logging import EVENT_LOGGER_NAME-from agnext.base import AgentId, AgentProxy-from agnext.components import DefaultSubscription, DefaultTopicId-from agnext.components.models import UserMessage+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.application.logging import EVENT_LOGGER_NAME+from autogen_core.base import AgentId, AgentProxy+from autogen_core.components import DefaultSubscription, DefaultTopicId+from autogen_core.components.models import UserMessagefrom team_one.agents.orchestrator import RoundRobinOrchestratorfrom team_one.agents.reflex_agents import ReflexAgentfrom team_one.messages import BroadcastMessagediff --git a/python/teams/team-one/examples/example_userproxy.py b/python/teams/team-one/examples/example_userproxy.pyindex 4ca54f5ec..652f79c8e 100644--- a/python/teams/team-one/examples/example_userproxy.py+++ b/python/teams/team-one/examples/example_userproxy.py@@ -1,12 +1,12 @@import asyncioimport logging-from agnext.application import SingleThreadedAgentRuntime-from agnext.application.logging import EVENT_LOGGER_NAME-from agnext.base import AgentId, AgentProxy+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.application.logging import EVENT_LOGGER_NAME+from autogen_core.base import AgentId, AgentProxy# from typing import Any, Dict, List, Tuple, Union-from agnext.components import DefaultSubscription+from autogen_core.components import DefaultSubscriptionfrom team_one.agents.coder import Coderfrom team_one.agents.orchestrator import RoundRobinOrchestratorfrom team_one.agents.user_proxy import UserProxydiff --git a/python/teams/team-one/examples/example_websurfer.py b/python/teams/team-one/examples/example_websurfer.pyindex 38920057a..7a42b7195 100644--- a/python/teams/team-one/examples/example_websurfer.py+++ b/python/teams/team-one/examples/example_websurfer.py@@ -2,10 +2,10 @@ import asyncioimport loggingimport os-from agnext.application import SingleThreadedAgentRuntime-from agnext.application.logging import EVENT_LOGGER_NAME-from agnext.base import AgentId, AgentProxy-from agnext.components import DefaultSubscription+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.application.logging import EVENT_LOGGER_NAME+from autogen_core.base import AgentId, AgentProxy+from autogen_core.components import DefaultSubscriptionfrom team_one.agents.multimodal_web_surfer import MultimodalWebSurferfrom team_one.agents.orchestrator import RoundRobinOrchestratorfrom team_one.agents.user_proxy import UserProxydiff --git a/python/teams/team-one/pyproject.toml b/python/teams/team-one/pyproject.tomlindex 50a6f30ce..d0a073305 100644--- a/python/teams/team-one/pyproject.toml+++ b/python/teams/team-one/pyproject.toml@@ -16,7 +16,7 @@ classifiers = ["Operating System :: OS Independent",]dependencies = [- "agnext@{root:parent:parent:uri}",+ "autogen-core@{root:parent:parent:uri}","aiofiles","requests","mammoth",diff --git a/python/teams/team-one/readme.md b/python/teams/team-one/readme.mdindex 679d16826..c84c217ca 100644--- a/python/teams/team-one/readme.md+++ b/python/teams/team-one/readme.md@@ -153,7 +153,7 @@ Once on Waoonet's profile, the agents focused on counting the comments that had| Total | 28% (120/422) |-### Logging in Team One Agents+### Logging in Team One AgentsTeam One agents can emit several log events that can be consumed by a log handler (see the example log handler in [utils.py](src/team_one/utils.py)). A list of currently emitted events are:@@ -171,7 +171,7 @@ You can install the Team-One package using pip and then run the example code to1. Clone the code.```bash-# clone agnext+# clone autogen_corecd python/teams/team-onepip install -e .```diff --git a/python/teams/team-one/src/team_one/agents/base_agent.py b/python/teams/team-one/src/team_one/agents/base_agent.pyindex 2f0c6ce0f..b8df8e0e8 100644--- a/python/teams/team-one/src/team_one/agents/base_agent.py+++ b/python/teams/team-one/src/team_one/agents/base_agent.py@@ -2,9 +2,9 @@ import asyncioimport loggingfrom typing import Any-from agnext.application.logging import EVENT_LOGGER_NAME-from agnext.base import MessageContext-from agnext.components import RoutedAgent, message_handler+from autogen_core.application.logging import EVENT_LOGGER_NAME+from autogen_core.base import MessageContext+from autogen_core.components import RoutedAgent, message_handlerfrom team_one.messages import (AgentEvent,diff --git a/python/teams/team-one/src/team_one/agents/base_orchestrator.py b/python/teams/team-one/src/team_one/agents/base_orchestrator.pyindex 9c7250ca0..a146613cc 100644--- a/python/teams/team-one/src/team_one/agents/base_orchestrator.py+++ b/python/teams/team-one/src/team_one/agents/base_orchestrator.py@@ -2,9 +2,9 @@ import loggingimport timefrom typing import List, Optional-from agnext.application.logging import EVENT_LOGGER_NAME-from agnext.base import AgentProxy, CancellationToken, MessageContext-from agnext.components.models import AssistantMessage, LLMMessage, UserMessage+from autogen_core.application.logging import EVENT_LOGGER_NAME+from autogen_core.base import AgentProxy, CancellationToken, MessageContext+from autogen_core.components.models import AssistantMessage, LLMMessage, UserMessagefrom ..messages import BroadcastMessage, OrchestrationEvent, RequestReplyMessage, ResetMessagefrom ..utils import message_content_to_strdiff --git a/python/teams/team-one/src/team_one/agents/base_worker.py b/python/teams/team-one/src/team_one/agents/base_worker.pyindex a7ba690bb..6da6de975 100644--- a/python/teams/team-one/src/team_one/agents/base_worker.py+++ b/python/teams/team-one/src/team_one/agents/base_worker.py@@ -1,7 +1,7 @@from typing import List, Tuple-from agnext.base import CancellationToken, MessageContext, TopicId-from agnext.components.models import (+from autogen_core.base import CancellationToken, MessageContext, TopicId+from autogen_core.components.models import (AssistantMessage,LLMMessage,UserMessage,diff --git a/python/teams/team-one/src/team_one/agents/coder.py b/python/teams/team-one/src/team_one/agents/coder.pyindex f8fe7878e..13149a131 100644--- a/python/teams/team-one/src/team_one/agents/coder.py+++ b/python/teams/team-one/src/team_one/agents/coder.py@@ -1,9 +1,9 @@import refrom typing import List, Optional, Tuple, Union-from agnext.base import CancellationToken-from agnext.components.code_executor import CodeBlock, CodeExecutor, LocalCommandLineCodeExecutor-from agnext.components.models import (+from autogen_core.base import CancellationToken+from autogen_core.components.code_executor import CodeBlock, CodeExecutor, LocalCommandLineCodeExecutor+from autogen_core.components.models import (ChatCompletionClient,SystemMessage,UserMessage,diff --git a/python/teams/team-one/src/team_one/agents/file_surfer/_tools.py b/python/teams/team-one/src/team_one/agents/file_surfer/_tools.pyindex f62d08eb0..740ea1c73 100644--- a/python/teams/team-one/src/team_one/agents/file_surfer/_tools.py+++ b/python/teams/team-one/src/team_one/agents/file_surfer/_tools.py@@ -1,4 +1,4 @@-from agnext.components.tools import ParametersSchema, ToolSchema+from autogen_core.components.tools import ParametersSchema, ToolSchemaTOOL_OPEN_LOCAL_FILE = ToolSchema(name="open_local_file",diff --git a/python/teams/team-one/src/team_one/agents/file_surfer/file_surfer.py b/python/teams/team-one/src/team_one/agents/file_surfer/file_surfer.pyindex 7e7031821..483c5b4fe 100644--- a/python/teams/team-one/src/team_one/agents/file_surfer/file_surfer.py+++ b/python/teams/team-one/src/team_one/agents/file_surfer/file_surfer.py@@ -2,9 +2,9 @@ import jsonimport timefrom typing import List, Optional, Tuple-from agnext.base import CancellationToken-from agnext.components import FunctionCall-from agnext.components.models import (+from autogen_core.base import CancellationToken+from autogen_core.components import FunctionCall+from autogen_core.components.models import (ChatCompletionClient,SystemMessage,UserMessage,diff --git a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/multimodal_web_surfer.py b/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/multimodal_web_surfer.pyindex 024749a21..a92731d72 100644--- a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/multimodal_web_surfer.py+++ b/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/multimodal_web_surfer.py@@ -11,11 +11,11 @@ from typing import Any, BinaryIO, Dict, List, Tuple, Union, cast # Any, Callablfrom urllib.parse import quote_plus # parse_qs, quote, unquote, urlparse, urlunparseimport aiofiles-from agnext.application.logging import EVENT_LOGGER_NAME-from agnext.base import CancellationToken-from agnext.components import FunctionCall-from agnext.components import Image as AGImage-from agnext.components.models import (+from autogen_core.application.logging import EVENT_LOGGER_NAME+from autogen_core.base import CancellationToken+from autogen_core.components import FunctionCall+from autogen_core.components import Image as AGImage+from autogen_core.components.models import (AssistantMessage,ChatCompletionClient,LLMMessage,diff --git a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/tool_definitions.py b/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/tool_definitions.pyindex e23161665..b662f4101 100644--- a/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/tool_definitions.py+++ b/python/teams/team-one/src/team_one/agents/multimodal_web_surfer/tool_definitions.py@@ -1,7 +1,7 @@from typing import Any, Dict-# TODO Why does pylance fail if I import from agnext.components.tools instead?-from agnext.components.tools._base import ParametersSchema, ToolSchema+# TODO Why does pylance fail if I import from autogen_core.components.tools instead?+from autogen_core.components.tools._base import ParametersSchema, ToolSchemadef _load_tool(tooldef: Dict[str, Any]) -> ToolSchema:diff --git a/python/teams/team-one/src/team_one/agents/orchestrator.py b/python/teams/team-one/src/team_one/agents/orchestrator.pyindex 78ae57e9f..72a8f4dca 100644--- a/python/teams/team-one/src/team_one/agents/orchestrator.py+++ b/python/teams/team-one/src/team_one/agents/orchestrator.py@@ -1,8 +1,14 @@import jsonfrom typing import Any, Dict, List, Optional-from agnext.base import AgentProxy, MessageContext, TopicId-from agnext.components.models import AssistantMessage, ChatCompletionClient, LLMMessage, SystemMessage, UserMessage+from autogen_core.base import AgentProxy, MessageContext, TopicId+from autogen_core.components.models import (+ AssistantMessage,+ ChatCompletionClient,+ LLMMessage,+ SystemMessage,+ UserMessage,+)from ..messages import BroadcastMessage, OrchestrationEvent, ResetMessagefrom .base_orchestrator import BaseOrchestrator, loggerdiff --git a/python/teams/team-one/src/team_one/agents/reflex_agents.py b/python/teams/team-one/src/team_one/agents/reflex_agents.pyindex 3fa642e2a..a5eee1c1e 100644--- a/python/teams/team-one/src/team_one/agents/reflex_agents.py+++ b/python/teams/team-one/src/team_one/agents/reflex_agents.py@@ -1,6 +1,6 @@-from agnext.base import MessageContext, TopicId-from agnext.components import RoutedAgent, message_handler-from agnext.components.models import UserMessage+from autogen_core.base import MessageContext, TopicId+from autogen_core.components import RoutedAgent, message_handler+from autogen_core.components.models import UserMessagefrom ..messages import BroadcastMessage, RequestReplyMessagediff --git a/python/teams/team-one/src/team_one/agents/user_proxy.py b/python/teams/team-one/src/team_one/agents/user_proxy.pyindex f5585f5d2..e48cdb83f 100755--- a/python/teams/team-one/src/team_one/agents/user_proxy.py+++ b/python/teams/team-one/src/team_one/agents/user_proxy.py@@ -1,7 +1,7 @@import asynciofrom typing import Tuple-from agnext.base import CancellationToken+from autogen_core.base import CancellationTokenfrom ..messages import UserContentfrom .base_worker import BaseWorkerdiff --git a/python/teams/team-one/src/team_one/messages.py b/python/teams/team-one/src/team_one/messages.pyindex 5452b881c..4eee7bf34 100644--- a/python/teams/team-one/src/team_one/messages.py+++ b/python/teams/team-one/src/team_one/messages.py@@ -1,8 +1,8 @@from dataclasses import dataclassfrom typing import Any, Dict, List, Union-from agnext.components import FunctionCall, Image-from agnext.components.models import FunctionExecutionResult, LLMMessage+from autogen_core.components import FunctionCall, Image+from autogen_core.components.models import FunctionExecutionResult, LLMMessage# Convenience typeUserContent = Union[str, List[Union[str, Image]]]diff --git a/python/teams/team-one/src/team_one/utils.py b/python/teams/team-one/src/team_one/utils.pyindex bf4c4df7b..e0ef6a6d7 100644--- a/python/teams/team-one/src/team_one/utils.py+++ b/python/teams/team-one/src/team_one/utils.py@@ -5,9 +5,9 @@ from dataclasses import asdictfrom datetime import datetimefrom typing import Any, Dict, List, Literal-from agnext.application.logging.events import LLMCallEvent-from agnext.components import Image-from agnext.components.models import (+from autogen_core.application.logging.events import LLMCallEvent+from autogen_core.components import Image+from autogen_core.components.models import (AzureOpenAIChatCompletionClient,ChatCompletionClient,ModelCapabilities,diff --git a/python/teams/team-one/tests/headless_web_surfer/test_web_surfer.py b/python/teams/team-one/tests/headless_web_surfer/test_web_surfer.pyindex 083a49e86..1235268fa 100644--- a/python/teams/team-one/tests/headless_web_surfer/test_web_surfer.py+++ b/python/teams/team-one/tests/headless_web_surfer/test_web_surfer.py@@ -8,8 +8,8 @@ from math import ceilimport asyncioimport pytest-from agnext.base import AgentId-from agnext.base import AgentProxy+from autogen_core.base import AgentId+from autogen_core.base import AgentProxypytest_plugins = ('pytest_asyncio',)from json import dumps@@ -21,12 +21,12 @@ from team_one.utils import (from team_one.agents.user_proxy import UserProxyfrom team_one.agents.orchestrator import RoundRobinOrchestratorfrom team_one.messages import BroadcastMessage-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import FunctionCall-from agnext.components.models import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import FunctionCall+from autogen_core.components.models import (UserMessage,)-from agnext.components.tools._base import ToolSchema+from autogen_core.components.tools._base import ToolSchemafrom openai import AuthenticationErrordiff --git a/python/tests/execution/test_azure_container_code_executor.py b/python/tests/execution/test_azure_container_code_executor.pyindex a9e6d0c9c..dd65ef677 100644--- a/python/tests/execution/test_azure_container_code_executor.py+++ b/python/tests/execution/test_azure_container_code_executor.py@@ -9,8 +9,8 @@ from anyio import open_fileimport pytestfrom azure.identity import DefaultAzureCredential-from agnext.components.code_executor import CodeBlock, AzureContainerCodeExecutor-from agnext.base import CancellationToken+from autogen_core.components.code_executor import CodeBlock, AzureContainerCodeExecutor+from autogen_core.base import CancellationTokenUNIX_SHELLS = ["bash", "sh", "shell"]WINDOWS_SHELLS = ["ps1", "pwsh", "powershell"]diff --git a/python/tests/execution/test_commandline_code_executor.py b/python/tests/execution/test_commandline_code_executor.pyindex 12e49d705..c74803d5e 100644--- a/python/tests/execution/test_commandline_code_executor.py+++ b/python/tests/execution/test_commandline_code_executor.py@@ -7,8 +7,8 @@ import tempfilefrom pathlib import Pathimport pytest-from agnext.components.code_executor import CodeBlock, LocalCommandLineCodeExecutor-from agnext.base import CancellationToken+from autogen_core.components.code_executor import CodeBlock, LocalCommandLineCodeExecutor+from autogen_core.base import CancellationTokenUNIX_SHELLS = ["bash", "sh", "shell"]WINDOWS_SHELLS = ["ps1", "pwsh", "powershell"]diff --git a/python/tests/execution/test_extract_code_blocks.py b/python/tests/execution/test_extract_code_blocks.pyindex 2fe140611..99e439f32 100644--- a/python/tests/execution/test_extract_code_blocks.py+++ b/python/tests/execution/test_extract_code_blocks.py@@ -1,4 +1,4 @@-from agnext.components.code_executor import extract_markdown_code_blocks+from autogen_core.components.code_executor import extract_markdown_code_blocksdef test_extract_markdown_code_blocks() -> None:diff --git a/python/tests/execution/test_user_defined_functions.py b/python/tests/execution/test_user_defined_functions.pyindex 648497707..c8f46d58d 100644--- a/python/tests/execution/test_user_defined_functions.py+++ b/python/tests/execution/test_user_defined_functions.py@@ -8,14 +8,14 @@ import tempfileimport polarsimport pytestfrom azure.identity import DefaultAzureCredential-from agnext.components.code_executor import (+from autogen_core.components.code_executor import (CodeBlock,FunctionWithRequirements,LocalCommandLineCodeExecutor,AzureContainerCodeExecutor,with_requirements,)-from agnext.base import CancellationToken+from autogen_core.base import CancellationTokenENVIRON_KEY_AZURE_POOL_ENDPOINT = "AZURE_POOL_ENDPOINT"diff --git a/python/tests/test_base_agent.py b/python/tests/test_base_agent.pyindex cbbf1d43a..cd3fdcd8b 100644--- a/python/tests/test_base_agent.py+++ b/python/tests/test_base_agent.py@@ -1,6 +1,6 @@import pytestfrom pytest_mock import MockerFixture-from agnext.base import AgentRuntime, AgentInstantiationContext, AgentId+from autogen_core.base import AgentRuntime, AgentInstantiationContext, AgentIdfrom test_utils import NoopAgentdiff --git a/python/tests/test_cancellation.py b/python/tests/test_cancellation.pyindex eb8d47fcb..470655582 100644--- a/python/tests/test_cancellation.py+++ b/python/tests/test_cancellation.py@@ -2,11 +2,11 @@ import asynciofrom dataclasses import dataclassimport pytest-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import RoutedAgent, message_handler-from agnext.base import AgentId, CancellationToken-from agnext.base import MessageContext-from agnext.base import AgentInstantiationContext+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import RoutedAgent, message_handler+from autogen_core.base import AgentId, CancellationToken+from autogen_core.base import MessageContext+from autogen_core.base import AgentInstantiationContext@dataclassdiff --git a/python/tests/test_closure_agent.py b/python/tests/test_closure_agent.pyindex a3514a527..32a358cf5 100644--- a/python/tests/test_closure_agent.py+++ b/python/tests/test_closure_agent.py@@ -3,18 +3,18 @@from dataclasses import dataclassimport pytest-from agnext.application import SingleThreadedAgentRuntime+from autogen_core.application import SingleThreadedAgentRuntime-from agnext.components._type_subscription import TypeSubscription-from agnext.base import AgentRuntime, AgentId+from autogen_core.components._type_subscription import TypeSubscription+from autogen_core.base import AgentRuntime, AgentId-from agnext.components import ClosureAgent+from autogen_core.components import ClosureAgentimport asyncio-from agnext.base import MessageContext-from agnext.base import TopicId+from autogen_core.base import MessageContext+from autogen_core.base import TopicId@dataclassclass Message:diff --git a/python/tests/test_intervention.py b/python/tests/test_intervention.pyindex c7ddca613..fbec2a043 100644--- a/python/tests/test_intervention.py+++ b/python/tests/test_intervention.py@@ -1,8 +1,8 @@import pytest-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import AgentId-from agnext.base.exceptions import MessageDroppedException-from agnext.base.intervention import DefaultInterventionHandler, DropMessage+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import AgentId+from autogen_core.base.exceptions import MessageDroppedException+from autogen_core.base.intervention import DefaultInterventionHandler, DropMessagefrom test_utils import LoopbackAgent, MessageTypediff --git a/python/tests/test_llm_usage.py b/python/tests/test_llm_usage.pyindex bee329a4f..83b465b97 100644--- a/python/tests/test_llm_usage.py+++ b/python/tests/test_llm_usage.py@@ -1,7 +1,7 @@import logging-from agnext.application.logging import EVENT_LOGGER_NAME, LLMUsageTracker-from agnext.application.logging.events import LLMCallEvent+from autogen_core.application.logging import EVENT_LOGGER_NAME, LLMUsageTracker+from autogen_core.application.logging.events import LLMCallEventdef test_llm_usage() -> None:diff --git a/python/tests/test_model_client.py b/python/tests/test_model_client.pyindex 5eafd9722..e4d793e5b 100644--- a/python/tests/test_model_client.py+++ b/python/tests/test_model_client.py@@ -2,8 +2,8 @@ import asynciofrom typing import Any, AsyncGenerator, Listimport pytest-from agnext.components import Image-from agnext.components.models import (+from autogen_core.components import Image+from autogen_core.components.models import (AssistantMessage,AzureOpenAIChatCompletionClient,CreateResult,@@ -14,9 +14,9 @@ from agnext.components.models import (SystemMessage,UserMessage,)-from agnext.components.models._model_info import resolve_model-from agnext.components.tools import FunctionTool-from agnext.base import CancellationToken+from autogen_core.components.models._model_info import resolve_model+from autogen_core.components.tools import FunctionTool+from autogen_core.base import CancellationTokenfrom openai.resources.chat.completions import AsyncCompletionsfrom openai.types.chat.chat_completion import ChatCompletion, Choicefrom openai.types.chat.chat_completion_chunk import ChatCompletionChunk, ChoiceDeltadiff --git a/python/tests/test_routed_agent.py b/python/tests/test_routed_agent.pyindex 51af708dc..f70cb3841 100644--- a/python/tests/test_routed_agent.py+++ b/python/tests/test_routed_agent.py@@ -2,9 +2,9 @@ from dataclasses import dataclassimport pytestimport logging-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import TypeSubscription-from agnext.base import TopicId+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import TypeSubscription+from autogen_core.base import TopicIdfrom test_utils import LoopbackAgentdiff --git a/python/tests/test_runtime.py b/python/tests/test_runtime.pyindex 0af1e8cc1..f4ae23109 100644--- a/python/tests/test_runtime.py+++ b/python/tests/test_runtime.py@@ -1,11 +1,11 @@import asyncioimport pytest-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import TypeSubscription, DefaultTopicId, DefaultSubscription-from agnext.base import AgentId, AgentInstantiationContext-from agnext.base import TopicId-from agnext.base import Subscription-from agnext.base import SubscriptionInstantiationContext+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import TypeSubscription, DefaultTopicId, DefaultSubscription+from autogen_core.base import AgentId, AgentInstantiationContext+from autogen_core.base import TopicId+from autogen_core.base import Subscription+from autogen_core.base import SubscriptionInstantiationContextfrom test_utils import CascadingAgent, CascadingMessageType, LoopbackAgent, MessageType, NoopAgentdiff --git a/python/tests/test_serialization.py b/python/tests/test_serialization.pyindex 5b292fffa..e63905b68 100644--- a/python/tests/test_serialization.py+++ b/python/tests/test_serialization.py@@ -5,7 +5,7 @@ from dataclasses import dataclassimport pytest-from agnext.base import Serialization+from autogen_core.base import Serializationclass PydanticMessage(BaseModel):message: strdiff --git a/python/tests/test_state.py b/python/tests/test_state.pyindex c16906e24..987fcbc56 100644--- a/python/tests/test_state.py+++ b/python/tests/test_state.py@@ -1,9 +1,9 @@from typing import Any, Mappingimport pytest-from agnext.application import SingleThreadedAgentRuntime-from agnext.base import BaseAgent, MessageContext-from agnext.base import AgentId+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.base import BaseAgent, MessageContext+from autogen_core.base import AgentIdclass StatefulAgent(BaseAgent):diff --git a/python/tests/test_subscription.py b/python/tests/test_subscription.pyindex 5c0eb5248..80a9c86fe 100644--- a/python/tests/test_subscription.py+++ b/python/tests/test_subscription.py@@ -1,9 +1,9 @@-from agnext.components import TypeSubscription-from agnext.base import TopicId, AgentId+from autogen_core.components import TypeSubscription+from autogen_core.base import TopicId, AgentIdimport pytest-from agnext.base.exceptions import CantHandleException+from autogen_core.base.exceptions import CantHandleExceptiondef test_type_subscription_match() -> None:sub = TypeSubscription(topic_type="t1", agent_type="a1")diff --git a/python/tests/test_tool_agent.py b/python/tests/test_tool_agent.pyindex 76dcafe2a..00aa83ab6 100644--- a/python/tests/test_tool_agent.py+++ b/python/tests/test_tool_agent.py@@ -10,25 +10,25 @@ from openai.types.chat.chat_completion_message import ChatCompletionMessagefrom openai.types.chat.chat_completion_message_tool_call import ChatCompletionMessageToolCall, Functionfrom openai.types.completion_usage import CompletionUsage-from agnext.application import SingleThreadedAgentRuntime-from agnext.components import FunctionCall-from agnext.components.tool_agent import (+from autogen_core.application import SingleThreadedAgentRuntime+from autogen_core.components import FunctionCall+from autogen_core.components.tool_agent import (InvalidToolArgumentsException,ToolAgent,ToolExecutionException,ToolNotFoundException,tool_agent_caller_loop,)-from agnext.components.tools import FunctionTool, Tool-from agnext.base import CancellationToken, AgentId-from agnext.components.models import (+from autogen_core.components.tools import FunctionTool, Tool+from autogen_core.base import CancellationToken, AgentId+from autogen_core.components.models import (AssistantMessage,FunctionExecutionResult,FunctionExecutionResultMessage,OpenAIChatCompletionClient,UserMessage,)-from agnext.components.tools import FunctionTool+from autogen_core.components.tools import FunctionTooldef _pass_function(input: str) -> str:diff --git a/python/tests/test_tools.py b/python/tests/test_tools.pyindex 2d8081d3f..a18b18734 100644--- a/python/tests/test_tools.py+++ b/python/tests/test_tools.py@@ -3,10 +3,10 @@ import inspectfrom typing import Annotatedimport pytest-from agnext.components._function_utils import get_typed_signature-from agnext.components.tools import BaseTool, FunctionTool-from agnext.components.models._openai_client import convert_tools-from agnext.base import CancellationToken+from autogen_core.components._function_utils import get_typed_signature+from autogen_core.components.tools import BaseTool, FunctionTool+from autogen_core.components.models._openai_client import convert_tools+from autogen_core.base import CancellationTokenfrom pydantic import BaseModel, Field, model_serializerfrom pydantic_core import PydanticUndefineddiff --git a/python/tests/test_types.py b/python/tests/test_types.pyindex 098f2556d..d331ceaff 100644--- a/python/tests/test_types.py+++ b/python/tests/test_types.py@@ -1,9 +1,9 @@from types import NoneTypefrom typing import Any, Optional, Union-from agnext.components._routed_agent import message_handler-from agnext.components._type_helpers import AnyType, get_types-from agnext.base import MessageContext+from autogen_core.components._routed_agent import message_handler+from autogen_core.components._type_helpers import AnyType, get_types+from autogen_core.base import MessageContextdef test_get_types() -> None:diff --git a/python/tests/test_utils/__init__.py b/python/tests/test_utils/__init__.pyindex 1ebb09eff..f1cad107d 100644--- a/python/tests/test_utils/__init__.py+++ b/python/tests/test_utils/__init__.py@@ -1,10 +1,10 @@from dataclasses import dataclassfrom typing import Any-from agnext.components import RoutedAgent, message_handler-from agnext.components import DefaultTopicId-from agnext.base import BaseAgent-from agnext.base import MessageContext+from autogen_core.components import RoutedAgent, message_handler+from autogen_core.components import DefaultTopicId+from autogen_core.base import BaseAgent+from autogen_core.base import MessageContext@dataclassdiff --git a/python/tools/agbench/src/agbench/res/Dockerfile b/python/tools/agbench/src/agbench/res/Dockerfileindex d0700b511..264507c9d 100644--- a/python/tools/agbench/src/agbench/res/Dockerfile+++ b/python/tools/agbench/src/agbench/res/Dockerfile@@ -11,7 +11,7 @@ RUN ln -snf /usr/share/zoneinfo/US/Pacific /etc/localtime && echo "US/Pacific" ># Upgrade pipRUN pip install --upgrade pip-# Pre-load agnext dependencies, but not agnext itself since we'll often want to install the latest from source+# Pre-load autogen_core dependencies, but not autogen_core itself since we'll often want to install the latest from sourceRUN pip install openai pillow aiohttp typing-extensions pydantic types-aiofiles grpcio protobuf# Pre-load popular packages as per https://learnpython.com/blog/most-popular-python-packages/diff --git a/python/tools/agbench/src/agbench/run_cmd.py b/python/tools/agbench/src/agbench/run_cmd.pyindex 29b81621d..cb753ae72 100644--- a/python/tools/agbench/src/agbench/run_cmd.py+++ b/python/tools/agbench/src/agbench/run_cmd.py@@ -477,7 +477,7 @@ echo RUN.SH COMPLETE !#!## Figure out what folders to mountvolumes = {str(pathlib.Path(work_dir).absolute()): {"bind": "/workspace", "mode": "rw"}}- # Add the agnext repo if we can find it+ # Add the autogen_core repo if we can find itagnext_repo_base = os.environ.get("AGNEXT_REPO_BASE")if agnext_repo_base is None:agnext_repo_base = find_agnext_repo(os.getcwd())@@ -490,7 +490,7 @@ echo RUN.SH COMPLETE !#!#)agnext_repo_base = os.path.join(agnext_repo_base, "python")- volumes[str(pathlib.Path(agnext_repo_base).absolute())] = {"bind": "/agnext", "mode": "rw"}+ volumes[str(pathlib.Path(agnext_repo_base).absolute())] = {"bind": "/autogen_core", "mode": "rw"}print("Mounting:")for k in volumes:@@ -585,9 +585,9 @@ def build_default_docker_image(docker_client: docker.DockerClient, image_tag: stdef find_agnext_repo(path: str) -> Optional[str]:"""- Utility for identifying if the path is a subdirectory of the agnext repo.+ Utility for identifying if the path is a subdirectory of the autogen_core repo.- Returns: the path to the root of the agnext repo if one is found, otherwise None+ Returns: the path to the root of the autogen_core repo if one is found, otherwise None"""# Normalize the path (we expect a directory)@@ -596,7 +596,7 @@ def find_agnext_repo(path: str) -> Optional[str]:path = os.path.dirname(path)while True:- test_path = os.path.join(path, "python", "src", "agnext") # We found agnext+ test_path = os.path.join(path, "python", "src", "autogen_core") # We found autogen_coreif os.path.isdir(test_path):return path