chat-console 0.1.6.dev1__py3-none-any.whl → 0.1.81.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app/main.py +7 -3
- app/ui/chat_interface.py +64 -14
- {chat_console-0.1.6.dev1.dist-info → chat_console-0.1.81.dev1.dist-info}/METADATA +1 -1
- {chat_console-0.1.6.dev1.dist-info → chat_console-0.1.81.dev1.dist-info}/RECORD +8 -8
- {chat_console-0.1.6.dev1.dist-info → chat_console-0.1.81.dev1.dist-info}/WHEEL +1 -1
- {chat_console-0.1.6.dev1.dist-info → chat_console-0.1.81.dev1.dist-info}/LICENSE +0 -0
- {chat_console-0.1.6.dev1.dist-info → chat_console-0.1.81.dev1.dist-info}/entry_points.txt +0 -0
- {chat_console-0.1.6.dev1.dist-info → chat_console-0.1.81.dev1.dist-info}/top_level.txt +0 -0
app/main.py
CHANGED
@@ -262,12 +262,14 @@ class SimpleChatApp(App):
|
|
262
262
|
width: auto;
|
263
263
|
min-width: 8;
|
264
264
|
height: 2;
|
265
|
-
color:
|
265
|
+
color: #FFFFFF !important;
|
266
266
|
background: $primary;
|
267
267
|
border: solid $primary;
|
268
268
|
content-align: center middle;
|
269
|
+
text-style: bold; /* Add this line */
|
269
270
|
}
|
270
271
|
|
272
|
+
|
271
273
|
#button-row {
|
272
274
|
width: 100%;
|
273
275
|
height: auto;
|
@@ -278,21 +280,23 @@ class SimpleChatApp(App):
|
|
278
280
|
width: auto;
|
279
281
|
min-width: 8;
|
280
282
|
height: 2;
|
281
|
-
color:
|
283
|
+
color: #FFFFFF !important; /* Force white text */
|
282
284
|
background: $success;
|
283
285
|
border: solid $success-lighten-1;
|
284
286
|
content-align: center middle;
|
287
|
+
text-style: bold;
|
285
288
|
}
|
286
289
|
|
287
290
|
#view-history-button, #settings-button {
|
288
291
|
width: auto;
|
289
292
|
min-width: 8;
|
290
293
|
height: 2;
|
291
|
-
color:
|
294
|
+
color: #FFFFFF !important; /* Force white text */
|
292
295
|
background: $primary-darken-1;
|
293
296
|
border: solid $primary;
|
294
297
|
margin-right: 1;
|
295
298
|
content-align: center middle;
|
299
|
+
text-style: bold;
|
296
300
|
}
|
297
301
|
"""
|
298
302
|
|
app/ui/chat_interface.py
CHANGED
@@ -12,7 +12,9 @@ from textual.widgets import Button, Input, Label, Static
|
|
12
12
|
from textual.widget import Widget
|
13
13
|
from textual.widgets import RichLog
|
14
14
|
from textual.message import Message
|
15
|
+
from textual.binding import Binding
|
15
16
|
|
17
|
+
from .. import __version__
|
16
18
|
from ..models import Message, Conversation
|
17
19
|
from ..api.base import BaseModelClient
|
18
20
|
from ..config import CONFIG
|
@@ -20,6 +22,56 @@ from ..config import CONFIG
|
|
20
22
|
# Set up logging
|
21
23
|
logger = logging.getLogger(__name__)
|
22
24
|
|
25
|
+
class SendButton(Button):
|
26
|
+
"""Custom send button implementation"""
|
27
|
+
|
28
|
+
DEFAULT_CSS = """
|
29
|
+
SendButton {
|
30
|
+
width: auto;
|
31
|
+
min-width: 20;
|
32
|
+
height: 4;
|
33
|
+
margin: 0 1;
|
34
|
+
content-align: center middle;
|
35
|
+
text-style: bold;
|
36
|
+
border: none;
|
37
|
+
background: $success;
|
38
|
+
color: white;
|
39
|
+
padding: 0 2;
|
40
|
+
text-opacity: 100%;
|
41
|
+
}
|
42
|
+
|
43
|
+
SendButton:hover {
|
44
|
+
background: $success-lighten-1;
|
45
|
+
text-style: bold reverse;
|
46
|
+
}
|
47
|
+
|
48
|
+
SendButton:focus {
|
49
|
+
background: $success-darken-1;
|
50
|
+
text-style: bold reverse;
|
51
|
+
}
|
52
|
+
|
53
|
+
SendButton > .label {
|
54
|
+
text-opacity: 100%;
|
55
|
+
color: white;
|
56
|
+
text-style: bold;
|
57
|
+
text-align: center;
|
58
|
+
width: 100%;
|
59
|
+
font-size: 200%;
|
60
|
+
}
|
61
|
+
"""
|
62
|
+
|
63
|
+
def __init__(self, name: Optional[str] = None):
|
64
|
+
super().__init__(
|
65
|
+
"⬆ SEND ⬆",
|
66
|
+
name=name,
|
67
|
+
variant="success"
|
68
|
+
)
|
69
|
+
|
70
|
+
def on_mount(self) -> None:
|
71
|
+
"""Handle mount event"""
|
72
|
+
self.styles.text_opacity = 100
|
73
|
+
self.styles.text_style = "bold"
|
74
|
+
|
23
75
|
class MessageDisplay(RichLog):
|
24
76
|
"""Widget to display a single message"""
|
25
77
|
|
@@ -150,10 +202,14 @@ class ChatInterface(Container):
|
|
150
202
|
border: solid $primary;
|
151
203
|
}
|
152
204
|
|
153
|
-
#
|
154
|
-
width:
|
155
|
-
|
156
|
-
|
205
|
+
#version-label {
|
206
|
+
width: 100%;
|
207
|
+
height: 1;
|
208
|
+
background: $warning;
|
209
|
+
color: black;
|
210
|
+
text-align: right;
|
211
|
+
padding: 0 1;
|
212
|
+
text-style: bold;
|
157
213
|
}
|
158
214
|
|
159
215
|
#loading-indicator {
|
@@ -192,23 +248,18 @@ class ChatInterface(Container):
|
|
192
248
|
self.messages = conversation.messages
|
193
249
|
|
194
250
|
def compose(self) -> ComposeResult:
|
195
|
-
"
|
196
|
-
# Messages area
|
251
|
+
yield Label(f"Chat CLI v{__version__}", id="version-label")
|
197
252
|
with ScrollableContainer(id="messages-container"):
|
198
253
|
for message in self.messages:
|
199
254
|
yield MessageDisplay(message, highlight_code=CONFIG["highlight_code"])
|
200
|
-
|
201
|
-
# Input area with loading indicator and controls
|
202
255
|
with Container(id="input-area"):
|
203
256
|
yield Container(
|
204
257
|
Label("Generating response...", id="loading-text"),
|
205
258
|
id="loading-indicator"
|
206
259
|
)
|
207
|
-
|
208
|
-
InputWithFocus(placeholder="Type your message here...", id="message-input")
|
209
|
-
|
210
|
-
id="controls"
|
211
|
-
)
|
260
|
+
with Container(id="controls"):
|
261
|
+
yield InputWithFocus(placeholder="Type your message here...", id="message-input")
|
262
|
+
yield SendButton(id="send-button")
|
212
263
|
|
213
264
|
def on_mount(self) -> None:
|
214
265
|
"""Initialize on mount"""
|
@@ -229,7 +280,6 @@ class ChatInterface(Container):
|
|
229
280
|
async def on_button_pressed(self, event: Button.Pressed) -> None:
|
230
281
|
"""Handle button presses"""
|
231
282
|
button_id = event.button.id
|
232
|
-
|
233
283
|
if button_id == "send-button":
|
234
284
|
await self.send_message()
|
235
285
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: chat-console
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.81.dev1
|
4
4
|
Summary: A command-line interface for chatting with LLMs, storing chats and (future) rag interactions
|
5
5
|
Home-page: https://github.com/wazacraftrfid/chat-console
|
6
6
|
Author: Johnathan Greenaway
|
@@ -1,7 +1,7 @@
|
|
1
1
|
app/__init__.py,sha256=u5X4kPcpqZ12ZLnhwwOCScNvftaknDTrb0DMXqR_iLc,130
|
2
2
|
app/config.py,sha256=7C09kn2bmda9frTPfZ7f1JhagqHAZjGM5BYqZmhegYM,5190
|
3
3
|
app/database.py,sha256=nt8CVuDpy6zw8mOYqDcfUmNw611t7Ln7pz22M0b6-MI,9967
|
4
|
-
app/main.py,sha256=
|
4
|
+
app/main.py,sha256=zhseBNDgQhKTKbyiJn9eUyUuS4Y7OCqlZGYfpU2iE3A,24366
|
5
5
|
app/models.py,sha256=4-y9Lytay2exWPFi0FDlVeRL3K2-I7E-jBqNzTfokqY,2644
|
6
6
|
app/utils.py,sha256=zK8aTPdadXomyG2Kgpi7WuC5XYwfShJj74bXWSLtyW0,4309
|
7
7
|
app/api/__init__.py,sha256=A8UL84ldYlv8l7O-yKzraVFcfww86SgWfpl4p7R03-w,62
|
@@ -10,14 +10,14 @@ app/api/base.py,sha256=-6RSxSpqe-OMwkaq1wVWbu3pVkte-ZYy8rmdvt-Qh48,3953
|
|
10
10
|
app/api/ollama.py,sha256=zFZ3g2sYncvMgcvx92jTCLkigIaDvTuhILcLiCrwisc,11640
|
11
11
|
app/api/openai.py,sha256=1fYgFXXL6yj_7lQ893Yj28RYG4M8d6gt_q1gzhhjcig,3641
|
12
12
|
app/ui/__init__.py,sha256=RndfbQ1Tv47qdSiuQzvWP96lPS547SDaGE-BgOtiP_w,55
|
13
|
-
app/ui/chat_interface.py,sha256=
|
13
|
+
app/ui/chat_interface.py,sha256=2Vtw7yx6BcTQF6KCZQzci6fDA5nTH91QBaOI1N_3liE,13303
|
14
14
|
app/ui/chat_list.py,sha256=WQTYVNSSXlx_gQal3YqILZZKL9UiTjmNMIDX2I9pAMM,11205
|
15
15
|
app/ui/model_selector.py,sha256=xCuaohgYvebgP0Eel6-XzUn-7Y0SrJUArdTr-CDBZXc,12840
|
16
16
|
app/ui/search.py,sha256=b-m14kG3ovqW1-i0qDQ8KnAqFJbi5b1FLM9dOnbTyIs,9763
|
17
17
|
app/ui/styles.py,sha256=04AhPuLrOd2yenfRySFRestPeuTPeMLzhmMB67NdGvw,5615
|
18
|
-
chat_console-0.1.
|
19
|
-
chat_console-0.1.
|
20
|
-
chat_console-0.1.
|
21
|
-
chat_console-0.1.
|
22
|
-
chat_console-0.1.
|
23
|
-
chat_console-0.1.
|
18
|
+
chat_console-0.1.81.dev1.dist-info/LICENSE,sha256=srHZ3fvcAuZY1LHxE7P6XWju2njRCHyK6h_ftEbzxSE,1057
|
19
|
+
chat_console-0.1.81.dev1.dist-info/METADATA,sha256=IP3NA1CJ-z7EIU71TwL6dLau4YBS1F92FwPltD_KkJo,2905
|
20
|
+
chat_console-0.1.81.dev1.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
21
|
+
chat_console-0.1.81.dev1.dist-info/entry_points.txt,sha256=kkVdEc22U9PAi2AeruoKklfkng_a_aHAP6VRVwrAD7c,67
|
22
|
+
chat_console-0.1.81.dev1.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
|
23
|
+
chat_console-0.1.81.dev1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|