diff --git a/autogen/agentchat/contrib/llamaindex_conversable_agent.py b/autogen/agentchat/contrib/llamaindex_conversable_agent.py index 582ff396a5..3cfafb5f7e 100644 --- a/autogen/agentchat/contrib/llamaindex_conversable_agent.py +++ b/autogen/agentchat/contrib/llamaindex_conversable_agent.py @@ -17,6 +17,9 @@ from llama_index.core.base.llms.types import ChatMessage from llama_index.core.chat_engine.types import AgentChatResponse + from packaging import version + from pydantic import BaseModel + from pydantic import __version__ as pydantic_version # let's Avoid: AttributeError: type object 'Config' has no attribute 'copy' if version.parse(pydantic_version) >= version.parse("2.0.0"): from pydantic import ConfigDict