chat-console 0.3.993__tar.gz → 0.3.995__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.993/chat_console.egg-info → chat_console-0.3.995}/PKG-INFO +1 -1
  2. {chat_console-0.3.993 → chat_console-0.3.995}/app/__init__.py +1 -1
  3. {chat_console-0.3.993 → chat_console-0.3.995}/app/api/openai.py +26 -13
  4. {chat_console-0.3.993 → chat_console-0.3.995/chat_console.egg-info}/PKG-INFO +1 -1
  5. {chat_console-0.3.993 → chat_console-0.3.995}/LICENSE +0 -0
  6. {chat_console-0.3.993 → chat_console-0.3.995}/README.md +0 -0
  7. {chat_console-0.3.993 → chat_console-0.3.995}/app/api/__init__.py +0 -0
  8. {chat_console-0.3.993 → chat_console-0.3.995}/app/api/anthropic.py +0 -0
  9. {chat_console-0.3.993 → chat_console-0.3.995}/app/api/base.py +0 -0
  10. {chat_console-0.3.993 → chat_console-0.3.995}/app/api/ollama.py +0 -0
  11. {chat_console-0.3.993 → chat_console-0.3.995}/app/config.py +0 -0
  12. {chat_console-0.3.993 → chat_console-0.3.995}/app/database.py +0 -0
  13. {chat_console-0.3.993 → chat_console-0.3.995}/app/main.py +0 -0
  14. {chat_console-0.3.993 → chat_console-0.3.995}/app/models.py +0 -0
  15. {chat_console-0.3.993 → chat_console-0.3.995}/app/ui/__init__.py +0 -0
  16. {chat_console-0.3.993 → chat_console-0.3.995}/app/ui/chat_interface.py +0 -0
  17. {chat_console-0.3.993 → chat_console-0.3.995}/app/ui/chat_list.py +0 -0
  18. {chat_console-0.3.993 → chat_console-0.3.995}/app/ui/model_browser.py +0 -0
  19. {chat_console-0.3.993 → chat_console-0.3.995}/app/ui/model_selector.py +0 -0
  20. {chat_console-0.3.993 → chat_console-0.3.995}/app/ui/search.py +0 -0
  21. {chat_console-0.3.993 → chat_console-0.3.995}/app/ui/styles.py +0 -0
  22. {chat_console-0.3.993 → chat_console-0.3.995}/app/utils.py +0 -0
  23. {chat_console-0.3.993 → chat_console-0.3.995}/chat_console.egg-info/SOURCES.txt +0 -0
  24. {chat_console-0.3.993 → chat_console-0.3.995}/chat_console.egg-info/dependency_links.txt +0 -0
  25. {chat_console-0.3.993 → chat_console-0.3.995}/chat_console.egg-info/entry_points.txt +0 -0
  26. {chat_console-0.3.993 → chat_console-0.3.995}/chat_console.egg-info/requires.txt +0 -0
  27. {chat_console-0.3.993 → chat_console-0.3.995}/chat_console.egg-info/top_level.txt +0 -0
  28. {chat_console-0.3.993 → chat_console-0.3.995}/setup.cfg +0 -0
  29. {chat_console-0.3.993 → chat_console-0.3.995}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chat-console
3
- Version: 0.3.993
3
+ Version: 0.3.995
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.993"
6
+ __version__ = "0.3.995"
@@ -53,12 +53,18 @@ class OpenAIClient(BaseModelClient):
53
53
  """Generate a text completion using OpenAI"""
54
54
  processed_messages = self._prepare_messages(messages, style)
55
55
 
56
- response = await self.client.chat.completions.create(
57
- model=model,
58
- messages=processed_messages,
59
- temperature=temperature,
60
- max_tokens=max_tokens,
61
- )
56
+ # Create parameters dict, omitting max_tokens if it's None
57
+ params = {
58
+ "model": model,
59
+ "messages": processed_messages,
60
+ "temperature": temperature,
61
+ }
62
+
63
+ # Only add max_tokens if it's not None
64
+ if max_tokens is not None:
65
+ params["max_tokens"] = max_tokens
66
+
67
+ response = await self.client.chat.completions.create(**params)
62
68
 
63
69
  return response.choices[0].message.content
64
70
 
@@ -113,13 +119,20 @@ class OpenAIClient(BaseModelClient):
113
119
 
114
120
  while retry_count <= max_retries:
115
121
  try:
116
- stream = await self.client.chat.completions.create(
117
- model=model,
118
- messages=api_messages,
119
- temperature=temperature,
120
- max_tokens=max_tokens,
121
- stream=True,
122
- )
122
+ # Create parameters dict, omitting max_tokens if it's None
123
+ params = {
124
+ "model": model,
125
+ "messages": api_messages,
126
+ "temperature": temperature,
127
+ "stream": True,
128
+ }
129
+
130
+ # Only add max_tokens if it's not None
131
+ if max_tokens is not None:
132
+ params["max_tokens"] = max_tokens
133
+
134
+ debug_log(f"OpenAI: creating stream with params: {params}")
135
+ stream = await self.client.chat.completions.create(**params)
123
136
 
124
137
  # Store the stream for potential cancellation
125
138
  self._active_stream = stream
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chat-console
3
- Version: 0.3.993
3
+ Version: 0.3.995
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