feature : agno multi-agent implementation

This commit is contained in:
priyanshm07 2025-04-08 17:46:54 +05:30
parent 293c35629f
commit e4cea90a18
2 changed files with 46 additions and 7 deletions

View file

@ -29,15 +29,31 @@ git clone https://github.com/yourusername/ai-travel-planner.git
cd ai-travel-planner cd ai-travel-planner
1. *Create Virtual Env* 2. *Create Virtual Env*
conda create -n env_name python=3.10 -y conda create -n env_name python=3.10 -y
conda activate env_name conda activate env_name
pip install -r requirements.txt pip install -r requirements.txt
1. *Create env file* 3. *Create env file*
GOOGLE_MAPS_API_KEY=your_google_maps_api_key GOOGLE_MAPS_API_KEY=your_google_maps_api_key
ACCUWEATHER_API_KEY=your_accuweather_api_key ACCUWEATHER_API_KEY=your_accuweather_api_key
OPENAI_API_KEY=your_openai_api_key OPENAI_API_KEY=your_openai_api_key
---
## 🧠 Built With
-- Agno
-- FastMCP
-- OpenAI
-- Google Maps Platform
-- Airbnb MCP
-- Accuweather

View file

@ -2,6 +2,7 @@ import asyncio
import os import os
from agno.agent import Agent from agno.agent import Agent
from agno.team.team import Team
from agno.tools.mcp import MultiMCPTools from agno.tools.mcp import MultiMCPTools
import streamlit as st import streamlit as st
@ -37,17 +38,39 @@ async def run_agent(message: str) -> None:
], ],
env=env, env=env,
) as mcp_tools: ) as mcp_tools:
agent = Agent(
#Define sepcialized agents
maps_agent = Agent(
tools=[mcp_tools], tools=[mcp_tools],
markdown=True, name="Maps Agent",
show_tool_calls=True, goal="Integrates with Google Maps server to provide routing information, travel time estimates, and points of interest proximity analysis"
) )
await agent.aprint_response(message, stream=True) weather_agent = Agent(
tools=[mcp_tools],
name="Weather Agent",
goal="Pulls data from OpenWeatherMap to provide weather forecasts for planned dates and locations, allowing for weather-appropriate activity planning."
)
booking_agent = Agent(
tools=[mcp_tools],
name="Booking Agent",
goal="Connects to Booking.com and Airbnb APIs to search and filter accommodations based on user preferences (price range, amenities, location)"
)
team = Team(
members=[maps_agent, weather_agent, booking_agent],
name="Travel Planning Team",
markdown=True,
show_tool_calls=True
)
await team.aprint_response(message, stream=True)
# -------------------- Terminal Interaction Loop -------------------- # -------------------- Terminal Interaction Loop --------------------
if _name_ == "_main_": # type: ignore if __name__ == "__main__": # ✅ correct
print("🌍 Travel Planning Agent — Airbnb, Maps, Weather, Calendar (type 'exit' to quit)\n") print("🌍 Travel Planning Agent — Airbnb, Maps, Weather, Calendar (type 'exit' to quit)\n")
try: try:
while True: while True: