Dappier Tool
This will help you get started with the Dappier tool. For detailed documentation of all DappierRetriever features and configurations head to the API reference.Overview
The DappierRealTimeSearchTool and DappierAIRecommendationTool empower AI applications with real-time data and AI-driven insights. The former provides access to up-to-date information across news, weather, travel, and financial markets, while the latter supercharges applications with factual, premium content from diverse domains like News, Finance, and Sports, all powered by Dappier’s pre-trained RAG models and natural language APIs.Setup
This tool lives in thelangchain-dappier
package.
Credentials
We also need to set our Dappier API credentials, which can be generated at the Dappier site..DappierRealTimeSearchTool
Access real-time Google search results, including the latest news, weather, travel, and deals, along with up-to-date financial news, stock prices, and trades from polygon.io, all powered by AI insights to keep you informed.Instantiation
- ai_model_id: str The AI model ID to use for the query. The AI model ID always starts with the prefix “am_”. Defaults to “am_01j06ytn18ejftedz6dyhz2b15”. Multiple AI model IDs are available, which can be found at: marketplace.dappier.com/marketplace
Invocation
Invoke directly with args
TheDappierRealTimeSearchTool
takes a single “query” argument, which should be a natural language query:
Invoke with ToolCall
We can also invoke the tool with a model-generated ToolCall, in which case a ToolMessage will be returned:Chaining
We can use our tool in a chain by first binding it to a tool-calling model and then calling it:DappierAIRecommendationTool
Supercharge your AI applications with Dappier’s pre-trained RAG models and natural language APIs, delivering factual and up-to-date responses from premium content providers across verticals like News, Finance, Sports, Weather, and more.Instantiation
- data_model_id: str The data model ID to use for recommendations. Data model IDs always start with the prefix “dm_”. Defaults to “dm_01j0pb465keqmatq9k83dthx34”. Multiple data model IDs are available, which can be found at Dappier marketplace.
- similarity_top_k: int The number of top documents to retrieve based on similarity. Defaults to “9”.
- ref: Optional[str] The site domain where AI recommendations should be displayed. Defaults to “None”.
- num_articles_ref: int 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: Literal[“most_recent”, “semantic”, “most_recent_semantic”, “trending”] The search algorithm to use for retrieving articles. Defaults to “most_recent”.
Invocation
Invoke directly with args
TheDappierAIRecommendationTool
takes a single “query” argument, which should be a natural language query: