Skip to content

Commit

Permalink
docs: add langchain dappier tool integration notebook (#29265)
Browse files Browse the repository at this point in the history
Add tools to interact with Dappier APIs with an example notebook.

For `DappierRealTimeSearchTool`, the tool can be invoked with:

```python
from langchain_dappier import DappierRealTimeSearchTool

tool = DappierRealTimeSearchTool()

tool.invoke({"query": "What happened at the last wimbledon"})
```

```
At the last Wimbledon in 2024, Carlos Alcaraz won the title by defeating Novak Djokovic. This victory marked Alcaraz's fourth Grand Slam title at just 21 years old! 🎉🏆🎾
```

For DappierAIRecommendationTool the tool can be invoked with:

```python
from langchain_dappier import DappierAIRecommendationTool

tool = DappierAIRecommendationTool(
    data_model_id="dm_01j0pb465keqmatq9k83dthx34",
    similarity_top_k=3,
    ref="sportsnaut.com",
    num_articles_ref=2,
    search_algorithm="most_recent",
)
```

```
[{"author": "Matt Weaver", "image_url": "https://images.dappier.com/dm_01j0pb465keqmatq9k83dthx34...", "pubdate": "Fri, 17 Jan 2025 08:04:03 +0000", "source_url": "https://sportsnaut.com/chili-bowl-thursday-bell-column/", "summary": "The article highlights the thrilling unpredictability... ", "title": "Thursday proves why every lap of Chili Bowl..."},
{"author": "Matt Higgins", "image_url": "https://images.dappier.com/dm_01j0pb465keqmatq9k83dthx34...", "pubdate": "Fri, 17 Jan 2025 02:48:42 +0000", "source_url": "https://sportsnaut.com/new-york-mets-news-pete-alonso...", "summary": "The New York Mets are likely parting ways with star...", "title": "MLB insiders reveal New York Mets’ last-ditch..."},
{"author": "Jim Cerny", "image_url": "https://images.dappier.com/dm_01j0pb465keqmatq9k83dthx34...", "pubdate": "Fri, 17 Jan 2025 05:10:39 +0000", "source_url": "https://www.foreverblueshirts.com/new-york-rangers-news...", "summary": "The New York Rangers achieved a thrilling 5-3 comeback... ", "title": "Rangers score 3 times in 3rd period for stirring 5-3..."}]
```

The integration package can be found over here -
https://github.com/DappierAI/langchain-dappier
  • Loading branch information
amaan-ai20 authored Jan 18, 2025
1 parent 184ea8a commit d4b9404
Show file tree
Hide file tree
Showing 3 changed files with 515 additions and 8 deletions.
11 changes: 11 additions & 0 deletions docs/docs/integrations/providers/dappier.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,14 @@ See a [usage example](/docs/integrations/retrievers/dappier).
```python
from langchain_dappier import DappierRetriever
```

## Tool

See a [usage example](/docs/integrations/tools/dappier).

```python
from langchain_dappier import (
DappierRealTimeSearchTool,
DappierAIRecommendationTool
)
```
8 changes: 0 additions & 8 deletions docs/docs/integrations/retrievers/dappier.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@
"\n",
"This will help you getting started with the Dappier [retriever](https://python.langchain.com/docs/concepts/retrievers/). For detailed documentation of all DappierRetriever features and configurations head to the [API reference](https://python.langchain.com/en/latest/retrievers/langchain_dappier.retrievers.Dappier.DappierRetriever.html).\n",
"\n",
"### Integration details\n",
"\n",
"Bring-your-own data (i.e., index and search a custom corpus of documents):\n",
"\n",
"| Retriever | Self-host | Cloud offering | Package |\n",
"| :--- | :--- | :---: | :---: |\n",
"[DappierRetriever](https://python.langchain.com/en/latest/retrievers/langchain_dappier.retrievers.Dappier.DappierRetriever.html) | ❌ | ❌ | langchain-dappier |\n",
"\n",
"### Setup\n",
"\n",
"Install ``langchain-dappier`` and set environment variable ``DAPPIER_API_KEY``.\n",
Expand Down
Loading

0 comments on commit d4b9404

Please sign in to comment.