chat-console 0.1.6.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.6.dev1 → chat_console-0.1.9.dev1}/PKG-INFO +3 -2
  2. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/__init__.py +1 -1
  3. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/main.py +20 -41
  4. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/ui/chat_interface.py +45 -14
  5. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/PKG-INFO +3 -2
  6. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/setup.py +1 -1
  7. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/LICENSE +0 -0
  8. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/README.md +0 -0
  9. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/api/__init__.py +0 -0
  10. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/api/anthropic.py +0 -0
  11. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/api/base.py +0 -0
  12. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/api/ollama.py +0 -0
  13. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/api/openai.py +0 -0
  14. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/config.py +0 -0
  15. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/database.py +0 -0
  16. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/models.py +0 -0
  17. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/ui/__init__.py +0 -0
  18. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/ui/chat_list.py +0 -0
  19. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/ui/model_selector.py +0 -0
  20. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/ui/search.py +0 -0
  21. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/ui/styles.py +0 -0
  22. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/app/utils.py +0 -0
  23. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/SOURCES.txt +0 -0
  24. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/dependency_links.txt +0 -0
  25. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/entry_points.txt +0 -0
  26. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/requires.txt +0 -0
  27. {chat_console-0.1.6.dev1 → chat_console-0.1.9.dev1}/chat_console.egg-info/top_level.txt +0 -0
  28. {chat_console-0.1.6.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.6.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,42 +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: $text;
266
- background: $primary;
267
- border: solid $primary;
268
- content-align: center middle;
269
- }
270
-
271
- #button-row {
272
- width: 100%;
273
- height: auto;
274
- align-horizontal: right;
275
- }
276
-
277
- #new-chat-button {
278
- width: auto;
279
- min-width: 8;
280
- height: 2;
281
- color: $text;
282
- background: $success;
283
- border: solid $success-lighten-1;
284
- content-align: center middle;
285
- }
261
+ /* Removed CSS for #send-button, #new-chat-button, #view-history-button, #settings-button */
262
+ /* Removed CSS for #button-row */
286
263
 
287
- #view-history-button, #settings-button {
288
- width: auto;
289
- min-width: 8;
290
- height: 2;
291
- color: $text;
292
- background: $primary-darken-1;
293
- border: solid $primary;
294
- margin-right: 1;
295
- content-align: center middle;
296
- }
297
264
  """
298
265
 
299
266
  BINDINGS = [
@@ -301,6 +268,8 @@ class SimpleChatApp(App):
301
268
  Binding("n", "action_new_conversation", "New Chat"),
302
269
  Binding("escape", "escape", "Cancel"),
303
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"),
304
273
  ]
305
274
 
306
275
  current_conversation = reactive(None)
@@ -333,11 +302,7 @@ class SimpleChatApp(App):
333
302
  # Input area
334
303
  with Container(id="input-area"):
335
304
  yield Input(placeholder="Type your message here...", id="message-input")
336
- yield Button("Send", id="send-button", variant="primary")
337
- with Horizontal(id="button-row"):
338
- yield Button("Settings", id="settings-button", variant="primary")
339
- yield Button("View History", id="view-history-button", variant="primary")
340
- yield Button("+ New Chat", id="new-chat-button")
305
+ # Removed Static widgets previously used for diagnosis
341
306
 
342
307
  yield Footer()
343
308
 
@@ -617,7 +582,7 @@ class SimpleChatApp(App):
617
582
  def on_style_selector_style_selected(self, event: StyleSelector.StyleSelected) -> None:
618
583
  """Handle style selection"""
619
584
  self.selected_style = event.style_id
620
-
585
+
621
586
  async def on_button_pressed(self, event: Button.Pressed) -> None:
622
587
  """Handle button presses."""
623
588
  button_id = event.button.id
@@ -666,6 +631,20 @@ class SimpleChatApp(App):
666
631
 
667
632
  self.push_screen(HistoryScreen(conversations, handle_selection))
668
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
+
669
648
  def main(initial_text: Optional[str] = typer.Argument(None, help="Initial text to start the chat with")):
670
649
  """Entry point for the chat-cli application"""
671
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,10 +183,14 @@ class ChatInterface(Container):
150
183
  border: solid $primary;
151
184
  }
152
185
 
153
- #send-button {
154
- width: auto;
155
- min-width: 8;
156
- height: 2;
186
+ #version-label {
187
+ width: 100%;
188
+ height: 1;
189
+ background: $warning;
190
+ color: black;
191
+ text-align: right;
192
+ padding: 0 1;
193
+ text-style: bold;
157
194
  }
158
195
 
159
196
  #loading-indicator {
@@ -192,23 +229,18 @@ class ChatInterface(Container):
192
229
  self.messages = conversation.messages
193
230
 
194
231
  def compose(self) -> ComposeResult:
195
- """Compose the chat interface"""
196
- # Messages area
232
+ yield Label(f"Chat CLI v{__version__}", id="version-label")
197
233
  with ScrollableContainer(id="messages-container"):
198
234
  for message in self.messages:
199
235
  yield MessageDisplay(message, highlight_code=CONFIG["highlight_code"])
200
-
201
- # Input area with loading indicator and controls
202
236
  with Container(id="input-area"):
203
237
  yield Container(
204
238
  Label("Generating response...", id="loading-text"),
205
239
  id="loading-indicator"
206
240
  )
207
- yield Container(
208
- InputWithFocus(placeholder="Type your message here...", id="message-input"),
209
- Button("Send", id="send-button", variant="primary"),
210
- id="controls"
211
- )
241
+ with Container(id="controls"):
242
+ yield InputWithFocus(placeholder="Type your message here...", id="message-input")
243
+ yield SendButton(id="send-button")
212
244
 
213
245
  def on_mount(self) -> None:
214
246
  """Initialize on mount"""
@@ -229,7 +261,6 @@ class ChatInterface(Container):
229
261
  async def on_button_pressed(self, event: Button.Pressed) -> None:
230
262
  """Handle button presses"""
231
263
  button_id = event.button.id
232
-
233
264
  if button_id == "send-button":
234
265
  await self.send_message()
235
266
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: chat-console
3
- Version: 0.1.6.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.6.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",