From 8406c618ee9ef768a78b61fd3d2dfa3195a921e8 Mon Sep 17 00:00:00 2001 From: julian-risch <4181769+julian-risch@users.noreply.github.com> Date: Tue, 21 Jul 2026 12:07:39 +0000 Subject: [PATCH] Sync Core Integrations API reference (ddgs) on Docusaurus --- .../reference/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.18/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.19/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.20/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.21/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.22/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.23/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.24/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.25/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.26/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.27/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.28/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.29/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.30/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-2.31/integrations-api/ddgs.md | 101 ++++++++++++++++++ .../version-3.0/integrations-api/ddgs.md | 101 ++++++++++++++++++ 16 files changed, 1616 insertions(+) create mode 100644 docs-website/reference/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.18/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.19/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.20/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.21/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.22/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.23/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.24/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.25/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.26/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.27/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.28/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.29/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.30/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-2.31/integrations-api/ddgs.md create mode 100644 docs-website/reference_versioned_docs/version-3.0/integrations-api/ddgs.md diff --git a/docs-website/reference/integrations-api/ddgs.md b/docs-website/reference/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.18/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.18/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.18/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.19/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.19/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.19/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.20/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.20/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.20/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.21/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.21/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.21/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.22/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.22/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.22/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.23/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.23/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.23/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.24/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.24/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.24/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.25/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.25/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.25/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.26/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.26/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.26/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.27/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.27/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.27/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.28/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.28/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.28/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.29/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.29/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.29/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.30/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.30/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.30/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-2.31/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-2.31/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-2.31/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys. diff --git a/docs-website/reference_versioned_docs/version-3.0/integrations-api/ddgs.md b/docs-website/reference_versioned_docs/version-3.0/integrations-api/ddgs.md new file mode 100644 index 0000000000..627a5b885d --- /dev/null +++ b/docs-website/reference_versioned_docs/version-3.0/integrations-api/ddgs.md @@ -0,0 +1,101 @@ +--- +title: "ddgs" +id: integrations-ddgs +description: "ddgs (Dux Distributed Global Search) integration for Haystack" +slug: "/integrations-ddgs" +--- + + +## haystack_integrations.components.websearch.ddgs.ddgs_websearch + +### DDGSWebSearch + +Searches the web with ddgs (Dux Distributed Global Search) and returns results as Haystack Documents. + +[ddgs](https://github.com/deedy5/ddgs) is a free, **keyless** metasearch library that aggregates +results from multiple backends (DuckDuckGo, Google, Bing, Brave, Yahoo, Yandex, Mullvad, and more), +so no API key is required. + +### Usage example + +```python +from haystack_integrations.components.websearch.ddgs import DDGSWebSearch + +websearch = DDGSWebSearch(top_k=5) +result = websearch.run(query="What is Haystack by deepset?") + +documents = result["documents"] +links = result["links"] +``` + +#### __init__ + +```python +__init__( + top_k: int = 10, + backend: str = "auto", + region: str = "us-en", + safesearch: str = "moderate", + search_params: dict[str, Any] | None = None, +) -> None +``` + +Initialize the DDGSWebSearch component. + +**Parameters:** + +- **top_k** (int) – Maximum number of results to return. +- **backend** (str) – Comma-separated ddgs backends to query, or `"auto"` to let ddgs choose + (for example `"duckduckgo, google, brave"`). See the ddgs docs for the full list. +- **region** (str) – Region/locale for the search, for example `"us-en"`, `"de-de"`, or `"wt-wt"` (no region). +- **safesearch** (str) – Safe-search level: `"on"`, `"moderate"`, or `"off"`. +- **search_params** (dict\[str, Any\] | None) – Additional keyword arguments forwarded to `DDGS().text()` (for example `page` or + `timelimit`). Values here override `backend`, `region`, `safesearch`, and `top_k` + on conflict. + +#### warm_up + +```python +warm_up() -> None +``` + +Initialize the ddgs client. + +Called automatically on first use. Can be called explicitly to avoid cold-start latency. + +#### run + +```python +run(query: str) -> dict[str, list[Document] | list[str]] +``` + +Use ddgs to search the web. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with the following keys: +- `documents`: List of documents returned by the search backends. +- `links`: List of links returned by the search backends. + +#### run_async + +```python +run_async(query: str) -> dict[str, list[Document] | list[str]] +``` + +Asynchronously use ddgs to search the web. + +ddgs has no native async API, so the blocking search runs in a worker thread. Same parameters +and return values as :meth:`run`. + +**Parameters:** + +- **query** (str) – Search query. + +**Returns:** + +- dict\[str, list\[Document\] | list\[str\]\] – A dictionary with `documents` and `links` keys.