zeerafle's picture
Add YouTube and multimodal file input support
16c8f15
from langgraph.prebuilt import create_react_agent
from config.models import get_default_model
from tools import code_execution
from tools.arxiv_search import arxiv_tool
from tools.wikipedia_search import wikipedia_search_tool
from tools.calculator import calculator_tool
from tools.code_execution import CodeExecutionTool
# from tools.google_search import GoogleSearchTool
from tools.web_search import tavily_search_tool
from tools.wikipedia_search import wikipedia_search_tool
from tools.youtube_understanding import YoutubeUnderstandingTool
import os
SYSTEM_PROMPT = "You are a general AI assistant. I will ask you a question. Report your thoughts, and finish your answer with only the answer to the question, nothing else. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string."
model = get_default_model()
code_execution_tool = CodeExecutionTool(api_key=os.environ['GOOGLE_API_KEY'])
# google_search_tool = GoogleSearchTool(api_key=os.environ['GOOGLE_API_KEY'])
youtube_understanding_tool = YoutubeUnderstandingTool(api_key=os.environ['GOOGLE_API_KEY'])
tools = [
arxiv_tool,
wikipedia_search_tool,
calculator_tool,
code_execution_tool,
# google_search_tool,
tavily_search_tool,
youtube_understanding_tool
]
agent_executor = create_react_agent(model, tools, prompt=SYSTEM_PROMPT)