Skip to main content

haystack-duckduckgo

PyPI - Version PyPI - Python Version

Use the DuckDuckGo search engine with your haystack pipeline or agents.

Table of Contents

Installation

pip install haystack-duckduckgo

Usage

This package allows you to use the DuckDuckGo search api, which does not require an API key and can be used free of charge.

Use it in Haystacks WebSearch component:

from haystack_duckduckgo import DuckDuckGoAPI
from haystack.nodes.search_engine import WebSearch

#Build the DuckDuckGo provider
search_engine_provider = DuckDuckGoAPI()
#Initialize the `WebSearch` node with the provider
ws = WebSearch(api_key=None,search_engine_provider=search_engine_provider)

#Use the `WebSearch` node
results = ws.run(query="python programming language")[0]
print(results)

Use it in a Haystack WebRetriever

from haystack_duckduckgo import DuckDuckGoAPI
from haystack.nodes.retriever.web import WebRetriever
from haystack import Pipeline

#Build the DuckDuckGo provider
search_engine_provider = DuckDuckGoAPI()

#Build the pipeline
wr = WebRetriever(api_key=None,search_engine_provider=search_engine_provider)
p=Pipeline()
p.add_node(wr,name="web_retriever",inputs=["Query"])

#Run the pipeline
results = p.run(query="python")
print(results)

License

haystack-duckduckgo is distributed under the terms of the MIT license.

Metadata

Release files for haystack-duckduckgo 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for haystack-duckduckgo 0.0.1
File Size Uploaded
haystack_duckduckgo-0.0.1.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for haystack-duckduckgo 0.0.1
File Interpreter ABI Platform
haystack_duckduckgo-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / haystack_duckduckgo-0.0.1.tar.gz

Download URL haystack_duckduckgo-0.0.1.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
905bb542050a1feb27f3851692bc3c963e6b171c2ad8ec2db43fe3a7ff117bb3
BLAKE2b-256 checksum
How to use checksums
5a79fb8f11674d90ab6a2ea23e28a51d9a5491185e51e987dcf844143f60b502
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / haystack_duckduckgo-0.0.1-py3-none-any.whl

Download URL haystack_duckduckgo-0.0.1-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d6e0038f0b97b3d4ae381bf2ca826e31d7806a7872dc7a967f318cba02b5687
BLAKE2b-256 checksum
How to use checksums
0e2c8a658522e46d826fb4a916488e6773ccd9ca14b25a44dbf0e7f47906bf67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page