chat-console 0.1.7.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/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,20 +202,14 @@ class ChatInterface(Container):
150
202
  border: solid $primary;
151
203
  }
152
204
 
153
- #send-button {
205
+ #version-label {
206
+ width: 100%;
207
+ height: 1;
154
208
  background: $warning;
155
- color: $text;
156
- border: none;
157
- min-width: 8;
158
- height: 3;
159
- margin: 0 1;
160
- content-align: center middle;
209
+ color: black;
210
+ text-align: right;
211
+ padding: 0 1;
161
212
  text-style: bold;
162
- text-opacity: 100%;
163
- }
164
-
165
- #send-button:hover {
166
- background: $warning-lighten-1;
167
213
  }
168
214
 
169
215
  #loading-indicator {
@@ -202,6 +248,7 @@ class ChatInterface(Container):
202
248
  self.messages = conversation.messages
203
249
 
204
250
  def compose(self) -> ComposeResult:
251
+ yield Label(f"Chat CLI v{__version__}", id="version-label")
205
252
  with ScrollableContainer(id="messages-container"):
206
253
  for message in self.messages:
207
254
  yield MessageDisplay(message, highlight_code=CONFIG["highlight_code"])
@@ -212,9 +259,7 @@ class ChatInterface(Container):
212
259
  )
213
260
  with Container(id="controls"):
214
261
  yield InputWithFocus(placeholder="Type your message here...", id="message-input")
215
- yield Button("[on yellow black]SEND[/]", id="send-button", markup=True)
216
-
217
-
262
+ yield SendButton(id="send-button")
218
263
 
219
264
  def on_mount(self) -> None:
220
265
  """Initialize on mount"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: chat-console
3
- Version: 0.1.7.dev1
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
@@ -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=KVnNLtXophoOh4pkCc8lAZKJG_zljbM79d8OT5eWgSs,12236
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.7.dev1.dist-info/LICENSE,sha256=srHZ3fvcAuZY1LHxE7P6XWju2njRCHyK6h_ftEbzxSE,1057
19
- chat_console-0.1.7.dev1.dist-info/METADATA,sha256=dxq5wCprEtW-Padybfsb343koM3Mh-RIsIkhnwuz7sw,2904
20
- chat_console-0.1.7.dev1.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
21
- chat_console-0.1.7.dev1.dist-info/entry_points.txt,sha256=kkVdEc22U9PAi2AeruoKklfkng_a_aHAP6VRVwrAD7c,67
22
- chat_console-0.1.7.dev1.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
23
- chat_console-0.1.7.dev1.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (76.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5