DevChat: AI intelligent programming assistant based on large models in VSCode

Which #AI programming assistant is the best? DevChat is “really” easy to use#

Article directory

  • 1 Introduction
  • 2. Installation
    • 2.1 Register new user
    • 2.2 Install the DevChat plug-in in VSCode
    • 2.3 Set Access Key
  • 3. Practical use
    • 3.1 Code writing
    • 3.2 Project creation
    • 3.3 Code explanation
  • 4. Summary

1. Preface

DevChat is an AI intelligent programming assistant carefully built by Merico Company. It leverages state-of-the-art large language model technology to understand requirements as efficiently as human developers and provide the best code and project implementation. DevChat can provide multiple supports such as intelligent completion, error correction, code specification checking, and code comment generation, which greatly improves developers’ work efficiency. This allows developers to say goodbye to dirty work and do more valuable work. The product is pragmatic and efficient, and was recently unveiled at the 2023 QCon Global Software Conference, winning praise from many developers in the industry.

As a comprehensive AI intelligent programming assistant, it can not only complete code writing, but also complete unit testing, debugging, code documentation writing and efficient summary. While ensuring coding quality, DevChat also attaches great importance to user privacy and data security. DevChat supports the Microsoft Azure platform, the world’s top data privacy protection, and is more secure to use than the OpenAI interface.

DevChat provides interfaces for large models such as GPT-3.5, GPT-4, XINGHUO-2, CLAUDE-2, LLAMA-2-13B-CHAT, etc. Users can choose the most suitable large model according to their actual needs, thereby maximizing Improve work efficiency to a certain extent. For example, GPT-4 can be the first choice for complex tasks, and other tasks can also be solved using low-cost models, and the combination can achieve the best performance.

DevChat AI auxiliary tool is so powerful, what are the advantages? It contains a total of eight major advantages, as follows:

  • Precise contextual control
  • Choose from a variety of large models: GPT-4 is the best choice for complex tasks, and low-cost models for simple tasks, which provide the best performance when used in combination
  • Precise “context” management; add any code segment to the conversation, do not rely on AI’s guessing, and return control to the user
  • Simple and scalable prompt word catalog: Open prompt word extension, Prompts as Code, to meet the customized needs of teams and individuals
  • Flexible Prompt template management, ask-code function answers various questions in the code base
  • Product design is pragmatic and iterative feedback is fast
  • Code and documentation are freely generated rather than simply completed
  • Connected to Microsoft Azure services for reliable enterprise-level data security

After using the DevChat intelligent programming assistant in depth, my biggest feeling is that it is simple and easy to use. It is very suitable for programmers of different levels to solve problems of different difficulties. It can not only help novices write mature codes, but also help project teams Increase work efficiency. So it is strongly recommended that everyone try it out. The access address is: official website link.

2. Installation

In order to take care of the vast majority of students, the steps in this section are more detailed. I hope everyone can follow the steps below to successfully complete the installation of DevChat.

2.1 Register new user

Click to enter the official website link, and then click to log in, as shown below:


Click Sign Up in the picture below to start the registration of new users:

Then enter the user name and email address in the picture below (it is OK to test the QQ mailbox in person), complete the real-person test of I am human, and finally click Sign up to complete the registration of the new user. It should be noted that at this time, the mailbox will receive an email containing the Access Key, and the Access Key will be saved locally for subsequent use.

Then enter the email you just registered with and click Send Code. You will receive an email containing the verification code. Then enter it into the input box of Veification Code and click Sign In to log in, as shown in the figure below:

2.2 Install the DevChat plug-in in VSCode

First open VSCode, click the configuration button (gear-shaped) in the lower left, and then click Extensions, as shown in the figure below:

Then enter DevChat in the search box and click Install to install, as shown in the figure below:

2.3 Set Access Key

Click the settings button in the lower left corner and select Command Palette (Control Panel), as shown below:


Click DevChat: Input DevChat Access Key in the pop-up command panel, as shown in the following figure:

Copy the previously saved Access Key into the input box in the picture below and press the Enter key.

After the input is completed, you can see that api key status: has valid access key appears in the log below, which means that the Access Key configuration is successful, as shown in the following figure:

3. Practical use

3.1 Code writing

First of all, let’s take the simplest test example, that is, let DevChat complete Python’s quick sorting. The screenshot and code are as follows:

def quick sort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[len(arr) /1 2] # Select a pivot element
    left = [x for x in arr if x < pivot] # The part smaller than the pivot element
    middle = [x for x in arr if x == pivot] # equal to the part of the pivot element
    right = [x for x in arr if x > pivot] # The part larger than the pivot element
    # Recursively sort the left and right parts
    return quick sort(left) + middle + quick sort(right)

3.2 Project Creation

In addition to being able to write algorithm questions, can DevChat create a Python project? Here we take the Python Django project as an example. First, enter how to create a Django project in the input box, as shown in the figure below:

Then DevChat gives detailed creation steps, as shown in the figure below. Let’s see if we can complete the creation of the Django project under its guidance?

First enter the command line and use the pip command to install the django library. When you see Successfully installed, the installation is successful. The specific steps and screenshots are as follows:

Then create the Django project in the command. The specific operation command is also consistent with the steps given by DevChat, as shown in the following figure:

When you see The install worked successfully! Congratulations!, it means that the Django project has been created successfully, as shown in the following figure:

3.3 Code explanation

DevChat can not only help us complete code writing and project creation, but also help us explain the code, which greatly improves the efficiency of reading code.

First use the mouse box to select the specified code segment, then right-click the mouse and click Add to DevChat, as shown in the following figure:

Then select the corresponding model in the menu bar. Since the context length of CLAUDE-2 is 100K (the longest in the model list), this model is selected to complete this task.

Enter in the dialog box: Please help me explain the code as shown below.

DevChat’s answer is as follows:

This code uses OpenAI’s Completion API to generate text. The main logic is as follows:

1. Try to generate text in an infinite loop.

2. Build the request parameters using model_name, batch_decoding_args, and decoding_kwargs.

3. Call Completion.create() to generate text.

4. If an OpenAIError is encountered, handle different errors:

   - If it is a "Please reduce your prompt" error, adjust the max_tokens parameter and try again.

   - If it is a request frequency limit error, wait for a while and try again.

5. Get the result choices, record the usage of tokens, and add it to the completions list.

6. Exit the loop after success.

This mechanism can automatically handle errors and limitations of the OpenAI API, continuously trying the request until the text is successfully generated. The max_tokens parameter can be dynamically adjusted to accommodate the prompt length limit. Overall, this is an elegant way to call the OpenAI API repeatedly until it succeeds.

4. Summary

After personally experiencing DevChat, it is indeed a very smart AI programming assistant. Not only can it complete intelligent code completion, error correction and code specification checking, but it can also complete project creation under its precise guidance. It is really powerful and easy to use, so I strongly recommend everyone to install it and use it. In the new era of AI, only by constantly learning and using the latest AI tools can we remain invincible.