From 1ce9a8540b375e38467c0c78c437dd0bed567b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moura?= Date: Sun, 7 Jan 2024 21:34:02 -0300 Subject: [PATCH] removing reference for pydantic v1 --- crewai/agents/cache/cache_hit.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crewai/agents/cache/cache_hit.py b/crewai/agents/cache/cache_hit.py index 699c6bb14..07a711c29 100644 --- a/crewai/agents/cache/cache_hit.py +++ b/crewai/agents/cache/cache_hit.py @@ -1,5 +1,6 @@ -from langchain_core.agents import AgentAction -from pydantic.v1 import BaseModel, Field +from typing import Any + +from pydantic import BaseModel, Field from .cache_handler import CacheHandler @@ -10,5 +11,8 @@ class CacheHit(BaseModel): class Config: arbitrary_types_allowed = True - action: AgentAction = Field(description="Action taken") + # Making it Any instead of AgentAction to avoind + # pydantic v1 vs v2 incompatibility, langchain should + # soon be updated to pydantic v2 + action: Any = Field(description="Action taken") cache: CacheHandler = Field(description="Cache Handler for the tool")