chat-console 0.1.7.dev1__tar.gz → 0.1.9.dev1__tar.gz

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.
Files changed (28) hide show
  1. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/PKG-INFO +3 -2
  2. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/__init__.py +1 -1
  3. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/main.py +20 -45
  4. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/ui/chat_interface.py +41 -15
  5. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/PKG-INFO +3 -2
  6. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/setup.py +1 -1
  7. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/LICENSE +0 -0
  8. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/README.md +0 -0
  9. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/api/__init__.py +0 -0
  10. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/api/anthropic.py +0 -0
  11. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/api/base.py +0 -0
  12. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/api/ollama.py +0 -0
  13. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/api/openai.py +0 -0
  14. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/config.py +0 -0
  15. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/database.py +0 -0
  16. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/models.py +0 -0
  17. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/ui/__init__.py +0 -0
  18. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/ui/chat_list.py +0 -0
  19. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/ui/model_selector.py +0 -0
  20. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/ui/search.py +0 -0
  21. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/ui/styles.py +0 -0
  22. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/app/utils.py +0 -0
  23. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/SOURCES.txt +0 -0
  24. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/dependency_links.txt +0 -0
  25. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/entry_points.txt +0 -0
  26. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/requires.txt +0 -0
  27. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/top_level.txt +0 -0
  28. {chat_console-0.1.7.dev1 → chat_console-0.1.9.dev1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: chat-console
3
- Version: 0.1.7.dev1
3
+ Version: 0.1.9.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
@@ -23,6 +23,7 @@ Dynamic: classifier
23
23
  Dynamic: description
24
24
  Dynamic: description-content-type
25
25
  Dynamic: home-page
26
+ Dynamic: license-file
26
27
  Dynamic: requires-dist
27
28
  Dynamic: requires-python
28
29
  Dynamic: summary
@@ -3,4 +3,4 @@ Chat CLI
3
3
  A command-line interface for chatting with various LLM providers like ChatGPT and Claude.
4
4
  """
5
5
 
6
- __version__ = "1.0.0"
6
+ __version__ = "0.1.85"
@@ -258,46 +258,9 @@ class SimpleChatApp(App):
258
258
  border: solid $primary;
259
259
  }
260
260
 
261
- #send-button {
262
- width: auto;
263
- min-width: 8;
264
- height: 2;
265
- color: #FFFFFF !important;
266
- background: $primary;
267
- border: solid $primary;
268
- content-align: center middle;
269
- text-style: bold; /* Add this line */
270
- }
271
-
272
-
273
- #button-row {
274
- width: 100%;
275
- height: auto;
276
- align-horizontal: right;
277
- }
278
-
279
- #new-chat-button {
280
- width: auto;
281
- min-width: 8;
282
- height: 2;
283
- color: #FFFFFF !important; /* Force white text */
284
- background: $success;
285
- border: solid $success-lighten-1;
286
- content-align: center middle;
287
- text-style: bold;
288
- }
261
+ /* Removed CSS for #send-button, #new-chat-button, #view-history-button, #settings-button */
262
+ /* Removed CSS for #button-row */
289
263
 
290
- #view-history-button, #settings-button {
291
- width: auto;
292
- min-width: 8;
293
- height: 2;
294
- color: #FFFFFF !important; /* Force white text */
295
- background: $primary-darken-1;
296
- border: solid $primary;
297
- margin-right: 1;
298
- content-align: center middle;
299
- text-style: bold;
300
- }
301
264
  """
302
265
 
303
266
  BINDINGS = [
@@ -305,6 +268,8 @@ class SimpleChatApp(App):
305
268
  Binding("n", "action_new_conversation", "New Chat"),
306
269
  Binding("escape", "escape", "Cancel"),
307
270
  Binding("ctrl+c", "quit", "Quit"),
271
+ Binding("h", "view_history", "History", show=True, key_display="h"),
272
+ Binding("s", "settings", "Settings", show=True, key_display="s"),
308
273
  ]
309
274
 
310
275
  current_conversation = reactive(None)
@@ -337,11 +302,7 @@ class SimpleChatApp(App):
337
302
  # Input area
338
303
  with Container(id="input-area"):
339
304
  yield Input(placeholder="Type your message here...", id="message-input")
340
- yield Button("Send", id="send-button", variant="primary")
341
- with Horizontal(id="button-row"):
342
- yield Button("Settings", id="settings-button", variant="primary")
343
- yield Button("View History", id="view-history-button", variant="primary")
344
- yield Button("+ New Chat", id="new-chat-button")
305
+ # Removed Static widgets previously used for diagnosis
345
306
 
346
307
  yield Footer()
347
308
 
@@ -621,7 +582,7 @@ class SimpleChatApp(App):
621
582
  def on_style_selector_style_selected(self, event: StyleSelector.StyleSelected) -> None:
622
583
  """Handle style selection"""
623
584
  self.selected_style = event.style_id
624
-
585
+
625
586
  async def on_button_pressed(self, event: Button.Pressed) -> None:
626
587
  """Handle button presses."""
627
588
  button_id = event.button.id
@@ -670,6 +631,20 @@ class SimpleChatApp(App):
670
631
 
671
632
  self.push_screen(HistoryScreen(conversations, handle_selection))
672
633
 
634
+ async def action_view_history(self) -> None:
635
+ """Action to view chat history via key binding."""
636
+ # Only trigger if message input is not focused
637
+ input_widget = self.query_one("#message-input", Input)
638
+ if not input_widget.has_focus:
639
+ await self.view_chat_history()
640
+
641
+ def action_settings(self) -> None:
642
+ """Action to open settings via key binding."""
643
+ # Only trigger if message input is not focused
644
+ input_widget = self.query_one("#message-input", Input)
645
+ if not input_widget.has_focus:
646
+ self.push_screen(SettingsScreen())
647
+
673
648
  def main(initial_text: Optional[str] = typer.Argument(None, help="Initial text to start the chat with")):
674
649
  """Entry point for the chat-cli application"""
675
650
  # When no argument is provided, typer passes the ArgumentInfo object
@@ -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,37 @@ 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
+ /* Drastically simplified SendButton CSS */
30
+ SendButton {
31
+ color: white; /* Basic text color */
32
+ /* Removed most properties */
33
+ margin: 0 1; /* Keep margin for spacing */
34
+ }
35
+
36
+ SendButton > .button--label {
37
+ color: white; /* Basic label color */
38
+ width: auto; /* Ensure label width isn't constrained */
39
+ height: auto; /* Ensure label height isn't constrained */
40
+ /* Removed most properties */
41
+ }
42
+ """
43
+
44
+ def __init__(self, name: Optional[str] = None):
45
+ super().__init__(
46
+ "⬆ SEND ⬆",
47
+ name=name,
48
+ variant="success"
49
+ )
50
+
51
+ def on_mount(self) -> None:
52
+ """Handle mount event"""
53
+ self.styles.text_opacity = 100
54
+ self.styles.text_style = "bold"
55
+
23
56
  class MessageDisplay(RichLog):
24
57
  """Widget to display a single message"""
25
58
 
@@ -150,20 +183,14 @@ class ChatInterface(Container):
150
183
  border: solid $primary;
151
184
  }
152
185
 
153
- #send-button {
186
+ #version-label {
187
+ width: 100%;
188
+ height: 1;
154
189
  background: $warning;
155
- color: $text;
156
- border: none;
157
- min-width: 8;
158
- height: 3;
159
- margin: 0 1;
160
- content-align: center middle;
190
+ color: black;
191
+ text-align: right;
192
+ padding: 0 1;
161
193
  text-style: bold;
162
- text-opacity: 100%;
163
- }
164
-
165
- #send-button:hover {
166
- background: $warning-lighten-1;
167
194
  }
168
195
 
169
196
  #loading-indicator {
@@ -202,6 +229,7 @@ class ChatInterface(Container):
202
229
  self.messages = conversation.messages
203
230
 
204
231
  def compose(self) -> ComposeResult:
232
+ yield Label(f"Chat CLI v{__version__}", id="version-label")
205
233
  with ScrollableContainer(id="messages-container"):
206
234
  for message in self.messages:
207
235
  yield MessageDisplay(message, highlight_code=CONFIG["highlight_code"])
@@ -212,9 +240,7 @@ class ChatInterface(Container):
212
240
  )
213
241
  with Container(id="controls"):
214
242
  yield InputWithFocus(placeholder="Type your message here...", id="message-input")
215
- yield Button("[on yellow black]SEND[/]", id="send-button", markup=True)
216
-
217
-
243
+ yield SendButton(id="send-button")
218
244
 
219
245
  def on_mount(self) -> None:
220
246
  """Initialize on mount"""
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: chat-console
3
- Version: 0.1.7.dev1
3
+ Version: 0.1.9.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
@@ -23,6 +23,7 @@ Dynamic: classifier
23
23
  Dynamic: description
24
24
  Dynamic: description-content-type
25
25
  Dynamic: home-page
26
+ Dynamic: license-file
26
27
  Dynamic: requires-dist
27
28
  Dynamic: requires-python
28
29
  Dynamic: summary
@@ -14,7 +14,7 @@ with open(os.path.join("app", "__init__.py"), "r", encoding="utf-8") as f:
14
14
 
15
15
  setup(
16
16
  name="chat-console",
17
- version="0.1.7.dev1",
17
+ version="0.1.9.dev1",
18
18
  author="Johnathan Greenaway",
19
19
  author_email="john@fimbriata.dev",
20
20
  description="A command-line interface for chatting with LLMs, storing chats and (future) rag interactions",