You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im getting this erro:
AttributeError: type object 'YoutubeVideoDetailsToolInput' has no attribute 'model_fields'
Steps to Reproduce
when I run the crew, it shows the error in the agents
Expected behavior
Screenshots/Code snippets
def research_manager(self, youtube_video_search_tool, youtube_video_details_tool):
return Agent(
role="YouTube Research Manager",
goal="""For a given topic and description for a new YouTube video, find a minimum of 15 high-performing videos
on the same topic with the ultimate goal of populating the research table which will be used by
other agents to help them generate titles and other aspects of the new YouTube video
that we are planning to create.""",
backstory="""As a methodical and detailed research managar, you are responsible for overseeing researchers who
actively search YouTube to find high-performing YouTube videos on the same topic.""",
verbose=True,
allow_delegation=True,
tools=[youtube_video_search_tool, youtube_video_details_tool]
)
Operating System
Windows 11
Python Version
3.11
crewAI Version
crewai==0.76.9
crewAI Tools Version
crewai-tools==0.13.4
Virtual Environment
Venv
Evidence
Traceback (most recent call last):
File "D:\Documentos\codigos\youtube_helper\main.py", line 25, in
research_manager = agents.research_manager(youtube_video_search_tool, youtube_video_details_tool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Documentos\codigos\youtube_helper\agents.py", line 29, in research_manager
return Agent(
^^^^^^
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\pydantic\main.py", line 212, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agent.py", line 179, in post_init_setup
self._setup_agent_executor()
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agent.py", line 189, in _setup_agent_executor
self.set_cache_handler(self.cache_handler)
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agents\agent_builder\base_agent.py", line 262, in set_cache_handler
self.create_agent_executor()
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agent.py", line 300, in create_agent_executor
tools_description=self._render_text_description_and_args(parsed_tools),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agent.py", line 412, in _render_text_description_and_args
for name, field in tool.args_schema.model_fields.items()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'YoutubeVideoDetailsToolInput' has no attribute 'model_fields'
Possible Solution
None
Additional context
from typing import List, Type
from pydantic import BaseModel, Field
from crewai_tools import BaseTool
import os
import requests
from datetime import datetime, timezone
class VideoSearchResult(BaseModel):
video_id: str
title: str
channel_id: str
channel_title: str
days_since_published: int
class YoutubeVideoSearchToolInput(BaseModel):
"""Input for YoutubeVideoSearchTool."""
keyword: str = Field(..., description="The search keyword.")
max_results: int = Field(10, description="The maximum number of results to return.")
class YoutubeVideoSearchTool(BaseTool):
name: str = "Search YouTube Videos"
description: str = "Searches YouTube videos based on a keyword and returns a list of video search results."
#args_schema: Type[BaseModel] = YoutubeVideoSearchToolInput
Description
Im getting this erro:
AttributeError: type object 'YoutubeVideoDetailsToolInput' has no attribute 'model_fields'
Steps to Reproduce
when I run the crew, it shows the error in the agents
Expected behavior
Screenshots/Code snippets
Operating System
Windows 11
Python Version
3.11
crewAI Version
crewai==0.76.9
crewAI Tools Version
crewai-tools==0.13.4
Virtual Environment
Venv
Evidence
Traceback (most recent call last):
File "D:\Documentos\codigos\youtube_helper\main.py", line 25, in
research_manager = agents.research_manager(youtube_video_search_tool, youtube_video_details_tool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Documentos\codigos\youtube_helper\agents.py", line 29, in research_manager
return Agent(
^^^^^^
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\pydantic\main.py", line 212, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agent.py", line 179, in post_init_setup
self._setup_agent_executor()
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agent.py", line 189, in _setup_agent_executor
self.set_cache_handler(self.cache_handler)
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agents\agent_builder\base_agent.py", line 262, in set_cache_handler
self.create_agent_executor()
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agent.py", line 300, in create_agent_executor
tools_description=self._render_text_description_and_args(parsed_tools),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Documentos\codigos\youtube_helper\env\Lib\site-packages\crewai\agent.py", line 412, in _render_text_description_and_args
for name, field in tool.args_schema.model_fields.items()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'YoutubeVideoDetailsToolInput' has no attribute 'model_fields'
Possible Solution
None
Additional context
from typing import List, Type
from pydantic import BaseModel, Field
from crewai_tools import BaseTool
import os
import requests
from datetime import datetime, timezone
class VideoSearchResult(BaseModel):
video_id: str
title: str
channel_id: str
channel_title: str
days_since_published: int
class YoutubeVideoSearchToolInput(BaseModel):
"""Input for YoutubeVideoSearchTool."""
keyword: str = Field(..., description="The search keyword.")
max_results: int = Field(10, description="The maximum number of results to return.")
class YoutubeVideoSearchTool(BaseTool):
name: str = "Search YouTube Videos"
description: str = "Searches YouTube videos based on a keyword and returns a list of video search results."
#args_schema: Type[BaseModel] = YoutubeVideoSearchToolInput
The text was updated successfully, but these errors were encountered: