removing reference for pydantic v1

This commit is contained in:
João Moura
2024-01-07 21:34:02 -03:00
parent f101dc5592
commit 1ce9a8540b

View File

@@ -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")