ra-jeev / write-assist-ai

OpenAI-powered Text Rewriter for VS Code. Works with Markdown, LaTeX and text files. Fully customizable through settings.
MIT License
10 stars 1 forks source link
ai-assist latex markdown openai rewrite text-writer writing

Write Assist AI

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.

🎯 Features

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.

Extension Demo

Current feature list:

You can modify the existing actions (including their prompt), or add new ones through the extension's settings.

✅ Requirements

To use the extension you need to provide your own OpenAI (or OpenAI-Compatible provider) API Key.

🛠️ Installation

You can install the Write Assist AI extension from the VS Code Marketplace.

VS Code Marketplace

⚙️ Extension Settings

It exposes the following settings:

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.

Using Alternative OpenAI-Compatible Providers

To utilize other OpenAI-compatible providers (such as Groq, for more information see details), follow these steps:

  1. Configure the correct base URL by adjusting the writeAssistAi.openAi.proxyUrl setting.
  2. Enter the API Key for your chosen provider using the command palette.
  3. Change the 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.

Creating New Actions

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.

🐛 Known Issues

--

🚀 Release Notes

v0.5.0

Added

Fixed

v0.4.1

Added

v0.4.0

Added

Fixed

v0.3.1

Fixed

v0.3.0

Added

Fixed

Removed

📜 Changelog

To check the complete changelog click here

📋 LICENSE

This extension is licensed under the MIT License