AIAgent / tools.py
Adi016's picture
Update tools.py
dc77975 verified
raw
history blame contribute delete
803 Bytes
from crewai_tools import YoutubeChannelSearchTool
import os
from dotenv import load_dotenv
load_dotenv()
yt_tool=YoutubeChannelSearchTool()
def set_channel_handle(channel_handle=None):
os.environ["GEMINI_API_KEY"]=os.getenv("GEMINI_API_KEY")
config = dict(
llm=dict(
provider="google",
config=dict(
model="gemini-2.0-flash-exp"
),
),
embedder=dict(
provider="google",
config=dict(
model="gemini-2.0-flash-exp"
),
),
)
global yt_tool
# Create the tool with the given channel handle and configuration
yt_tool=YoutubeChannelSearchTool(
youtube_channel_handle=channel_handle,
config=config
)
return yt_tool