From 9962bda70b3f9c911a46126774b1a5a325ad696f Mon Sep 17 00:00:00 2001 From: blob42 Date: Mon, 20 Feb 2023 14:46:44 +0000 Subject: [PATCH] searx_search: docs updates (#1175) - fix notebook formatting, remove empty cells and add scrolling for long text --------- Co-authored-by: blob42 --- .../modules/utils/examples/searx_search.ipynb | 41 ++++++++----------- langchain/utilities/searx_search.py | 26 +++++++----- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/docs/modules/utils/examples/searx_search.ipynb b/docs/modules/utils/examples/searx_search.ipynb index a42a0310..9059af1a 100644 --- a/docs/modules/utils/examples/searx_search.ipynb +++ b/docs/modules/utils/examples/searx_search.ipynb @@ -52,13 +52,6 @@ "jukit_cell_id": "gGM9PVQX6m" }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n" - ] - }, { "data": { "text/plain": [ @@ -109,16 +102,12 @@ "cell_type": "code", "execution_count": 2, "metadata": { - "jukit_cell_id": "3FyQ6yHI8K" + "jukit_cell_id": "3FyQ6yHI8K", + "tags": [ + "scroll-output" + ] }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n" - ] - }, { "data": { "text/plain": [ @@ -150,13 +139,6 @@ "jukit_cell_id": "32rDh0Mvbx" }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n" - ] - }, { "data": { "text/plain": [ @@ -208,7 +190,10 @@ "cell_type": "code", "execution_count": 4, "metadata": { - "jukit_cell_id": "r7qUtvKNOh" + "jukit_cell_id": "r7qUtvKNOh", + "tags": [ + "scroll-output" + ] }, "outputs": [ { @@ -276,7 +261,10 @@ "cell_type": "code", "execution_count": 5, "metadata": { - "jukit_cell_id": "JyNgoFm0vo" + "jukit_cell_id": "JyNgoFm0vo", + "tags": [ + "scroll-output" + ] }, "outputs": [ { @@ -454,7 +442,10 @@ "cell_type": "code", "execution_count": 7, "metadata": { - "jukit_cell_id": "5NrlredKxM" + "jukit_cell_id": "5NrlredKxM", + "tags": [ + "scroll-output" + ] }, "outputs": [ { diff --git a/langchain/utilities/searx_search.py b/langchain/utilities/searx_search.py index 478d2e3b..d012b384 100644 --- a/langchain/utilities/searx_search.py +++ b/langchain/utilities/searx_search.py @@ -32,9 +32,6 @@ You can now use the ``search`` instance to query the searx API. Searching --------- -ref to the run method with a custom name - - Use the :meth:`run() ` and :meth:`results() ` methods to query the searx API. Other methods are are available for convenience. @@ -45,7 +42,6 @@ Example usage of the ``run`` method to make a search: .. code-block:: python - # using google and duckduckgo engines s.run(query="what is the best search engine?") Engine Parameters @@ -284,17 +280,27 @@ class SearxSearchWrapper(BaseModel): Args: query: The query to search for. + num_results: Limit the number of results to return. + engines: List of engines to use for the query. + **kwargs: extra parameters to pass to the searx API. Returns: - A list of dictionaries with the following keys: - snippet - The description of the result. - title - The title of the result. - link - The link to the result. - engines - The engines used for the result. - category - Searx category of the result. + Dict with the following keys: + + { + snippet: The description of the result. + + title: The title of the result. + + link: The link to the result. + + engines: The engines used for the result. + + category: Searx category of the result. + } """