crewai tools질문
tools를 langchain의 tools수 있다고 하셨는데, 자꾸 type 오류가 발생하는데요
코드는 다음과 같습니다.
from langchain.agents import Tool
from langchain_community.tools.tavily_search import TavilySearchResults
tavily = TavilySearchResults()
tavily = Tool(
name="tavily search",
func = tavily.invoke,
description="Web search tool"
)
from crewai import Agent
asd = Agent(
role='a',
goal="a",
backstory="a",
tools=[tavily]
)
여기서,
---------------------------------------------------------------------------
ValidationError Traceback (most recent call last)
Cell In[17], line 2
1 from crewai import Agent
----> 2 asd = Agent(
3 role='a',
4 goal="a",
5 backstory="a",
6 tools=[tavily]
7 )
File c:\Users\skyop\JaehoNote\.venv\Lib\site-packages\pydantic\main.py:212, in BaseModel.__init__(self, **data)
210 # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks
211 __tracebackhide__ = True
--> 212 validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
213 if self is not validated_self:
214 warnings.warn(
215 'A custom validator is returning a value other than `self`.\n'
216 "Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n"
217 'See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.',
218 category=None,
219 )
ValidationError: 1 validation error for Agent
tools.0
Input should be a valid dictionary or instance of BaseTool [type=model_type, input_value=Tool(name='tavily search'...retStr('**********')))>), input_type=Tool]
For further information visit https://errors.pydantic.dev/2.9/v/model_type
와 같은 오류가 발생합니다.
어떤게 문제일까요?