Package: amazon-codewhisperer-jupyterlab-ext
Amazon CodeWhisperer for JupyterLabAmazon 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.RequirementsIn order to use CodeWhisperer in JupyterLab, you must have a version of JupyterLab >= 4 installed. The previous major version of CodeWhisperer 1.x extension supports JupyterLab >= 3.5, <4. You will also need a freeAWS Builder IDaccount 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 StartedInstallJupyterLabon your computer or if you already have JupyterLab installed, check it’s version by running the following command.pip show jupyterlabNote the version in the response, and follow the use the corresponding directions in one of the following sections.Installation Using Pip for Jupyter Lab version >= 4.0You can install and enable the CodeWhisperer extension for JupyterLab 4 with the following commands.# JupyterLab 4
pip install amazon-codewhisperer-jupyterlab-extInstallation Using Pip for Jupyter Lab version >= 3.6 and < 4.0You can install and enable the CodeWhisperer 1.x extension for JupyterLab 3 with the following commands.# JupyterLab 3
pip install amazon-codewhisperer-jupyterlab-ext~=1.0
jupyter server extension enable amazon_codewhisperer_jupyterlab_extOnce installed, chooseStart CodeWhispererfrom the CodeWhisperer panel at the bottom of the window. This will enable to you log in toAWS Builder IDto access CodeWhisperer. Refer toSetting up CodeWhisperer with JupyterLabfor detailed setup instructions.SageMaker StudioTo setup the CodeWhisperer extension with a SageMaker Studio notebook instance, you must add IAM Permissions forcodewhisperer:GenerateRecommendationsfor your user profile. Then you must install and enable the extension with the following commands.conda activate studio
pip install amazon-codewhisperer-jupyterlab-ext~=1.0
jupyter server extension enable amazon_codewhisperer_jupyterlab_ext
conda deactivate
restart-jupyter-serverAfter you complete installation and refresh your browser, a CodeWhisperer panel will appear at the bottom of the window. Refer toSetting up CodeWhisperer with SageMaker Studiofor detailed setup instructions.FeaturesCode CompletionCodeWhisperer for JupyterLab provides AI powered suggestions as ghost text with the following default keybindings. These can be modified in the settings.ActionKey BindingManually trigger CodeWhispererAlt C (Window) / ⌥ C (Mac)Accept a recommendationTabNext recommendationRight arrowPrevious recommendationLeft arrowReject a recommendationESCPython 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 ReferencesWith 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, chooseOpen Code Reference Logfrom the CodeWhisperer panel at the bottom of the window. Users can also turn off code suggestions with code references in Settings.More ResourcesCodeWhisperer User GuideSetting up Amazon CodeWhisperer with JupyterLabSetting up CodeWhisperer with Amazon SageMaker StudioChange Log2.0.1Improved handling when Jupyter has no access to internet.Migrated network call to be made asynchronously.2.0.0Initial release - Adoption of JupyterLab 4