Skip to content

Conversation

Luojz
Copy link

@Luojz Luojz commented Mar 9, 2025

Add SearxNG support to enhance search engine flexibility

Features

  • Added SearxNG as an alternative search engine option
  • Implemented configurable search engine selection in config.toml
  • Maintained compatibility with existing Google search functionality
  • Added support for custom SearxNG instance configuration
  • Preserved the same interface for all search engines

Feature Docs

Configuration example in config.toml:

[search_engine]
type = "searxng"  # Supported types: google, searxng
base_url = "http://127.0.0.1:8080"  # SearxNG service address

Users can easily switch between search engines by modifying the config file:

  1. Use Google search (default): type = "google"
  2. Use SearxNG: type = "searxng" with custom base_url
  3. Extensible design for adding more search engines in future

Influence

  • Functionality:
    • Free and open-source alternative to Google search
    • More search options for different scenarios
    • Easy to switch between search engines
  • Extensibility:
    • Modular design for adding new search engines
    • Configuration-based engine selection
    • No code changes needed to switch engines

Result

Example usage remains the same while supporting multiple engines:

# Returns same format regardless of engine choice
results = await search_tool.execute(query="test", num_results=10)
# Returns: ["url1", "url2", ...]

Other

  • Zero breaking changes to existing functionality
  • Added documentation for SearxNG configuration
  • Prepared foundation for future search engine integrations
  • All search engines follow the same interface pattern
searxng

@ghmole
Copy link

ghmole commented Mar 17, 2025

very useful feature

@mannaandpoem
Copy link
Collaborator

Please update code and resolve conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⭐ top pull request Top pull request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants