Skip to content

Commit

Permalink
restore: llamaindex_conversable_agent.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lazToum committed Dec 2, 2024
1 parent 14d0042 commit 4b5dcbf
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions autogen/agentchat/contrib/llamaindex_conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,12 @@
from llama_index.core.base.llms.types import ChatMessage
from llama_index.core.chat_engine.types import AgentChatResponse
from pydantic import BaseModel
from pydantic import __version__ as pydantic_version

# let's Avoid: AttributeError: type object 'Config' has no attribute 'copy'
if pydantic_version >= "2.0":
from pydantic import ConfigDict

Config = ConfigDict(arbitrary_types_allowed=True)
else:

class Config:
arbitrary_types_allowed = True

# Add Pydantic configuration to allow arbitrary types
# Added to mitigate PydanticSchemaGenerationError
class Config:
arbitrary_types_allowed = True

BaseModel.model_config = Config

except ImportError as e:
Expand Down

0 comments on commit 4b5dcbf

Please sign in to comment.