Amazon CodeWhisperer for JupyterLab
Project description
Amazon CodeWhisperer for JupyterLab
Amazon CodeWhisperer is an AI coding companion which provides developers with real-time code suggestions in JupyterLab. Individual developers can use CodeWhisperer for free in JupyterLab and AWS SageMaker Studio.
Requirements
In order to use CodeWhisperer in JupyterLab, you must have a version of JupyterLab >= 3.5 installed. This extension does not yet support JupyterLab > 4.0. You will also need a free AWS Builder ID account to access CodeWhisperer. (You can set that up the first time you log in.)
In order to use CodeWhisperer in SageMaker Studio, you must have set up a SageMaker Studio notebook instance, along with an execution role with the appropriate IAM Permissions.
Getting Started
Jupyter Lab
You can install and enable the CodeWhisperer extension for JupyterLab with the following commands.
pip install amazon-codewhisperer-jupyterlab-ext
jupyter server extension enable amazon_codewhisperer_jupyterlab_ext
Once installed, choose Start CodeWhisperer from the CodeWhisperer panel at the bottom of the window. This will enable to you log in to AWS Builder ID to access CodeWhisperer. Refer to Setting up CodeWhisperer with JupyterLab for detailed setup instructions.
SageMaker Studio
To setup the CodeWhisperer extension with a SageMaker Studio notebook instance, you must add IAM Permissions for
codewhisperer:GenerateRecommendations
for your user profile. Then you must install and enable the extension with the following commands.
conda activate studio
pip install amazon-codewhisperer-jupyterlab-ext
jupyter server extension enable amazon_codewhisperer_jupyterlab_ext
conda deactivate
restart-jupyter-server
After you complete installation and refresh your browser, a CodeWhisperer panel will appear at the bottom of the window. Refer to Setting up CodeWhisperer with SageMaker Studio for detailed setup instructions.
Features
Code Completion
CodeWhisperer for JupyterLab provides AI powered suggestions as ghost text with the following default keybindings. These can be modified in the settings.
Action | Key Binding |
---|---|
Manually trigger CodeWhisperer | Alt C (Window) / ⌥ C (Mac) |
Accept a recommendation | Tab |
Next recommendation | Right arrow |
Previous recommendation | Left arrow |
Reject a recommendation | ESC |
Python is the only supported programming language for now. Users can start or pause suggestions by toggling the menu item in the CodeWhisperer panel that will appear at the bottom of the window.
Code References
With the reference log, you can view references to code recommendations. You can also update and edit code recommendations suggested by CodeWhisperer.
To view Code References for accepted suggestions, choose Open Code Reference Log from the CodeWhisperer panel at the bottom of the window. Users can also turn off code suggestions with code references in Settings.
More Resources
- CodeWhisperer User Guide
- Setting up Amazon CodeWhisperer with JupyterLab
- Setting up CodeWhisperer with Amazon SageMaker Studio
Change Log
1.0.12
- Bug fix: Bump dependency tough-cookie to 4.1.4 from 4.1.2 which is associated with a CVE
1.0.11
- Bug fix: Toggle off auto suggestion when plugin receives multiple AccessDeniedException
1.0.9
- Bug fix: Fix auto trigger issue when switching between .ipynb and .py
- Bug fix: Improved handling when Jupyter has no access to internet.
- Improvement: Migrated network call to be made asynchronously.
1.0.8
- Add EMR Studio Workspace support
- Bug fix: Only show update nudge for JL3 compatible releases.
- Bug fix: Fix client registration not being updated when it's expired
1.0.6
- Bug fix: Fix the insert position of native auto completion
- Bug fix: Make telemetry send API fail silently without raising exception
1.0.5
- Bug fix: Fail to enable extension in SageMaker Studio in VPC mode
- Bug fix: Documentation link in Glue Studio
1.0.4
- Add Glue Studio Notebook support
1.0.3
- Bug fix: No recommendation when user turn off code suggestions with references in settings.
- Bug fix: Issue with browser login flow for some Builder ID users.
- Bug fix: Fix an issue where SageMaker Studio users will incorrectly see the
Share content with Amazon CodeWhisperer
settings option.
1.0.0
- Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file amazon-codewhisperer-jupyterlab-ext-1.0.12.tar.gz
.
File metadata
- Download URL: amazon-codewhisperer-jupyterlab-ext-1.0.12.tar.gz
- Upload date:
- Size: 125.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81ccad8e1c50565711e882d1873e61337a3b4797a69f63f52ba74099f24d9f18 |
|
MD5 | 0dd4df559cce5dd9ce91102358e6f2df |
|
BLAKE2b-256 | a5a61e265e3d4cf80d1cb460740a7d3173eb70ec26f6633b7420b9b92aad0f99 |