AI Personal Learning
and practical guidance
Resource Recommendation 1

DeepSeek Engineer: an experimental coding assistant based on the DeepSeek API, with hint words

General Introduction

DeepSeek Engineer is a powerful programming assistant tool developed based on the DeepSeek API, which is able to interact with the user through an intuitive command line interface to assist in a variety of software development tasks. The tool combines the power of large-scale language modeling with practical file system operations and intelligent code handling features, not only for regular code dialog, but also supports local file reading, creation and real-time modification. Through a structured JSON response mechanism, DeepSeek Engineer is able to accurately understand user intent and provide diverse development support such as code generation and file editing. It features support for multi-line streaming response output, and can realize rapid import and precise editing of file contents through simple commands, making it a powerful assistant for developers to improve programming efficiency.

DeepSeek Engineer: experimental/easy coding assistant based on DeepSeek API-1


 

Function List

  • DeepSeek API Client Integration with GPT Style Streaming Conversation Completion Support
  • Pydantic-based type-safe file operating system
  • Intelligent system prompts to ensure that all responses strictly follow the JSON output format
  • Local file reading and content analysis functions
  • File creation and update operation support
  • Visualization of Code Differences
  • Segment-level file modification functionality
  • The "/add" command quickly imports the contents of a file.
  • Ongoing dialog history tracking
  • Interactive terminal session support
  • Real-time document modification confirmation mechanism

 

Extracting Core Programming Cue Words

You are an elite software engineer called DeepSeek Engineer with decades of experience across all programming domains.
Your expertise spans system design, algorithms, testing, and best practices.
You provide thoughtful, well-structured solutions while explaining your reasoning.
Core capabilities.
1. Code Analysis & Discussion
- Analyze code with expert-level insight
- Explain complex concepts clearly
- Suggest optimizations and best practices
- Debug issues with precision
2. File Operations.
a) Read existing files
- Access user-provided file contents for context
- Analyze multiple files to understand project structure
b) Create new files
- Generate complete new files with proper structure
- Create complementary files (tests, configs, etc.)
c) Edit existing files
- Make precise changes using diff-based editing
- Modify specific sections while preserving context
- Suggest refactoring improvements
Output Format.
You must provide responses in this JSON structure.
{

"files_to_create": [
{ "path": "path/to_create": [
"path": "path/to/new/file",
"content": "complete file content"
}
], "files_to_edit": [ { "path": "path/to/new/file" "content": "complete file content" }
"files_to_edit": [
{
"path": "path/to/existing/file", "original_snippet": "exact code to be replaced", [ {
"original_snippet": "exact code to be replaced",
"new_snippet": "new code to insert"
}
]
}
For normal responses, use 'assistant_reply'.
1. for normal responses, use 'assistant_reply'
2. When creating files, include full content in 'files_to_create'
3. For editing files.
- Use 'files_to_edit' for precise changes
- For editing files: Use 'files_to_edit' for precise changes Include enough context in original_snippet to locate the change
- Ensure new_snippet maintains proper indentation
- Prefer targeted edits over full file replacements
4. Always explain your changes and reasoning
5. Consider edge cases and potential impacts
6. Follow language-specific best practices
7. Suggest tests or validation steps when appropriate
Remember: You're a senior engineer - be thorough, precise, and thoughtful in your solutions.

 

Using Help

1. Environmental preparation

First, you need to prepare the following:

  1. Get DeepSeek API key
  2. establish.envfile and configure the API key:
DEEPSEEK_API_KEY=your_api_key_here

2. Installation steps

DeepSeek Engineer offers two installation options:

Installation using pip (traditional way)

pip install -r requirements.txt
python3 main.py

Use uv installation (faster alternative)

uv venv
uv run main.py

3. Guidance on the use of core functions

Functional operation flow

  1. Starting an Interactive Session: Run the script (for example:python3 main.py) to start an interactive loop in the terminal. Enter your request or code question.
  2. Add file content: Input /add path/to/file to add the contents of the file to the dialog. You can also type /add path/to/folder to add all files in the directory (excluding binaries and hidden files).
  3. Confirmation of document changes: When the assistant suggests new or edited files, you can confirm the changes directly in your local environment.
  4. end of session: Input exit maybe quit to end the session.

Main Functions

  • DeepSeek Client Configuration: Automatically configure the API client to use a valid DEEPSEEK_API_KEY and connect to the DeepSeek endpoint specified in the environment variable to stream GPT class completion.
  • data model: Type-safe file operation processing with Pydantic, including FileToCreate for describing files to be created or updated, FileToEdit for describing the replacement of specific code segments in an existing file, and AssistantResponse for structuring chat responses and potential file operations.
  • system alert: A comprehensive system_PROMPT guides the dialog, ensuring that all replies strictly follow the JSON output, with the option to create or edit files.
  • helper function:: Includes read_local_file for reading the contents of a local file, create_file for creating or overwriting a file, show_diff_table for presenting suggested file changes in a rich multi-line table, and apply_diff_edit for applying snippet-level changes to an existing file.
  • "/add" command: The user can enter /add path/to/file Quickly read the contents of a file and insert it into a dialog as a system message. The user can also type /add path/to/folder to add all files in the directory (excluding binaries and hidden files), which allows the assistant to refer to the contents of the files for further discussion, code generation, or diff suggestions.
  • dialog flow: Maintain a conversation_history list to keep track of messages between the user and the assistant, stream the assistant's replies via the DeepSeek API, parsing them into JSON to preserve text responses and file modification instructions.

fault resolution

  1. API connectivity issues:
    • Check that the API key is configured correctly
    • Confirm network connection status
  2. File operation error:
    • Verify file permission settings
    • Ensure that the destination path is writable
  3. Response parsing issues:
    • Check that the input format is correct
    • Try restarting the session
Contents3
May not be reproduced without permission:Chief AI Sharing Circle " DeepSeek Engineer: an experimental coding assistant based on the DeepSeek API, with hint words

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish