chat-console 0.3.4__tar.gz → 0.3.5__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 (29) hide show
  1. {chat_console-0.3.4 → chat_console-0.3.5}/PKG-INFO +1 -1
  2. {chat_console-0.3.4 → chat_console-0.3.5}/app/__init__.py +1 -1
  3. {chat_console-0.3.4 → chat_console-0.3.5}/app/main.py +6 -2
  4. {chat_console-0.3.4 → chat_console-0.3.5}/app/ui/chat_interface.py +13 -2
  5. {chat_console-0.3.4 → chat_console-0.3.5}/app/utils.py +15 -2
  6. {chat_console-0.3.4 → chat_console-0.3.5}/chat_console.egg-info/PKG-INFO +1 -1
  7. {chat_console-0.3.4 → chat_console-0.3.5}/LICENSE +0 -0
  8. {chat_console-0.3.4 → chat_console-0.3.5}/README.md +0 -0
  9. {chat_console-0.3.4 → chat_console-0.3.5}/app/api/__init__.py +0 -0
  10. {chat_console-0.3.4 → chat_console-0.3.5}/app/api/anthropic.py +0 -0
  11. {chat_console-0.3.4 → chat_console-0.3.5}/app/api/base.py +0 -0
  12. {chat_console-0.3.4 → chat_console-0.3.5}/app/api/ollama.py +0 -0
  13. {chat_console-0.3.4 → chat_console-0.3.5}/app/api/openai.py +0 -0
  14. {chat_console-0.3.4 → chat_console-0.3.5}/app/config.py +0 -0
  15. {chat_console-0.3.4 → chat_console-0.3.5}/app/database.py +0 -0
  16. {chat_console-0.3.4 → chat_console-0.3.5}/app/models.py +0 -0
  17. {chat_console-0.3.4 → chat_console-0.3.5}/app/ui/__init__.py +0 -0
  18. {chat_console-0.3.4 → chat_console-0.3.5}/app/ui/chat_list.py +0 -0
  19. {chat_console-0.3.4 → chat_console-0.3.5}/app/ui/model_browser.py +0 -0
  20. {chat_console-0.3.4 → chat_console-0.3.5}/app/ui/model_selector.py +0 -0
  21. {chat_console-0.3.4 → chat_console-0.3.5}/app/ui/search.py +0 -0
  22. {chat_console-0.3.4 → chat_console-0.3.5}/app/ui/styles.py +0 -0
  23. {chat_console-0.3.4 → chat_console-0.3.5}/chat_console.egg-info/SOURCES.txt +0 -0
  24. {chat_console-0.3.4 → chat_console-0.3.5}/chat_console.egg-info/dependency_links.txt +0 -0
  25. {chat_console-0.3.4 → chat_console-0.3.5}/chat_console.egg-info/entry_points.txt +0 -0
  26. {chat_console-0.3.4 → chat_console-0.3.5}/chat_console.egg-info/requires.txt +0 -0
  27. {chat_console-0.3.4 → chat_console-0.3.5}/chat_console.egg-info/top_level.txt +0 -0
  28. {chat_console-0.3.4 → chat_console-0.3.5}/setup.cfg +0 -0
  29. {chat_console-0.3.4 → chat_console-0.3.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chat-console
3
- Version: 0.3.4
3
+ Version: 0.3.5
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
@@ -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__ = "0.3.4"
6
+ __version__ = "0.3.5"
@@ -910,12 +910,16 @@ class SimpleChatApp(App): # Keep SimpleChatApp class definition
910
910
  message_display = MessageDisplay(assistant_message, highlight_code=CONFIG["highlight_code"])
911
911
  messages_container.mount(message_display)
912
912
 
913
- # Force a layout refresh and scroll to end
913
+ # Force multiple layout refreshes and scroll to end to ensure visibility
914
+ self.refresh(layout=False)
915
+ await asyncio.sleep(0.01)
914
916
  self.refresh(layout=True)
915
917
  messages_container.scroll_end(animate=False)
918
+ await asyncio.sleep(0.01)
919
+ self.refresh(layout=True)
916
920
 
917
921
  # Add small delay to show thinking state
918
- await asyncio.sleep(0.5)
922
+ await asyncio.sleep(0.3)
919
923
 
920
924
  # Stream chunks to the UI with synchronization
921
925
  update_lock = asyncio.Lock()
@@ -132,6 +132,9 @@ class MessageDisplay(Static): # Inherit from Static instead of RichLog
132
132
  # This avoids text reflowing as new tokens arrive
133
133
  formatted_content = self._format_content(content)
134
134
 
135
+ # Print debug info to console
136
+ print(f"MessageDisplay.update_content: Updating with {len(content)} chars")
137
+
135
138
  # Use a direct update that forces refresh - critical fix for streaming
136
139
  # This ensures content is immediately visible
137
140
  self.update(formatted_content, refresh=True)
@@ -140,7 +143,11 @@ class MessageDisplay(Static): # Inherit from Static instead of RichLog
140
143
  try:
141
144
  # Always force app refresh for every update
142
145
  if self.app:
143
- # Force a full layout refresh to ensure content is visible
146
+ # First do a quick refresh without layout recalculation
147
+ self.app.refresh(layout=False)
148
+
149
+ # Then do a full layout refresh to ensure content is visible
150
+ await asyncio.sleep(0.01)
144
151
  self.app.refresh(layout=True)
145
152
 
146
153
  # Find the messages container and scroll to end
@@ -148,13 +155,17 @@ class MessageDisplay(Static): # Inherit from Static instead of RichLog
148
155
  for container in containers:
149
156
  if hasattr(container, 'scroll_end'):
150
157
  container.scroll_end(animate=False)
158
+
159
+ # Force another refresh after scrolling
160
+ await asyncio.sleep(0.01)
161
+ self.app.refresh(layout=True)
151
162
  except Exception as e:
152
163
  # Log the error and fallback to local refresh
153
164
  print(f"Error refreshing app: {str(e)}")
154
165
  self.refresh(layout=True)
155
166
 
156
167
  # Small delay to allow UI to update
157
- await asyncio.sleep(0.02) # Increased delay for better rendering
168
+ await asyncio.sleep(0.03) # Increased delay for better rendering
158
169
 
159
170
  def _format_content(self, content: str) -> str:
160
171
  """Format message content with timestamp and handle markdown links"""
@@ -275,10 +275,23 @@ async def generate_streaming_response(
275
275
  # Call the UI callback with the full response so far
276
276
  await callback(full_response)
277
277
  debug_log("UI callback completed successfully")
278
+ print("UI callback completed successfully")
278
279
 
279
- # Force app refresh after each update
280
+ # Force app refresh after each update - CRITICAL for visibility
280
281
  if hasattr(app, 'refresh'):
281
- app.refresh(layout=True) # Force layout refresh for all models
282
+ # First do a layout=False refresh which is faster
283
+ app.refresh(layout=False)
284
+ # Then do a full layout refresh to ensure content is visible
285
+ await asyncio.sleep(0.01)
286
+ app.refresh(layout=True)
287
+
288
+ # Try to force scroll to end
289
+ try:
290
+ messages_container = app.query_one("#messages-container")
291
+ if messages_container and hasattr(messages_container, 'scroll_end'):
292
+ messages_container.scroll_end(animate=False)
293
+ except Exception as scroll_err:
294
+ debug_log(f"Error scrolling: {str(scroll_err)}")
282
295
  except Exception as callback_err:
283
296
  debug_log(f"Error in UI callback: {str(callback_err)}")
284
297
  logger.error(f"Error in UI callback: {str(callback_err)}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chat-console
3
- Version: 0.3.4
3
+ Version: 0.3.5
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes