chat-console 0.4.91__py3-none-any.whl → 0.4.94__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/__init__.py CHANGED
@@ -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.4.91"
6
+ __version__ = "0.4.94"
app/console_utils.py CHANGED
@@ -55,37 +55,54 @@ async def console_streaming_response(
55
55
  style=style
56
56
  ):
57
57
  if chunk:
58
- buffer.append(chunk)
59
- current_time = time.time()
60
-
61
- # Update based on time interval or buffer size
62
- should_update = (
63
- current_time - last_update >= update_interval or
64
- len(buffer) >= buffer_size or
65
- len(full_content) < 100 # Always update quickly for first few chars
66
- )
67
-
68
- if should_update:
69
- # Process buffered chunks
70
- new_content = ''.join(buffer)
71
- full_content += new_content
72
- buffer = []
73
- last_update = current_time
74
-
75
- # Call update callback with accumulated content
76
- if update_callback:
77
- update_callback(full_content)
58
+ # For Ollama, break down large chunks into smaller pieces for smoother streaming
59
+ if is_ollama and len(chunk) > 1:
60
+ # Split chunk into smaller pieces (words or characters)
61
+ words = chunk.split(' ')
62
+ for i, word in enumerate(words):
63
+ if i > 0:
64
+ word = ' ' + word # Add space back except for first word
65
+
66
+ full_content += word
67
+
68
+ # Update display with gradual content
69
+ if update_callback:
70
+ update_callback(full_content)
71
+
72
+ yield word
73
+
74
+ # Small delay between words for streaming effect
75
+ await asyncio.sleep(0.03)
76
+ else:
77
+ buffer.append(chunk)
78
+ current_time = time.time()
78
79
 
79
- # Yield the new chunk for compatibility
80
- yield new_content
80
+ # Update based on time interval or buffer size
81
+ should_update = (
82
+ current_time - last_update >= update_interval or
83
+ len(buffer) >= buffer_size or
84
+ len(full_content) < 100 # Always update quickly for first few chars
85
+ )
81
86
 
82
- # Provider-specific delays
83
- if is_ollama:
84
- await asyncio.sleep(0.02) # Small delay for Ollama
85
- elif is_openai and not model.startswith(("o1", "o3", "o4")):
86
- await asyncio.sleep(0.01) # Minimal delay for fast OpenAI models
87
- else:
88
- await asyncio.sleep(0.015) # Default delay
87
+ if should_update:
88
+ # Process buffered chunks
89
+ new_content = ''.join(buffer)
90
+ full_content += new_content
91
+ buffer = []
92
+ last_update = current_time
93
+
94
+ # Call update callback with accumulated content
95
+ if update_callback:
96
+ update_callback(full_content)
97
+
98
+ # Yield the new chunk for compatibility
99
+ yield new_content
100
+
101
+ # Provider-specific delays
102
+ if is_openai and not model.startswith(("o1", "o3", "o4")):
103
+ await asyncio.sleep(0.01) # Minimal delay for fast OpenAI models
104
+ else:
105
+ await asyncio.sleep(0.015) # Default delay
89
106
 
90
107
  # Process any remaining buffer content
91
108
  if buffer:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chat-console
3
- Version: 0.4.91
3
+ Version: 0.4.94
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,8 +1,8 @@
1
- app/__init__.py,sha256=PDATaB-vh7djdO7muLiV3GwDj4J-pDDL82c4BYxENgQ,131
1
+ app/__init__.py,sha256=jOSPwihztW6tm1_MpiQdJBEJFLc7SwQ1y6Q1xRgvtao,131
2
2
  app/config.py,sha256=F-0hO3NT5kRJxZelGLxaeUmnwx8i0LPHzYtNftL6CwM,8468
3
3
  app/console_chat.py,sha256=y43zFuX4WT08NNGsXcO6GhA8B0RRCvrfRIPY5-jcQVo,82326
4
4
  app/console_main.py,sha256=QNUiD9IPw2Spl-gpvrw1AzDqezMpmU3IPHlcK1LDOtI,1799
5
- app/console_utils.py,sha256=jdfZ3OZEAIJ4tlQNg1_8qrtUP1xdyMeWjdz9ahgzL1s,7032
5
+ app/console_utils.py,sha256=rPaE71NK-7x3Xh9gblN-4j6iDoGgiOqp9BXVYG_POBs,7965
6
6
  app/database.py,sha256=nt8CVuDpy6zw8mOYqDcfUmNw611t7Ln7pz22M0b6-MI,9967
7
7
  app/main.py,sha256=kZtiKXNVmy9QLjm_qdSW9qged8nhXBydUq_5u7yYx6k,87767
8
8
  app/models.py,sha256=4-y9Lytay2exWPFi0FDlVeRL3K2-I7E-jBqNzTfokqY,2644
@@ -20,9 +20,9 @@ app/ui/model_browser.py,sha256=pdblLVkdyVF0_Bo02bqbErGAtieyH-y6IfhMOPEqIso,71124
20
20
  app/ui/model_selector.py,sha256=3ykyDhzJU9KQg3XnOQbba5bhpqsSH1RwIYEGWVY37GQ,19407
21
21
  app/ui/search.py,sha256=b-m14kG3ovqW1-i0qDQ8KnAqFJbi5b1FLM9dOnbTyIs,9763
22
22
  app/ui/styles.py,sha256=MZ7J3D796IFYsDQs-RFxSLGHhcQqsaXym9wv3LYMI5k,9284
23
- chat_console-0.4.91.dist-info/licenses/LICENSE,sha256=srHZ3fvcAuZY1LHxE7P6XWju2njRCHyK6h_ftEbzxSE,1057
24
- chat_console-0.4.91.dist-info/METADATA,sha256=cLGZ7zT7V1cXivqPsUbILtC6aYfgBdrWzkVPRIfHREg,3810
25
- chat_console-0.4.91.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
- chat_console-0.4.91.dist-info/entry_points.txt,sha256=oy1j-LnmYOO0akBMP8Ijx0rZxxA7N3FSy82ZeCPNnqE,142
27
- chat_console-0.4.91.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
28
- chat_console-0.4.91.dist-info/RECORD,,
23
+ chat_console-0.4.94.dist-info/licenses/LICENSE,sha256=srHZ3fvcAuZY1LHxE7P6XWju2njRCHyK6h_ftEbzxSE,1057
24
+ chat_console-0.4.94.dist-info/METADATA,sha256=XDmFk-BV1qb9L7iwIUk2gLi863rEtfOn5m5gs6HmSHM,3810
25
+ chat_console-0.4.94.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
+ chat_console-0.4.94.dist-info/entry_points.txt,sha256=oy1j-LnmYOO0akBMP8Ijx0rZxxA7N3FSy82ZeCPNnqE,142
27
+ chat_console-0.4.94.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
28
+ chat_console-0.4.94.dist-info/RECORD,,