The WriteAssistAI extension for VSCode utilizes the OpenAI APIs (or OpenAI compatible proxies) to offer AI-powered writing assistance for markdown, LaTeX and plain text files. It comes with some default actions to rephrase the selected text, or perform tasks like tone change, summarize, expand etc. These actions are completely configurable through the extension's settings.
This AI text assistant provides a range of writing styles for you to select from. To access these styles, and other features, simply select the text you want to rewrite in a supported file. Then, click on the Code Actions 💡 tooltip and choose the desired action.
Current feature list:
You can modify the existing actions (including their prompt), or add new ones through the extension's settings.
To use the extension you need to provide your own OpenAI (or OpenAI-Compatible provider) API Key.
You can install the Write Assist AI extension from the VS Code Marketplace.
It exposes the following settings:
writeAssistAi.maxTokens
: Maximum number of tokens to use for each OpenAI API call. The default is 1200
.writeAssistAi.temperature
: Temperature value to use for the API calls. The default is 0.3
.writeAssistAi.openAi.model
: The OpenAI model to use. The default is gpt-4o
.writeAssistAi.openAi.customModel
: To use a custom model, select custom
from the writeAssistAi.openAi.model
dropdown menu, and enter your model name here.writeAssistAi.openAi.proxyUrl
: To use a proxy for AI calls or to connect with an OpenAI-compatible AI provider (such as Groq
), set this to your preferred value. If you choose a different provider, you will also need to update the API Key and specify the custom model you wish to use.writeAssistAi.systemPrompt
: Sets a common system prompt to be used with LLM API calls. You can also configure language specific system prompts. To do this, type @lang:<languageId> Write Assist AI
e.g. @lang:markdown Write Assist AI
in your VSCode settings UI, and set the required system prompt for the selected language.writeAssistAI.separatorText
: This option allows you to define the separator text that surrounds the output generated by the AI. By default, it is set to '*' repeated 32 times. If you prefer to remove the separators, you can do so by setting this option to an empty string.writeAssistAi.quickFixes
: Sets the actions that show up in the editor's tooltip menu under Quick Fix
section. This is also configurable per language.writeAssistAi.rewriteOptions
: Sets the commands that show up in the editor's tooltip menu under Rewrite
section. This is also configurable per language.In addition, you need to set your OpenAI API Key
(or the OpenAI-Compatible provider's API Key) in the Command Palette
under Write Assist AI
category. If not configured already, you can also set it when you use the extension for the first time. Your key will be securely stored in VSCode's secretStorage
for safety.
To utilize other OpenAI-compatible providers (such as Groq
, for more information see details), follow these steps:
writeAssistAi.openAi.proxyUrl
setting.writeAssistAi.openAi.model
setting to "custom" and specify the desired model name in the writeAssistAi.openAi.customModel
setting.Once you've completed these steps, you'll be ready to use the alternative provider.
Both writeAssistAi.quickFixes
and writeAssistAi.rewriteOptions
use the same JSON Schema to define actions. You can edit or remove existing actions, or create a new one by adding an action object.
For instance, you can include a new Quick Fix
action in your settings.json
file to translate the selected text to French.
"writeAssistAi.quickFixes": [
// ...
{
"title": "Translate into French",
"description": "Translates the selected text into French",
"prompt": "Translate the given text into French."
},
// ...
]
To specify actions for a specific language, place the actions within the corresponding language configuration block. For example, to ensure that the action "Translate into French" only applies to markdown files, you can do the following in your settings.json
:
{
"[markdown]": {
// other settings
"writeAssistAi.quickFixes": [
// ...
{
"title": "Translate into French",
"description": "Translates the selected text into French",
"prompt": "Translate the given text into French."
},
// ...
]
}
}
*Note: Default actions are activated only when no action has been specified for a supported language. If you have defined specific actions for a particular language, only those actions will be visible for that language.
--
proxyURL
(baseURL
) to the OpenAI callsgpt-4o-mini
model to the selection dropdownCodeActions
stopped showing if user didn't enter the API Keygpt-4o
model, and made it the default modelCommand Palette
to set/reset the OpenAI API Keysystem prompt
config for use with the LLM callsQuick Fix
and Rewrite
actionsv1/chat/completions
endpoint of OpenAI
v1/completions
endpoint of OpenAI
To check the complete changelog click here
This extension is licensed under the MIT License