Conversation
There was a problem hiding this comment.
Pull Request Overview
Initializes the llm-tools-searxng plugin to enable web searches via SearXNG within LLM workflows.
- Implement SearXNG search class and searxng_search function as an LLM tool
- Configure project metadata, dependencies, and entry points in pyproject.toml
- Add tests covering both GET and POST search scenarios
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_llm_tools_searxng.py | Added functional tests for GET and POST flows of searxng_search and direct SearXNG class usage |
| llm_tools_searxng.py | Initial implementation of SearXNG class, search logic, error handling, and tool registration |
| pyproject.toml | Configured project metadata, dependencies, dev tools, and llm entry point |
| README.md | Provided installation, configuration, usage, and development instructions |
| .github/workflows/test.yml | CI pipeline for linting with Ruff and running tests across multiple Python versions |
| .github/workflows/publish.yml | Release pipeline to build, test, and publish the package to PyPI |
Comments suppressed due to low confidence (2)
llm_tools_searxng.py:20
- [nitpick] The parameter name
formatshadows the built-in function; consider renaming it toresponse_formatorfmtfor clarity.
format: str = "json",
llm_tools_searxng.py:21
- Optional parameters
categories,engines, andtime_rangeare introduced but lack dedicated tests; consider adding test cases covering these filters.
categories: str = None,
| # TODO: Set user agent? | ||
| headers = None |
There was a problem hiding this comment.
[nitpick] The headers variable is unused and accompanied by a TODO; either implement header handling (e.g., user agent) or remove this dead code.
| # TODO: Set user agent? | |
| headers = None | |
| headers = { | |
| "User-Agent": "SearXNG-Client/1.0" | |
| } |
| @@ -0,0 +1,79 @@ | |||
| # llm-tools-searxng | |||
|
|
|||
| [PyPI](https://img.shields.io/pypi/v/llm-tools-searxng.svg)](https://pypi.org/project/llm-tools-searxng/) | |||
There was a problem hiding this comment.
The Markdown badge syntax is incorrect (missing leading ! and has an extra bracket); update to ](project-url).
|
|
||
|
|
||
| def searxng_search(query: str) -> str: | ||
| """ |
There was a problem hiding this comment.
The docstring for searxng_search doesn’t mention the number_of_results field that is returned; update it to reflect the full JSON structure.
| raise Exception(f"HTTP error occurred: {e}") | ||
| except json.JSONDecodeError as e: | ||
| raise Exception(f"Error parsing JSON response: {e}") | ||
| except Exception as e: | ||
| raise Exception(f"Error performing search: {e}") |
There was a problem hiding this comment.
[nitpick] Catching a broad Exception may obscure unexpected errors; consider catching more specific exceptions or using raise ... from e to preserve the original traceback.
| raise Exception(f"HTTP error occurred: {e}") | |
| except json.JSONDecodeError as e: | |
| raise Exception(f"Error parsing JSON response: {e}") | |
| except Exception as e: | |
| raise Exception(f"Error performing search: {e}") | |
| raise RuntimeError(f"HTTP error occurred: {e}") from e | |
| except json.JSONDecodeError as e: | |
| raise ValueError(f"Error parsing JSON response: {e}") from e | |
| except Exception as e: | |
| raise RuntimeError(f"An unexpected error occurred while performing the search: {e}") from e |
|
|
||
| ```bash | ||
| cd llm-tools-searxng | ||
| uv sync --all-extras |
There was a problem hiding this comment.
[nitpick] The command uv sync --all-extras may be unclear or incorrect; clarify the intended tool invocation for setting up the environment.
No description provided.