deepseek-cli 0.2.2__tar.gz → 0.2.4__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.
- {deepseek_cli-0.2.2/src/deepseek_cli.egg-info → deepseek_cli-0.2.4}/PKG-INFO +1 -1
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/pyproject.toml +1 -1
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/setup.py +2 -2
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/__init__.py +1 -1
- deepseek_cli-0.2.2/src/cli/ai_cli.py → deepseek_cli-0.2.4/src/cli/deepseek_cli.py +20 -38
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4/src/deepseek_cli.egg-info}/PKG-INFO +1 -1
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/deepseek_cli.egg-info/SOURCES.txt +1 -1
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/handlers/chat_handler.py +4 -10
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/LICENSE +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/MANIFEST.in +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/README.md +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/requirements.txt +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/setup.cfg +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/__main__.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/api/__init__.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/api/client.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/cli/__init__.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/config/__init__.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/config/settings.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/deepseek_cli.egg-info/dependency_links.txt +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/deepseek_cli.egg-info/entry_points.txt +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/deepseek_cli.egg-info/requires.txt +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/deepseek_cli.egg-info/top_level.txt +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/handlers/__init__.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/handlers/command_handler.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/handlers/error_handler.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/utils/__init__.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/utils/exceptions.py +0 -0
- {deepseek_cli-0.2.2 → deepseek_cli-0.2.4}/src/utils/version_checker.py +0 -0
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="deepseek-cli",
|
|
8
|
-
version="0.2.
|
|
8
|
+
version="0.2.4",
|
|
9
9
|
author="PierrunoYT",
|
|
10
10
|
author_email="pierrebruno@hotmail.ch",
|
|
11
11
|
description="A powerful CLI for interacting with DeepSeek's AI models",
|
|
@@ -40,7 +40,7 @@ setup(
|
|
|
40
40
|
],
|
|
41
41
|
entry_points={
|
|
42
42
|
"console_scripts": [
|
|
43
|
-
"deepseek=
|
|
43
|
+
"deepseek=cli.deepseek_cli:main",
|
|
44
44
|
],
|
|
45
45
|
},
|
|
46
46
|
package_data={
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Main CLI class for
|
|
1
|
+
"""Main CLI class for DeepSeek"""
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
4
|
import argparse
|
|
@@ -21,11 +21,13 @@ except ImportError:
|
|
|
21
21
|
|
|
22
22
|
# Simplified import handling with clear fallback chain
|
|
23
23
|
try:
|
|
24
|
-
|
|
25
|
-
from
|
|
26
|
-
from
|
|
27
|
-
from
|
|
24
|
+
# When installed via pip/pipx (package_dir={"": "src"})
|
|
25
|
+
from api.client import APIClient
|
|
26
|
+
from handlers.chat_handler import ChatHandler
|
|
27
|
+
from handlers.command_handler import CommandHandler
|
|
28
|
+
from handlers.error_handler import ErrorHandler
|
|
28
29
|
except ImportError:
|
|
30
|
+
# When running from source (development mode)
|
|
29
31
|
from src.api.client import APIClient
|
|
30
32
|
from src.handlers.chat_handler import ChatHandler
|
|
31
33
|
from src.handlers.command_handler import CommandHandler
|
|
@@ -34,10 +36,10 @@ except ImportError:
|
|
|
34
36
|
|
|
35
37
|
|
|
36
38
|
|
|
37
|
-
class
|
|
38
|
-
def __init__(self, *, stream: bool = False
|
|
39
|
-
self.api_client = APIClient(
|
|
40
|
-
self.chat_handler = ChatHandler(stream=stream
|
|
39
|
+
class DeepSeekCLI:
|
|
40
|
+
def __init__(self, *, stream: bool = False) -> None:
|
|
41
|
+
self.api_client = APIClient()
|
|
42
|
+
self.chat_handler = ChatHandler(stream=stream)
|
|
41
43
|
self.command_handler = CommandHandler(self.api_client, self.chat_handler)
|
|
42
44
|
self.error_handler = ErrorHandler()
|
|
43
45
|
|
|
@@ -114,11 +116,8 @@ class MultiProviderCLI:
|
|
|
114
116
|
self.chat_handler.set_system_message("You are a helpful assistant.")
|
|
115
117
|
|
|
116
118
|
# Set model if specified
|
|
117
|
-
if model:
|
|
118
|
-
|
|
119
|
-
self.api_client.set_model(model)
|
|
120
|
-
else:
|
|
121
|
-
console.print(f"[yellow]Warning: Unknown model '{model}', using default[/yellow]")
|
|
119
|
+
if model and model in ["deepseek-chat", "deepseek-coder", "deepseek-reasoner"]:
|
|
120
|
+
self.chat_handler.switch_model(model)
|
|
122
121
|
|
|
123
122
|
# Get and return response
|
|
124
123
|
return self.get_completion(query, raw=raw) or "Error: Failed to get response"
|
|
@@ -130,25 +129,19 @@ class MultiProviderCLI:
|
|
|
130
129
|
"""
|
|
131
130
|
|
|
132
131
|
if style == 'simple':
|
|
133
|
-
# Get current model info
|
|
134
|
-
model_name = self.chat_handler.model
|
|
135
|
-
provider = self.chat_handler.get_current_provider()
|
|
136
|
-
|
|
137
132
|
panel = Panel(
|
|
138
133
|
Align.center(
|
|
139
|
-
|
|
140
|
-
f"Current Model: {model_name} ({provider})\n\n"
|
|
141
|
-
f"Type /help for commands, /models to see all models, or exit to quit.",
|
|
134
|
+
"Use natural language to interact with AI.\nType /help for commands, or exit to quit.",
|
|
142
135
|
vertical="middle"
|
|
143
136
|
),
|
|
144
|
-
title="💡
|
|
137
|
+
title="💡 DeepSeek CLI",
|
|
145
138
|
border_style="cyan",
|
|
146
139
|
box=box.SIMPLE
|
|
147
140
|
)
|
|
148
141
|
console.print(panel)
|
|
149
142
|
else:
|
|
150
143
|
fig = Figlet(font='slant')
|
|
151
|
-
ascii_title = fig.renderText('
|
|
144
|
+
ascii_title = fig.renderText('DeepSeek CLI')
|
|
152
145
|
|
|
153
146
|
# Apply gradient colors to ASCII art
|
|
154
147
|
gradient_title = Text()
|
|
@@ -171,28 +164,17 @@ class MultiProviderCLI:
|
|
|
171
164
|
|
|
172
165
|
def parse_arguments() -> argparse.Namespace:
|
|
173
166
|
"""Parse command line arguments"""
|
|
174
|
-
parser = argparse.ArgumentParser(description="
|
|
167
|
+
parser = argparse.ArgumentParser(description="DeepSeek CLI - A powerful command-line interface for DeepSeek's AI models")
|
|
175
168
|
parser.add_argument("-q", "--query", type=str, help="Run in inline mode with the specified query")
|
|
176
|
-
parser.add_argument("-m", "--model", type=str,
|
|
177
|
-
help="Specify the model to use (
|
|
169
|
+
parser.add_argument("-m", "--model", type=str, choices=["deepseek-chat", "deepseek-coder", "deepseek-reasoner"],
|
|
170
|
+
help="Specify the model to use (deepseek-chat, deepseek-coder, deepseek-reasoner)")
|
|
178
171
|
parser.add_argument("-r", "--raw", action="store_true", help="Output raw response without token usage information")
|
|
179
172
|
parser.add_argument("-s", "--stream", action="store_true", help="Enable stream mode")
|
|
180
|
-
parser.add_argument("--no-stream", action="store_true", help="Disable stream mode")
|
|
181
173
|
return parser.parse_args()
|
|
182
174
|
|
|
183
175
|
def main() -> None:
|
|
184
176
|
args = parse_arguments()
|
|
185
|
-
|
|
186
|
-
# Determine stream mode based on command line arguments
|
|
187
|
-
if args.no_stream:
|
|
188
|
-
stream_mode = False
|
|
189
|
-
elif args.stream:
|
|
190
|
-
stream_mode = True
|
|
191
|
-
else:
|
|
192
|
-
# Use default value from class (which is now False)
|
|
193
|
-
stream_mode = False
|
|
194
|
-
|
|
195
|
-
cli = MultiProviderCLI(stream=stream_mode, model=args.model)
|
|
177
|
+
cli = DeepSeekCLI(stream=args.stream)
|
|
196
178
|
|
|
197
179
|
# Check if running in inline mode
|
|
198
180
|
if args.query:
|
|
@@ -34,11 +34,9 @@ except ImportError:
|
|
|
34
34
|
from src.utils.version_checker import check_version
|
|
35
35
|
|
|
36
36
|
class ChatHandler:
|
|
37
|
-
def __init__(self, *, stream: bool = False
|
|
37
|
+
def __init__(self, *, stream: bool = False) -> None:
|
|
38
38
|
self.messages: List[Dict[str, Any]] = []
|
|
39
|
-
|
|
40
|
-
from src.config.settings import DEFAULT_MODEL
|
|
41
|
-
self.model: str = model or DEFAULT_MODEL
|
|
39
|
+
self.model: str = "deepseek-chat"
|
|
42
40
|
self.stream: bool = stream
|
|
43
41
|
self.json_mode: bool = False
|
|
44
42
|
self.max_tokens: int = DEFAULT_MAX_TOKENS
|
|
@@ -96,11 +94,7 @@ class ChatHandler:
|
|
|
96
94
|
|
|
97
95
|
def get_current_provider(self) -> str:
|
|
98
96
|
"""Get the provider of the current model"""
|
|
99
|
-
|
|
100
|
-
return MODEL_CONFIGS[self.model].get("provider", "unknown")
|
|
101
|
-
if "/" in self.model:
|
|
102
|
-
return self.model.split("/")[0]
|
|
103
|
-
return "unknown"
|
|
97
|
+
return "deepseek"
|
|
104
98
|
|
|
105
99
|
def set_temperature(self, temp_str: str) -> bool:
|
|
106
100
|
"""Set temperature either by number or preset name"""
|
|
@@ -179,7 +173,7 @@ class ChatHandler:
|
|
|
179
173
|
}
|
|
180
174
|
|
|
181
175
|
# Only add these parameters if not using the reasoner model
|
|
182
|
-
if self.model != "deepseek
|
|
176
|
+
if self.model != "deepseek-reasoner":
|
|
183
177
|
kwargs.update({
|
|
184
178
|
"temperature": self.temperature,
|
|
185
179
|
"frequency_penalty": self.frequency_penalty,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|