Skip to content

A programming framework for agentic AI

Update Deprecation Warning for `CompressibleAgent` and `TransformChatHistory` (#2685)

Wael Karkoub2bad14573888
diff --git a/.github/workflows/contrib-tests.yml b/.github/workflows/contrib-tests.yml
index 005abe4ef..38fab8774 100644
--- a/.github/workflows/contrib-tests.yml
+++ b/.github/workflows/contrib-tests.yml
@@ -107,7 +107,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y tesseract-ocr poppler-utils
- pip install unstructured[all-docs]==0.13.0
+ pip install --no-cache-dir unstructured[all-docs]==0.13.0
- name: Install packages and dependencies for RetrieveChat
run: |
pip install -e .[retrievechat]
diff --git a/autogen/agentchat/contrib/capabilities/context_handling.py b/autogen/agentchat/contrib/capabilities/context_handling.py
index 173811842..44b10259f 100644
--- a/autogen/agentchat/contrib/capabilities/context_handling.py
+++ b/autogen/agentchat/contrib/capabilities/context_handling.py
@@ -8,8 +8,8 @@ from termcolor import colored
from autogen import ConversableAgent, token_count_utils
warn(
- "Context handling with TransformChatHistory is deprecated. "
- "Please use TransformMessages from autogen/agentchat/contrib/capabilities/transform_messages.py instead.",
+ "Context handling with TransformChatHistory is deprecated and will be removed in `0.2.30`. "
+ "Please use `TransformMessages`, documentation can be found at https://microsoft.github.io/autogen/docs/topics/handling_long_contexts/intro_to_transform_messages",
DeprecationWarning,
stacklevel=2,
)
diff --git a/autogen/agentchat/contrib/compressible_agent.py b/autogen/agentchat/contrib/compressible_agent.py
index 9c4e78af8..cbedb17ce 100644
--- a/autogen/agentchat/contrib/compressible_agent.py
+++ b/autogen/agentchat/contrib/compressible_agent.py
@@ -13,8 +13,8 @@ from ...formatting_utils import colored
logger = logging.getLogger(__name__)
warn(
- "Context handling with CompressibleAgent is deprecated. "
- "Please use `TransformMessages`, documentation can be found at https://microsoft.github.io/autogen/docs/reference/agentchat/contrib/capabilities/transform_messages",
+ "Context handling with CompressibleAgent is deprecated and will be removed in `0.2.30`. "
+ "Please use `TransformMessages`, documentation can be found at https://microsoft.github.io/autogen/docs/topics/handling_long_contexts/intro_to_transform_messages",
DeprecationWarning,
stacklevel=2,
)
diff --git a/notebook/agentchat_capability_long_context_handling.ipynb b/notebook/agentchat_capability_long_context_handling.ipynb
index 0bc1b4ffd..0a9d715e3 100644
--- a/notebook/agentchat_capability_long_context_handling.ipynb
+++ b/notebook/agentchat_capability_long_context_handling.ipynb
@@ -6,8 +6,8 @@
"source": [
"# Handling A Long Context via `TransformChatHistory`\n",
"\n",
- "<div class=\"alert alert-warning\" role=\"alert\">\n",
- " <strong>Deprecation Notice:</strong> <code>TransformChatHistory</code> is no longer supported. Please use <code>TransformMessages</code> as the new standard method. For the latest examples, visit the notebook at <a href=\"https://github.com/microsoft/autogen/blob/main/notebook/agentchat_transform_messages.ipynb\" target=\"_blank\">notebook/agentchat_transform_messages.ipynb</a>.\n",
+ "<div class=\"alert alert-danger\" role=\"alert\">\n",
+ " <strong>Deprecation Notice:</strong> <code>TransformChatHistory</code> is no longer supported and will be removed in version <code>0.2.30</code>. Please transition to using <code>TransformMessages</code> as the new standard method. For a detailed introduction to this method, including how to limit the number of tokens in message context history to replace <code>TransformChatHistory</code>, visit our guide <a href=\"https://microsoft.github.io/autogen/docs/topics/handling_long_contexts/intro_to_transform_messages\" target=\"_blank\">Introduction to Transform Messages</a>.\n",
"</div>\n",
"\n",
"This notebook illustrates how you can use the `TransformChatHistory` capability to give any `Conversable` agent an ability to handle a long context. \n",
@@ -665,7 +665,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@@ -679,9 +679,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.7"
+ "version": "3.11.9"
}
},
"nbformat": 4,
- "nbformat_minor": 2
+ "nbformat_minor": 4
}
diff --git a/notebook/agentchat_compression.ipynb b/notebook/agentchat_compression.ipynb
index 29cc2d9e2..d7f3a7204 100644
--- a/notebook/agentchat_compression.ipynb
+++ b/notebook/agentchat_compression.ipynb
@@ -6,9 +6,9 @@
"source": [
"# Conversations with Chat History Compression Enabled\n",
"\n",
- "**CompressibleAgent will be deprecated.** \n",
- "\n",
- "Refer to https://github.com/microsoft/autogen/blob/main/notebook/agentchat_capability_long_context_handling.ipynb for long context handling capability.\n",
+ "<div class=\"alert alert-danger\" role=\"alert\">\n",
+ " <strong>Deprecation Notice:</strong> <code>CompressibleAgent</code> has been deprecated and will no longer be available as of version <code>0.2.30</code>. Please transition to using <code>TransformMessages</code>, which is now the recommended approach. For a detailed guide on implementing this new standard, refer to our user guide on <a href=\"https://microsoft.github.io/autogen/docs/topics/handling_long_contexts/compressing_text_w_llmligua\" target=\"_blank\">Compressing Text with LLMLingua</a>. This guide provides examples for effectively utilizing LLMLingua transform as a replacement for <code>CompressibleAgent</code>.\n",
+ "</div>\n",
"\n",
"AutoGen offers conversable agents powered by LLM, tools, or humans, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participance through multi-agent conversation. Please find documentation about this feature [here](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat).\n",
"\n",
@@ -854,7 +854,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "msft",
+ "display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@@ -868,10 +868,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.10.13"
- },
- "orig_nbformat": 4
+ "version": "3.11.9"
+ }
},
"nbformat": 4,
- "nbformat_minor": 2
+ "nbformat_minor": 4
}
diff --git a/test/agentchat/contrib/test_compressible_agent.py b/test/agentchat/contrib/test_compressible_agent.py
index b6e34a6d8..677dd47a9 100755
--- a/test/agentchat/contrib/test_compressible_agent.py
+++ b/test/agentchat/contrib/test_compressible_agent.py
@@ -180,10 +180,7 @@ def test_compress_message():
assert is_success, "Compression failed."
- skip,
- reason="do not run if dependency is not installed OR requested to skip",
-)
[email protected](True, reason="Flaky test, CompressibleAgent no longer supported")
def test_mode_terminate():
assistant = CompressibleAgent(
name="assistant",