Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itinerary planner #1514

Merged
merged 11 commits into from
Dec 12, 2024
Merged
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cookbook/examples/agents/03_itinerary_planner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from phi.model.openai import OpenAIChat
from phi.agent import Agent
from phi.tools.exa import ExaTools

itinerary_agent = Agent(
name="GlobeHopper",
model=OpenAIChat(id="gpt-4o"),
tools=[ExaTools()],
markdown=True,
description="You are an expert itinerary planning agent. Your role is to assist users in creating detailed, customized travel plans tailored to their preferences and needs.",
instructions=[
"Use Exa to search and extract relevant data from popular travel websites.",
"Gather information on flights, accommodations, local attractions, and approximate costs from these platforms.",
"Ensure that the collected data is accurate and aligns with the user's preferences and requirements, such as the destination, group size, and budget constraints.",
"Structure a clear, concise itinerary that includes recommendations for transportation, stay, and activities without providing exact reservation numbers or bookings.",
"If a specific website or travel option is unavailable, suggest alternatives from other reliable sources",
"Please do not give links to external websites or booking platforms directly.",
],
)

itinerary_agent.print_response(
"I want to plan an offsite for 14 people for 3 days (28th-30th March) in London within 10k dollars. Please suggest options for places to stay, activities, and co working spaces and a detailed itinerary for the 3 days with transportation and activities",
stream=True,
)
Loading