- OpenAI Function Calling: A powerful feature that enables large language models to automatically detect and invoke external tools to accomplish tasks in a structured and contextual manner.
- Dappier: A platform connecting LLMs to real-time, rights-cleared data from trusted sources, specializing in domains like web search, weather, and commerce. It delivers enriched, prompt-ready data, empowering AI with verified and up-to-date information for diverse applications.
- Dynamic Travel Planning: A real-world use case where the assistant reasons over live data to generate a customized 2-day itinerary for New York City based on the latest news, weather, and hotel deals.
πΊ Video Walkthrough
Prefer watching? Hereβs a video version of this notebook:π¦ Installation
Install the required packages:π Setting Up API Keys
Youβll need to set up your API keys for OpenAI, Dappier. This ensures that the tools can interact with external services securely. You can go to here to get API Key from Dappier with free credits.Python
Python
βοΈ Initialize Clients
Set up theOpenAI and Dappier Python SDK clients.
Python
π°οΈ Define the Dappier Tool Function
This function will be called by the LLM to fetch real-time info.Python
π Define the User Prompt
This prompt instructs the assistant to gather news, weather, and hotel data, and then create an itinerary.Python
π§ Define the Tool Schema for OpenAI
Weβll registerdappier_real_time_search as a callable tool for OpenAIβs function calling.
Python
π€ Run the Assistant Workflow
This function runs the full interaction: the model decides which tools to use, retrieves the data, and then generates a final response.Python
π Generate the Travel Itinerary
Run the full conversation and stream the final response as the itinerary.Python
π Highlights
This notebook has guided you through setting up and running a real-time travel planner workflow using OpenAI Function Calling and Dappier. You can adapt and expand this example for various other scenarios requiring live data integration, contextual understanding, and intelligent response generation. Key tools utilized in this notebook include:- OpenAI Function Calling: Allows the model to automatically determine when to invoke external tools, enabling dynamic decision-making during a conversation.
- Dappier: A platform connecting LLMs to real-time, rights-cleared data from trusted sources, specializing in domains like web search, weather, and news. It delivers enriched, prompt-ready data, empowering AI with verified and up-to-date information for diverse applications.
- Streamed Response Generation: Leverages OpenAIβs streaming capability to output responses incrementally, improving performance and responsiveness when generating long-form content.

