Dappier Python SDK for interacting with Dappier APIs
Project description
Dappier Python SDK
Python SDK for interacting with Dappier's API's.
Overview
dappier-py provides a straightforward way to interact with Dappier's API's, which allows for real-time data search on the internet and other datamodels from the marketplace. The library is designed to be easy to use and integrate into existing Python projects.
Installation
To install the package, run:
pip install dappier
Alternatively, you can clone the repository and install the dependencies:
git clone https://github.com/DappierAI/dappier-py
cd dappier-py
pip install -r requirements.txt
Initialization
You can get your API key from your Dappier account.
from dappier.dappier import DappierApp
app = DappierApp(api_key='your_api_key')
Real-Time Search
You can perform a real-time search by providing a query. This will search for real-time data related to your query.
result = app.realtime_search_api("When is the next election?")
print(result.response['response']["results"])
AI Recommendations
The AI Recommendations feature allows you to query for articles and other content using a specific data model. You can pick a specific datamodel from marketplace
Default Options:
ai_result = app.ai_recommendations(query="latest tech news", datamodel_id="dm_02hr75e8ate6adr15hjrf3ikol")
print(ai_result.results)
Custom Options:
You can pass custom parameters such as similarity_top_k, ref and num_articles_ref:
ai_custom_result = app.ai_recommendations(
query="latest tech news",
datamodel_id="dm_02hr75e8ate6adr15hjrf3ikol",
similarity_top_k=5,
ref="techcrunch.com",
num_articles_ref=2
)
print(ai_custom_result.results)
Search API
You can also perform a search using a specific datamodel_id. This method allows users to input custom queries and retrieve data based on the datamodel provided.
search_result = app.search(
query="Latest Microsoft News",
datamodel_id="dm_01htjq2njgecvah7ncepm8v87y",
similarity_top_k=6,
ref="familyproof.com",
num_articles_ref=3
)
print(search_result.results)
Checkout (example.py)[https://github.com/DappierAI/dappier-py] in this repository for a working example.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dappier-py-0.2.0.tar.gz.
File metadata
- Download URL: dappier-py-0.2.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
430bacd3a504609c1f45b607745aa2cd1a2cd0a095d477aec027afafcbf1ff9e
|
|
| MD5 |
f710828f39eedd70c4729f935f3221ee
|
|
| BLAKE2b-256 |
a96acb0bca055e7ef9b27eed4fd9149e4aa719d38aeffdb1434b31cb0339295b
|
File details
Details for the file dappier_py-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dappier_py-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
817c29cd498ecf6ead16d6c1781a5e0ef171cc122e1b1422b41b4f3e46eeefe3
|
|
| MD5 |
38137bcce4e3d8fc394efe4523c9bad8
|
|
| BLAKE2b-256 |
f129422288099786049835cdb8675286e401d25f066d10916653a40faa410ebe
|