Updated file names for ollama_anwsers.py and dev.py

This commit is contained in:
2026-05-15 15:51:44 -04:00
parent 957c1fc6fc
commit 323e90d524
+9 -9
View File
@@ -24,11 +24,11 @@ Features:
## Installation ## Installation
Place `ai_answers.py` into the `searx/plugins` directory of your SearXNG instance (or mount it in a container) and enable it in `settings.yml`: Place `ollama_answers.py` into the `searx/plugins` directory of your SearXNG instance (or mount it in a container) and enable it in `settings.yml`:
```yaml ```yaml
plugins: plugins:
searx.plugins.ai_answers.SXNGPlugin: searx.plugins.ollama_answers.SXNGPlugin:
active: true active: true
``` ```
@@ -75,7 +75,7 @@ services:
- LLM_URL=http://ollama:11434/v1/chat/completions - LLM_URL=http://ollama:11434/v1/chat/completions
- LLM_MODEL=qwen3.5:9b - LLM_MODEL=qwen3.5:9b
volumes: volumes:
- ./ai_answers.py:/usr/local/searxng/searx/plugins/ai_answers.py - ./ollama_answers.py:/usr/local/searxng/searx/plugins/ollama_answers.py
ollama: ollama:
image: ollama/ollama image: ollama/ollama
@@ -96,9 +96,9 @@ environment:
- LLM_API_KEY=your-bearer-token - LLM_API_KEY=your-bearer-token
``` ```
## Development — Demo Server ## Development — Dev Server
A standalone Flask demo server is included in `tests/demo.py`. It mocks the SearXNG plugin environment so you can test the full UI without a running SearXNG instance. A standalone Flask dev server is included in `tests/dev.py`. It mocks the SearXNG plugin environment so you can test the full UI without a running SearXNG instance.
### Setup ### Setup
@@ -109,7 +109,7 @@ pip install flask flask-babel certifi
### Run ### Run
```bash ```bash
python tests/demo.py python tests/dev.py
``` ```
Then open [http://127.0.0.1:5000/](http://127.0.0.1:5000/) in your browser. Then open [http://127.0.0.1:5000/](http://127.0.0.1:5000/) in your browser.
@@ -122,14 +122,14 @@ Then open [http://127.0.0.1:5000/](http://127.0.0.1:5000/) in your browser.
- Expand **Ollama Configuration** at the top to change the endpoint URL or Bearer token for the current session. Click **Apply** to save and re-run the current query. - Expand **Ollama Configuration** at the top to change the endpoint URL or Bearer token for the current session. Click **Apply** to save and re-run the current query.
- The model selector in the AI overview widget (loaded from `/ai-models`) shows all models available on the configured Ollama server and persists your choice in the session URL. - The model selector in the AI overview widget (loaded from `/ai-models`) shows all models available on the configured Ollama server and persists your choice in the session URL.
### Environment Variables (demo) ### Environment Variables (dev)
The demo reads the same variables as the plugin: The dev reads the same variables as the plugin:
```bash ```bash
LLM_URL=http://localhost:11434/v1/chat/completions \ LLM_URL=http://localhost:11434/v1/chat/completions \
LLM_MODEL=qwen3.5:9b \ LLM_MODEL=qwen3.5:9b \
python tests/demo.py python tests/dev.py
``` ```
Or export them before running. Any values set in the config panel at runtime take priority for that session. Or export them before running. Any values set in the config panel at runtime take priority for that session.