Overview
The LlamaIndex integration with Dappier allows developers to enhance their LLM applications with real-time search and AI-powered recommendation tools. By leveraging Dappierβs pre-trained, RAG-ready APIs, LLMs can retrieve accurate, up-to-date information across key domains such as news, finance, weather, sports, and lifestyle content. This integration includes two tools:- DappierRealTimeSearchToolSpec: Enables LLMs to access live web and financial data using natural language queries.
- DappierAIRecommendationsToolSpec: Provides intelligent content recommendations from trusted media sources based on user intent and query context.
Installation
To get started, install the required Python packages:Setup API Keys
To authenticate and use Dappier tools, youβll need a valid API key. You can generate one for free from your Dappier API dashboard. Once you have the key, set it in your environment using the following code:Python
Dappier Real Time Search Tool
DappierRealTimeSearchToolSpec allows LLMs to access real-time data across the web, including the latest news, weather, financial updates, and more.
Watch the Video Guide
If you prefer a visual walkthrough, check out the accompanying video guide below:Initialize the Tool
You can initialize the real-time search tool and convert it into a list of tools ready for use:Python
Real-Time Web Search
Query real-time web content such as news, weather, or general updates.Python
Stock Market Data
Access real-time financial insights and stock news.Python
Parameters
TheDappierRealTimeSearchToolSpec methods support the following parameter:
query (str)
- A natural language query used to retrieve real-time data from web sources or financial platforms.
- This parameter is required for both
search_real_time_dataandsearch_stock_market_data.
Dappier AI Recommendations Tool
DappierAIRecommendationsToolSpec provides intelligent, real-time content recommendations across a variety of verticals including sports, lifestyle, pet care, sustainable living, and local news. These recommendations come from trusted content partners and are tailored based on user queries.
Watch the Video Guide
If you prefer a visual walkthrough, check out the accompanying video guide below:Initialize the Tool
Python
Sports News Recommendations
Python
Lifestyle News
Python
iHeartDogs Articles
Python
iHeartCats Articles
Python
GreenMonster Articles
Python
WISH-TV News
Python
9 and 10 News
Python
Parameters
All recommendation methods inDappierAIRecommendationsToolSpec support the following parameters:
query (str)
- The user query for retrieving recommendations.
data_model_id (str) Optional
- The data model ID to use for recommendations.
- Data model IDs always start with the prefix
"dm_". - Defaults to
"dm_01j0pb465keqmatq9k83dthx34".
similarity_top_k (int) Optional
- The number of top documents to retrieve based on similarity.
- Defaults to
9.
ref (str) Optional
- The site domain where AI recommendations should be displayed.
- Defaults to
None.
num_articles_ref (int) Optional
- The minimum number of articles to return from the specified reference domain (
ref). - The remaining articles will come from other sites in the RAG model.
- Defaults to
0.
search_algorithm (str) Optional
- The search algorithm to use for retrieving articles. Available options:
"most_recent"(default)"semantic""most_recent_semantic""trending"

