Skip to content

Commit d7f538c

Browse files
add some things
1 parent c77776d commit d7f538c

2 files changed

Lines changed: 27 additions & 33 deletions

File tree

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ gr.ChatInterface(
4848
).launch()
4949
```
5050

51+
---
52+
53+
## Use the commands :
54+
55+
- `taranis help` : in the name...
56+
- `taranis update` : upgrade the framework
57+
- `taranis open` : open the TUI
58+
59+
### The TUI :
60+
![TUI](images/TUI.png)
61+
62+
- `/help` to start
63+
5164
## Documentation :
5265

5366
- [Base of the docs](https://zanomega.com/open-taranis/) (coding some things before the real docs)
@@ -58,11 +71,7 @@ gr.ChatInterface(
5871
- [X] v0.0.x: Add and confirm other API providers (in the cloud, not locally)
5972
- [X] v0.1.x: Functionality verifications in [examples](https://github.com/SyntaxError4Life/open-taranis/blob/main/examples/)
6073
- [ ] > v0.2.0: Add features for **logic-only coding** approach
61-
- [ ] v0.6.x: Add llama.cpp as backend in addition to APIs
62-
- [ ] v0.7.x: Add reverse proxy + server to create a dedicated full relay/backend (like OpenRouter), framework usable as server and client
63-
- [ ] v0.8.x: Add PyTorch as backend with `transformers` to deploy a remote server
64-
- [ ] v0.9.x: Total reduction of dependencies for built-in functions (unless counter-optimizations)
65-
- [ ] v1.0.0: First complete version in Python without dependencies
74+
- The rest will follow soon.
6675

6776
## Changelog
6877

@@ -73,6 +82,7 @@ gr.ChatInterface(
7382
- **v0.1.2** : Fixed a display bug in the **web_front** and experimentally added **ollama as a backend**
7483
- **v0.1.3** : Fixed the memory reset in the **web_front** and remove **ollama module** for **openai front** (work 100 times better)
7584
- **v0.1.4** : Fixed `web_front` for native use on huggingface, as well as `handle_streaming` which had tool retrieval issues
85+
- **v0.1.5** : Added a **TUI** and **commands**, detection of **env variables** (API keys) and tools in the framework
7686

7787
## Advanced Examples
7888

src/open_taranis/CLI.py

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,26 @@
1818
████ █████ ████ ██ ███ ███ ████ ██ ██ █████ ███████████ █
1919
████ █████ ████ ██ ████ ██ ████ ██ ███ ██ ███ ██"""
2020

21-
# Contraintes minimales
21+
2222
MIN_HEIGHT = 24
2323
MIN_WIDTH = 80
2424

2525
def run(stdscr):
26-
# Configuration basique de curses
27-
curses.curs_set(1) # Curseur visible
26+
curses.curs_set(1)
2827
curses.start_color()
2928
curses.use_default_colors()
3029

31-
# Initialisation des paires de couleurs
32-
curses.init_pair(1, curses.COLOR_RED, -1) # Pour le logo
33-
curses.init_pair(2, curses.COLOR_WHITE, -1) # Pour le texte standard
34-
curses.init_pair(3, curses.COLOR_YELLOW, -1)# Pour les erreurs
30+
curses.init_pair(1, curses.COLOR_RED, -1)
31+
curses.init_pair(2, curses.COLOR_WHITE, -1)
32+
curses.init_pair(3, curses.COLOR_YELLOW, -1)
3533

3634
input_buffer = ""
37-
display_mode = "NONE" # États possibles : "NONE", "HELP", "API", etc.
35+
display_mode = "NONE"
36+
text = []
3837

3938
while True:
40-
# Récupération dynamique des dimensions du terminal
4139
height, width = stdscr.getmaxyx()
4240

43-
# Vérification des contraintes minimales
4441
if height < MIN_HEIGHT or width < MIN_WIDTH:
4542
stdscr.clear()
4643
msg = f"Terminal too small: {width}x{height} (min {MIN_WIDTH}x{MIN_HEIGHT})"
@@ -55,12 +52,7 @@ def run(stdscr):
5552
break
5653
continue
5754

58-
# Nettoyage de l'écran pour le rafraîchissement
5955
stdscr.clear()
60-
61-
# --- Calcul dynamique du Layout ---
62-
63-
# 1. Traitement du Logo (Haut Gauche)
6456
logo_lines = LOGO_ASCII.split('\n')
6557
logo_height = len(logo_lines)
6658

@@ -72,11 +64,9 @@ def run(stdscr):
7264
except curses.error:
7365
pass
7466

75-
# 2. Zone de Contenu (Centre)
7667
content_start = logo_height + 1
7768
content_end = height - 3
7869

79-
# --- Affichage du contenu central selon le mode ---
8070
if display_mode == "HELP":
8171
text = [
8272
"Commands :",
@@ -100,7 +90,7 @@ def run(stdscr):
10090

10191
elif display_mode == 'MORE_API':
10292
text = [
103-
"APIs registered :",
93+
"APIs and env_var",
10494
"- openrouter = 'OPENROUTER_API'",
10595
"- huggingface = 'HF_API'",
10696
"- venice.ai = 'VENICEAI_API'",
@@ -119,8 +109,6 @@ def run(stdscr):
119109
pass
120110
current_line += 1
121111

122-
123-
# 3. Footer / Invite de commande (Bas)
124112
sep_y = height - 2
125113
input_y = height - 1
126114

@@ -141,13 +129,12 @@ def run(stdscr):
141129

142130
stdscr.refresh()
143131

144-
# --- Gestion des entrées clavier ---
145132
key = stdscr.getch()
146133

147134
if key == curses.KEY_RESIZE:
148135
continue
149136

150-
elif key in (10, 13): # Entrée
137+
elif key in (10, 13):
151138
command = input_buffer.strip()
152139

153140
if command == "/exit":
@@ -163,18 +150,17 @@ def run(stdscr):
163150
display_mode = 'MORE_API'
164151

165152
else:
166-
# Commande invalide ou vide : on efface l'affichage central
167153
display_mode = None
168154

169155
input_buffer = ""
170156

171-
elif key in (127, curses.KEY_BACKSPACE, ord('\b')): # Backspace
157+
elif key in (127, curses.KEY_BACKSPACE, ord('\b')):
172158
input_buffer = input_buffer[:-1]
173159

174-
elif key == 27: # Échap
160+
elif key == 27:
175161
input_buffer = ""
176162

177-
elif 32 <= key <= 126: # Caractères imprimables ASCII
163+
elif 32 <= key <= 126:
178164
input_buffer += chr(key)
179165

180166
# ==============================
@@ -193,13 +179,11 @@ def main():
193179
""")
194180

195181
elif argv[1] == "open":
196-
# Lancement de la boucle curses
197182
curses.wrapper(run)
198183

199184
elif argv[1] == "update":
200185
print("Updating open-taranis via pip...")
201186
try:
202-
# On lance pip install -U sur le paquet actuel
203187
subprocess.check_call([sys.executable, "-m", "pip", "install", "-U", "open-taranis"])
204188
print("Update successful.")
205189
except subprocess.CalledProcessError as e:

0 commit comments

Comments
 (0)