This Sublime Text extension is generated with Deepseek V3 free online chat, with some instructions. It took me one hour to build from scratch. Actually it might be a good startpoint for something more usable.
Tested in Sublime Text 4
*** README IS GENERATED, IT COULD BE INCORRECT ***
A Sublime Text extension that integrates with the DeepSeek API to provide AI-powered chat functionality directly within the editor. This extension allows you to interact with the DeepSeek API, send messages, and receive responses in real-time, with support for streaming mode.
- Chat with DeepSeek API: Send messages and receive responses from the DeepSeek API.
- Streaming Mode: Enable streaming to receive responses in real-time, with updates every 100ms.
- History Management: Maintains a conversation history for context-aware interactions.
- Customizable Settings: Configure API key, model, system message, and other parameters.
- Output View: Displays the conversation in a dedicated view within Sublime Text.
-
Clone the Repository: Clone this repository into your Sublime Text
Packagesdirectory.git clone https://github.com/yourusername/deepseek-chat-sublime.git
Alternatively, you can download the repository as a ZIP file and extract it into the
Packagesdirectory. -
Install Dependencies: Ensure you have Python 3 installed. The extension uses the
urllibandjsonlibraries, which are part of Python's standard library. -
Configure API Key: Open the
DeepChat.sublime-settingsfile in Sublime Text and add your DeepSeek API key:{ "api_key": "your_api_key_here", "model": "deepseek-chat", "system_message": "You are a helpful assistant.", "max_tokens": 100, "temperature": 0.7, "stream": true }Replace
your_api_key_herewith your actual API key.
-
Open the Command Palette: Press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(Mac) to open the Command Palette. -
Start Chat: Type
DeepSeek Chatand select the command to start a chat session. -
Enter Your Message: A input panel will appear at the bottom of the editor. Enter your message and press
Enter. -
View Responses: The response from the DeepSeek API will be displayed in a dedicated view named
DeepChatResult. If streaming is enabled, the response will update in real-time. -
Exit Chat: Type
/exitin the input panel to end the chat session.
You can customize the extension by editing the DeepChat.sublime-settings file. Here are the available options:
| Key | Description | Default Value |
|---|---|---|
api_key |
Your DeepSeek API key. | "" |
model |
The model to use for chat completions. | "deepseek-chat" |
system_message |
The system message to set the behavior of the assistant. | "You are a helpful assistant." |
max_tokens |
The maximum number of tokens to generate in the response. | 100 |
temperature |
Controls the randomness of the response (higher values = more random). | 0.7 |
stream |
Enable or disable streaming mode. | true |
What is the capital of France?
Q: What is the capital of France?
A: The capital of France is Paris.
-
API Key Not Set: Ensure that you have added your DeepSeek API key to the
DeepChat.sublime-settingsfile. -
Streaming Not Working: Verify that the
streamoption is set totruein the settings file. Also, ensure that the API endpoint supports streaming. -
Errors in Response: Check the Sublime Text console (
View > Show Console) for detailed error messages.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request.
Enjoy chatting with DeepSeek directly in Sublime Text! 🚀
This README.md provides a comprehensive guide for users to install, configure, and use your Sublime Text extension. You can customize it further based on your specific needs or additional features.