Ask Bard - Google AI Integration for VSCode
Ask Bard integrates Google's AI with VSCode to provide AI-generated code.
It utilizes the free official Google's PaLM API.
- Google's PaLM 2 LLM Integration will help you:
- Generate code snippets.
- Generate unit tests.
- Insert docstrings.
- Generate regular expresions.
- Ask anything in general.
- Now with automatic AI completions!
- Multi-language Support: Supports most programming languages.
- Easy Configuration: You only need to set up your API key in the extension settings.
Before using Ask Bard, you need to configure your API key:
- Get your free API key from https://makersuite.google.com/app/apikey.
- Open your Visual Studio Code settings from File > Preferences > Settings or using the command palette and search "Set Ask Bard API key"
- Set the API key
Generating Code Snippets
- Select the text describing the code you want.
- Right-click and select "Ask Bard for code" (or use the command palette).
- Ask Bard will insert the code below your selected text.
Generating Unit Tests
- Select the code for which you want to generate unit tests.
- Right-click and select "Ask Bard for unit tests" (or use the command palette).
- Ask Bard will insert the unit tests below your selected code.
- Select the function for which you want to generate the docstring.
- Right-click and select "Ask Bard for docstring" (or use the command palette).
- Ask Bard will insert the docstring in the function.
Generating regular expressions
- Select a word or phrase that explains the regex you need.
- Right-click and select "Ask Bard for regex" (or use the command palette).
- Ask Bard will replace the text with the regex.
Note: This command will forward your selection directly as a prompt.
- Select something.
- Right-click and select "Ask Bard anything" (or use the command palette).
- Ask Bard will reply below the selected text.
A completion recommendation based on the last 300 words will appear after you enter a new line. The API isn't super fast so there can be a slight delay.
Can be disabled via settings.
- Visual Studio Code version 1.83.0 or higher.
- A free API key from Google MakerSuite.
askbard.apiKey: Here goes your API key.
askbard.getCompletion: Enable / disable automatic completions.
- Added automatic completions per popular request ❤️ Its not Copilot yet but its elegant enough.
- Removed comment requirement in generating code snippets. This way we now support all languages supported by VSCode.
- Bugfixes & refactoring.
- Formatted with Prettier 😬
- Added Ask Bard anything.
- Grouped context menu commands.
- Added regex generation.
- Prompts optimizations.
- Added docstring generation.
- Typos, phrasing, and minor reformatting.
- Added support for Rust, SQL, JSX and PHP.
- Fixed critical packaging bug that stopped the extension from working (whoops).
Feedback and Contributions
Have a feature request or found a bug? Feel free to submit an issue.
Contributions are also welcome! Please check the contributing guidelines before submitting a pull request.
This extension is licensed under the MIT License.
Extension bootsrapped with yo code
Google PaLM API Documentation
Developed with ❤️ by TPJelf