Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Deprecation Warning for CompressibleAgent and TransformChatHistory #2685

Merged
merged 6 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions autogen/agentchat/contrib/capabilities/context_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
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,
)
Expand Down
4 changes: 2 additions & 2 deletions autogen/agentchat/contrib/compressible_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
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,
)
Expand Down
10 changes: 5 additions & 5 deletions notebook/agentchat_capability_long_context_handling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -665,7 +665,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -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
}
15 changes: 7 additions & 8 deletions notebook/agentchat_compression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -854,7 +854,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "msft",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -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
}
5 changes: 1 addition & 4 deletions test/agentchat/contrib/test_compressible_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,7 @@ def test_compress_message():
assert is_success, "Compression failed."


@pytest.mark.skipif(
skip,
reason="do not run if dependency is not installed OR requested to skip",
)
@pytest.mark.skipif(True, reason="Flaky test, CompressibleAgent no longer supported")
def test_mode_terminate():
assistant = CompressibleAgent(
name="assistant",
Expand Down
Loading