Skip to main content

No project description provided

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haystack_duckduckgo-0.0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

haystack_duckduckgo-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file haystack_duckduckgo-0.0.1.tar.gz.

File metadata

  • Download URL: haystack_duckduckgo-0.0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for haystack_duckduckgo-0.0.1.tar.gz
Algorithm Hash digest
SHA256 905bb542050a1feb27f3851692bc3c963e6b171c2ad8ec2db43fe3a7ff117bb3
MD5 20bf91efb08e3c350f1e7e93d427712b
BLAKE2b-256 5a79fb8f11674d90ab6a2ea23e28a51d9a5491185e51e987dcf844143f60b502

See more details on using hashes here.

File details

Details for the file haystack_duckduckgo-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for haystack_duckduckgo-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d6e0038f0b97b3d4ae381bf2ca826e31d7806a7872dc7a967f318cba02b5687
MD5 aeaa21af120f35525e69ff0e4cb75e1f
BLAKE2b-256 0e2c8a658522e46d826fb4a916488e6773ccd9ca14b25a44dbf0e7f47906bf67

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page