Skip to content

Initial plugin#1

Merged
justyns merged 8 commits intomasterfrom
init-cookiecutter
May 31, 2025
Merged

Initial plugin#1
justyns merged 8 commits intomasterfrom
init-cookiecutter

Conversation

@justyns
Copy link
Owner

@justyns justyns commented May 31, 2025

No description provided.

@justyns justyns requested a review from Copilot May 31, 2025 09:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 format shadows the built-in function; consider renaming it to response_format or fmt for clarity.
        format: str = "json",

llm_tools_searxng.py:21

  • Optional parameters categories, engines, and time_range are introduced but lack dedicated tests; consider adding test cases covering these filters.
        categories: str = None,

Comment on lines +59 to +60
# TODO: Set user agent?
headers = None
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The headers variable is unused and accompanied by a TODO; either implement header handling (e.g., user agent) or remove this dead code.

Suggested change
# TODO: Set user agent?
headers = None
headers = {
"User-Agent": "SearXNG-Client/1.0"
}

Copilot uses AI. Check for mistakes.
@@ -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/)
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Markdown badge syntax is incorrect (missing leading ! and has an extra bracket); update to ![PyPI](badge-url)](project-url).

Copilot uses AI. Check for mistakes.


def searxng_search(query: str) -> str:
"""
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring for searxng_search doesn’t mention the number_of_results field that is returned; update it to reflect the full JSON structure.

Copilot uses AI. Check for mistakes.
Comment on lines +94 to +98
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}")
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Catching a broad Exception may obscure unexpected errors; consider catching more specific exceptions or using raise ... from e to preserve the original traceback.

Suggested change
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

Copilot uses AI. Check for mistakes.

```bash
cd llm-tools-searxng
uv sync --all-extras
Copy link

Copilot AI May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The command uv sync --all-extras may be unclear or incorrect; clarify the intended tool invocation for setting up the environment.

Copilot uses AI. Check for mistakes.
@justyns justyns merged commit 69009d4 into master May 31, 2025
2 of 12 checks passed
@justyns justyns deleted the init-cookiecutter branch May 31, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants