Remove Latex
This commit is contained in:
parent
8209136bed
commit
adfb780f7c
110
README.md
110
README.md
@ -71,52 +71,133 @@ AISE_AIAgent/
|
||||
|
||||
## Schnellstart
|
||||
|
||||
### 1. Repository klonen
|
||||
> Die folgenden Schritte funktionieren auf **Windows** und **macOS** — abweichende Befehle sind jeweils mit dem Betriebssystem gekennzeichnet.
|
||||
|
||||
---
|
||||
|
||||
### Schritt 1 — Voraussetzungen prüfen
|
||||
|
||||
**Python 3.10 oder neuer** muss installiert sein.
|
||||
|
||||
```bash
|
||||
# Windows (PowerShell)
|
||||
python --version
|
||||
|
||||
# macOS (Terminal)
|
||||
python3 --version
|
||||
```
|
||||
|
||||
Falls Python nicht installiert ist:
|
||||
- **Windows:** [python.org/downloads](https://www.python.org/downloads/) herunterladen und installieren. Bei der Installation „Add Python to PATH" aktivieren.
|
||||
- **macOS:** [python.org/downloads](https://www.python.org/downloads/) herunterladen und installieren, **oder** via Homebrew: `brew install python3`
|
||||
|
||||
**Git** muss ebenfalls installiert sein:
|
||||
```bash
|
||||
git --version
|
||||
```
|
||||
Falls nicht vorhanden: [git-scm.com](https://git-scm.com/downloads) (Windows) bzw. `brew install git` (macOS).
|
||||
|
||||
---
|
||||
|
||||
### Schritt 2 — Repository klonen
|
||||
|
||||
```bash
|
||||
git clone https://gitea.fhgr.ch/meulilivio/AISE1_Project.git
|
||||
cd AISE1_Project
|
||||
```
|
||||
|
||||
### 2. Virtuelle Umgebung aktivieren
|
||||
---
|
||||
|
||||
### Schritt 3 — Virtuelle Umgebung erstellen
|
||||
|
||||
Eine virtuelle Umgebung isoliert die Projekt-Abhängigkeiten vom restlichen System. Sie muss einmalig erstellt werden.
|
||||
|
||||
```bash
|
||||
# Windows
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
# Windows (PowerShell)
|
||||
python -m venv .venv
|
||||
|
||||
# macOS / Linux
|
||||
# macOS (Terminal)
|
||||
python3 -m venv .venv
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Schritt 4 — Virtuelle Umgebung aktivieren
|
||||
|
||||
Die Umgebung muss **jedes Mal neu aktiviert** werden, wenn ein neues Terminal geöffnet wird.
|
||||
|
||||
```bash
|
||||
# Windows (PowerShell)
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
```
|
||||
|
||||
> Falls PowerShell die Ausführung blockiert, einmalig folgenden Befehl ausführen und danach erneut versuchen:
|
||||
> ```powershell
|
||||
> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
||||
> ```
|
||||
|
||||
```bash
|
||||
# macOS (Terminal)
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
### 3. Abhängigkeiten installieren
|
||||
Nach erfolgreicher Aktivierung erscheint `(.venv)` am Anfang der Eingabezeile.
|
||||
|
||||
---
|
||||
|
||||
### Schritt 5 — Abhängigkeiten installieren
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### 4. Umgebungsvariablen konfigurieren
|
||||
Dieser Schritt lädt alle benötigten Pakete herunter (~2–5 Minuten je nach Internetverbindung). Er muss nur einmal ausgeführt werden.
|
||||
|
||||
---
|
||||
|
||||
### Schritt 6 — Umgebungsvariablen konfigurieren
|
||||
|
||||
```bash
|
||||
# Windows (PowerShell)
|
||||
copy .env.example .env
|
||||
|
||||
# macOS (Terminal)
|
||||
cp .env.example .env
|
||||
# .env öffnen und HOST, PORT, API_KEY, MODEL eintragen
|
||||
```
|
||||
|
||||
### 5. App starten
|
||||
Danach die Datei `.env` in einem Texteditor öffnen und die Werte eintragen:
|
||||
|
||||
```
|
||||
HOST=silicon.fhgr.ch
|
||||
PORT=7080
|
||||
API_KEY=EMPTY
|
||||
MODEL=qwen3.5-35b-a3b
|
||||
```
|
||||
|
||||
> Die Standardwerte im `.env.example` sind bereits für den FHGR Silicon-Server vorkonfiguriert — falls dieser verwendet wird, müssen nur `API_KEY` und `MODEL` ggf. angepasst werden.
|
||||
|
||||
---
|
||||
|
||||
### Schritt 7 — App starten
|
||||
|
||||
```bash
|
||||
# Windows & macOS
|
||||
streamlit run frontend/app.py
|
||||
```
|
||||
|
||||
### 6. Tests ausführen
|
||||
Streamlit öffnet die App automatisch im Standard-Browser unter `http://localhost:8501`.
|
||||
Falls der Browser nicht automatisch aufgeht, die URL manuell eingeben.
|
||||
|
||||
Zum **Beenden** der App im Terminal `Ctrl + C` drücken.
|
||||
|
||||
---
|
||||
|
||||
### Schritt 8 — Tests ausführen (optional)
|
||||
|
||||
```bash
|
||||
pytest tests/ -v
|
||||
```
|
||||
|
||||
**Optionale Abhängigkeit:** Die LaTeX-Unterstützung (`.tex`-Ausführung) erfordert `pdflatex`
|
||||
im System-`PATH`. Ohne `pdflatex` funktioniert der Editor weiterhin; beim Ausführen einer
|
||||
`.tex`-Datei erscheint ein `FileNotFoundError` im stderr-Panel.
|
||||
|
||||
---
|
||||
|
||||
## Frontend
|
||||
@ -246,7 +327,6 @@ Funktion oder Klasse zurückzugeben, nach der der Benutzer fragt, anstatt die ge
|
||||
Führt Dateien in einem Subprocess mit `capture_output=True`, `text=True` und einem
|
||||
`RUN_TIMEOUT` von 30 Sekunden aus. Aktuell unterstützt:
|
||||
- `.py` — via `sys.executable` (plattformübergreifend; zeigt auf den aktuell aktiven Python-Interpreter)
|
||||
- `.tex` — via `pdflatex -interaction=nonstopmode` (erfordert pdflatex im PATH)
|
||||
|
||||
Rückgabe: `{"stdout": str, "stderr": str, "rc": int}`.
|
||||
|
||||
|
||||
@ -42,14 +42,6 @@ class ExecutionEngine:
|
||||
# Build the shell command depending on file type
|
||||
if suffix == ".py":
|
||||
cmd = [sys.executable, active_file.name]
|
||||
elif suffix == ".tex":
|
||||
# pdflatex in non-interactive mode so it never waits for input
|
||||
cmd = [
|
||||
"pdflatex",
|
||||
"-interaction=nonstopmode",
|
||||
f"-output-directory={current_dir}",
|
||||
active_file.name,
|
||||
]
|
||||
else:
|
||||
return {"stdout": "", "stderr": f"Unsupported file type: {suffix}", "rc": 1}
|
||||
|
||||
|
||||
@ -495,14 +495,6 @@ def render_normal_chat():
|
||||
|
||||
default_model = chat_manager.model or ""
|
||||
model_options = [default_model] if default_model else []
|
||||
for m in [
|
||||
"claude-3-5-sonnet-20241022",
|
||||
"claude-3-haiku-20240307",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
]:
|
||||
if m not in model_options:
|
||||
model_options.append(m)
|
||||
st.selectbox("Model", model_options, key="selected_model")
|
||||
|
||||
st.slider(
|
||||
|
||||
@ -13,7 +13,7 @@ logger = get_logger(__name__)
|
||||
|
||||
# Maps file extensions to Ace editor language modes for syntax highlighting.
|
||||
LANG_MAP = {
|
||||
".py": "python", ".tex": "latex", ".js": "javascript",
|
||||
".py": "python", ".js": "javascript",
|
||||
".html": "html", ".css": "css", ".sh": "bash",
|
||||
".json": "json", ".yaml": "yaml", ".yml": "yaml"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user