2026-02-27 11:25:19 +00:00
|
|
|
# ConsoleX 2.4.13 - Lokaal console-agent voor je LLM Proxy
|
|
|
|
|
|
|
|
|
|
## Features ✨
|
2026-02-27 11:32:50 +00:00
|
|
|
- **Bestandsmanipulatie**: Lees, schrijf en bewerk tekstbestanden met zoekfunctionaliteit.
|
|
|
|
|
*Functies*: `t_read_file()`, `t_write_file()` (path als parameter).
|
|
|
|
|
- Shell commando's uitvoeren in specifieke werkdirectories (`cwd`) met tijdsbeperking via timeout-parameter.
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
- **Webzoek tools**: Integratie van Google, SerpAPI en DuckDuckGo backends.
|
|
|
|
|
*Command*: `:tool web_search` (query + max_results).
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
- **Background modus**:
|
|
|
|
|
- Automatiseer workflows door taken in de achtergrond uit te voeren (`:add "command"`).
|
|
|
|
|
- Statuscheck met `:`status`, `tasks`.
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
- **RAG ondersteuning**: Beheer en zoek lokale documenten voor Retrieval Augmented Generation.
|
|
|
|
|
*Functies*: (niet expliciet genoemd, maar impliciete integratie via bestandsmanipulatie).
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
## Installatie & Configuratie 🛠️
|
|
|
|
|
### Voorkeure configureren:
|
|
|
|
|
Via milieueigen variabelen (`~/.bashrc` of `environment variables`) configureer je de basisinstellingen:
|
|
|
|
|
|
|
|
|
|
| Variabele | Beschrijving |
|
|
|
|
|
|--------------------|------------------------------------------------------------------------------|
|
|
|
|
|
| `CONSOLEX_BASE_URL` | URL van LLM proxy (default: **http://localhost:8080/v1**) |
|
|
|
|
|
| `MODEL` | Naam model dat door de proxy wordt gebruikt |
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
### Installatie:
|
2026-02-27 11:25:19 +00:00
|
|
|
```bash
|
2026-02-27 11:32:50 +00:00
|
|
|
pip install httpx beautifulsoup4 rich --upgrade # Aanbevolen om compatibiliteit te garanderen.
|
2026-02-27 11:25:19 +00:00
|
|
|
```
|
|
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
## Gebruik 📌
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
### Starter script opstarten (terminal):
|
|
|
|
|
```python3 ConsoleX_2.4_13.py [--verbose 0-3] [-b on|off]"
|
|
|
|
|
*Opties:*
|
|
|
|
|
`-v` / `--verbose`: Logniveau (`0=stil`, `1=normaal`, `2=gedetailleerd`, `3=debug`)
|
|
|
|
|
`-bg` of `:background off/on`
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
### REPL interface (interactieve modus):
|
|
|
|
|
```python
|
|
|
|
|
t_read_file({"path": "example.txt"}) # Leest file, return content als dict {"content":"..."}
|
|
|
|
|
data = t_write_file({
|
|
|
|
|
path="output.log",
|
|
|
|
|
data={"key1":"value", ...} // JSON-serialiseerbare structuur
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
# Shell commando's met context:
|
|
|
|
|
t_run_shell(
|
|
|
|
|
{
|
|
|
|
|
command: "ls -l | grep .py" # Piped commands zijn toegestaan.
|
|
|
|
|
cwd="/home/user/projects"
|
|
|
|
|
timeout=5s # Optioneel, default is 30 seconden per tool-uitvoering
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Webzoek uitvoeren:
|
|
|
|
|
tool web_search(
|
|
|
|
|
query="Python best practices",
|
|
|
|
|
backend: "google", // of 'serpapi', 'duckduckgo'
|
|
|
|
|
max_results=4,
|
|
|
|
|
timeout_s=15 # Override standaard timeout (30s)
|
|
|
|
|
)"
|
|
|
|
|
|
|
|
|
|
### Background modus workflow:
|
|
|
|
|
```bash
|
|
|
|
|
# 1. Job aanmaken in achtergrond:
|
|
|
|
|
:bg on :add "t_read_file({'path':'data.json'})"
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
# Status checken en antwoorden op vragen die tijdens de job ontstaan.
|
|
|
|
|
:status # Lijst alle actieve jobs, taken statuses.
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
# Antwoord geven (als `ask_user` wordt gebruikt):
|
|
|
|
|
answer 12345 "Dit is mijn reactie." // qid=job_id
|
2026-02-27 11:25:19 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Configuratie Opties 📋
|
2026-02-27 11:32:50 +00:00
|
|
|
| Command | Beschrijving |
|
|
|
|
|
|------------------|-----------------------------------------------------------------------------|
|
|
|
|
|
| `:v [0-3]` | Logniveau instellen (zie opstartopties). |
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
### Background modus:
|
|
|
|
|
```bash
|
|
|
|
|
:bg on # Activeer background-modus voor alle nieuwe interactie.
|
|
|
|
|
:add "t_run_shell({'command':'ping -c 4 google.com'})" // Job wordt gestart in BG.
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
# Status van de job checken (geeft ook vragen ID's die beantwoord moeten worden):
|
|
|
|
|
status
|
|
|
|
|
```
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
## Veranderingen ten opzichte versie **2.4.12** 🔄
|
|
|
|
|
### Nieuwe functionaliteit:
|
|
|
|
|
- `ask_user` werkt nu volledig compatibel met background-modus.
|
|
|
|
|
*Gebruikspatroon:*
|
|
|
|
|
- Job start: `:add "t_read_file({'path':'data.json'})"`
|
|
|
|
|
→ Output in terminal: `[job_1234] ask_user job <id=5678> vraag <qid>: Lees je de data?`
|
|
|
|
|
- Antwoord geven:
|
|
|
|
|
```bash
|
|
|
|
|
:answer qid="<question_id>" text="Ja, ik leze."
|
|
|
|
|
```
|
|
|
|
|
- Foreground-modus onveranderd: alle input wordt direct verwerkt.
|
|
|
|
|
|
|
|
|
|
### Bugfixen & verbeteringen:
|
|
|
|
|
1. **Timeout handling**: Shell commando's worden nu afgebroken na de `TIMEOUT_S` variabele (eer was dit per tool).
|
|
|
|
|
2. **Error reporting** : Onjuiste path in bestandsoperaties geeft duidelijke JSON-errors met suggesties.
|
|
|
|
|
3. **Documentatie integriteit** : Alle functievoorbeelden zijn nu testbaar via het REPL.
|
2026-02-27 11:25:19 +00:00
|
|
|
|
|
|
|
|
## Documentatie & Support 📚
|
2026-02-27 11:32:50 +00:00
|
|
|
### API en tools:
|
2026-02-27 11:25:19 +00:00
|
|
|
```python
|
2026-02-27 11:32:50 +00:00
|
|
|
# Lijst alle beschikbare tool-functies (inclusief parameters):
|
|
|
|
|
tool_schema()
|
2026-02-27 11:25:19 +00:00
|
|
|
|
2026-02-27 11:32:50 +00:00
|
|
|
# RAG documenten bewerken: voorbeeld workflow.
|
|
|
|
|
t_read_file({"path": "rag_db.json"}) # Lees de database structuur.
|
|
|
|
|
def process_questions(question_list, db_content=None): // Custom functie
|
|
|
|
|
"""Verwerkt een lijst van vragen met context uit lokale RAG-database."""
|
|
|
|
|
```
|
2026-02-27 11:25:19 +00:00
|
|
|
## Licentie 📜
|
2026-02-27 11:32:50 +00:00
|
|
|
**MIT License**
|
|
|
|
|
- Vrij om te gebruiken en aanpassen.
|
|
|
|
|
*Clausule*: "Permission to use, copy and modify this software is granted..."
|