Spaces:
Runtime error
Runtime error
from crewai import Agent, LLM | |
from tools import yt_tool | |
from dotenv import load_dotenv | |
load_dotenv() | |
import litellm | |
import os | |
from langchain_google_genai import ChatGoogleGenerativeAI | |
os.environ["GEMINI_API_KEY"] = os.getenv("GEMINI_API_KEY") | |
api_key = "AIzaSyA_jVLib-F27Fe6GvPqdHH5VQZ1eRJUJbY" | |
litellm.api_key = api_key | |
GEMINI_API_KEY = api_key | |
llm = LLM( | |
# model="gemini/gemini-1.5-pro-latest", | |
model="gemini/gemini-2.0-flash", | |
temperature=0.7, | |
google_api_key=api_key | |
) | |
# Create a Senior blog Content researcher agent | |
blog_researcher = Agent( | |
role = 'Blog Researcher from Youtube Videos', | |
goal = 'Get the relevant video content for the topic {topic} from YT channel', | |
verbose = True, | |
memory = True, | |
backstory = ( | |
"Expert in understanding videos in AI Data Science , Machine Learning And GEN AI and providing suggestions" | |
), | |
tools = [yt_tool], | |
llm=llm, | |
allow_delegation = True | |
) | |
# Create a senior blog Writer agent with YT tool | |
blog_writer=Agent( | |
role = 'Blog Writer', | |
goal = 'Narrate compelling tech stories about the video {topic} from YT video', | |
verbose = True, | |
memory = True, | |
backstory = ( | |
"With a flair for simplifying complex topics, you craft" | |
"engaging narratives that captivate and educate, bringing new" | |
"discoveries to light in an accessible manner." | |
), | |
tools = [yt_tool], | |
llm=llm, | |
allow_delegation = False | |
) | |