muhammadmaazuddin's picture
feat: initail working agent
ac0f9ba
raw
history blame
1.74 kB
from smolagents import load_tool, Tool, tool, ToolCallingAgent, CodeAgent, GoogleSearchTool,FinalAnswerTool,PythonInterpreterTool , LiteLLMModel, VisitWebpageTool, DuckDuckGoSearchTool
from litellm import completion
from langchain.agents import load_tools
from langchain_community.tools.tavily_search import TavilySearchResults
import os
from src.final_assignment_template.models import openrouter_qwenCoder_model, modelLiteLLm
from src.final_assignment_template.tools import travily_tool, Video_understanding_tool, image_understanding_tool, get_task_file
# (Keep Constants as is)
# --- Constants ---
web_agent = CodeAgent(
model=openrouter_qwenCoder_model,
tools=[
# GoogleSearchTool(provider="serper"),
# DuckDuckGoSearchTool(max_results=10),
travily_tool,
VisitWebpageTool(),
],
name="web_agent",
description="""Browses the web to find information""",
verbosity_level=1,
max_steps=5,
)
manager_agent = CodeAgent(
name="Task_Agent",
description="""You will be provided a task and you need to verify before giving final answer
You can perform tasks which are text and image based, skip all other
""",
model=modelLiteLLm,
tools=[PythonInterpreterTool(),Video_understanding_tool,image_understanding_tool,get_task_file],
managed_agents=[web_agent],
additional_authorized_imports=[
"json",
"pandas",
"numpy",
"markdown"
'math', 'statistics', 're', 'unicodedata', 'random',
'datetime', 'queue', 'time', 'collections', 'stat', 'itertools',
'PIL','requests'
],
planning_interval=3,
verbosity_level=1,
# final_answer_checks=[check_reasoning_and_plot],
max_steps=5,
)