jupyterlab-codex
jupyterlab-codex copied to clipboard
How to mention API key on jupyterlab?
How to add an API key in JupyterLab: > settings->advanced settings I can see this icon under options -> advanced settings after installing jupyterlab-coded, but I'm not sure how to include the API key in the settings because it's not editable.
Also trying to figure this out. Where exactly should I specify the key. Short video/gif would help please
@monkeydust @kumarangithub6485 hey, you will need to turn on the user settings panel on the right side of the default settings to update the JSON.
I will include a screenshot in this issue and in the README in a few hours when I wake up.
@lhr0909, Thank you. Have you added the screenshot?. Actually I am here ->
@kumarangithub6485 you can go to the user preferences on the right hand side and put in the JSON values on the right pane. If you are not allowed to save, that means you might be missing some of the required fields or have a broken JSON format. I am also a bit new to JupyterLab extension building, so here is what I have and I was able to save and add my api key on the right.
@kumarangithub6485 by the way, I have just updated to 0.1.1 which you will see the completion come in line by line! Let me know if you have time to try it and see how it works on your end!
I does not work, OpenAI server is not getting my request. I get the following Error. I am running on GCP and tunneling it to my local machine.
JupyterLab server logs
``` [W 2021-09-22 08:37:44.975 ServerApp] 404 POST /jupyterlab-codex/completion?1632299865837 (::1) 25.10ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:37:56.773 ServerApp] 404 POST /jupyterlab-codex/completion?1632299877661 (::1) 1.86ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:38:34.267 ServerApp] 404 POST /jupyterlab-codex/completion?1632299915155 (::1) 1.64ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:38:45.942 ServerApp] 404 POST /jupyterlab-codex/completion?1632299926828 (::1) 1.82ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:38:47.975 ServerApp] 404 POST /jupyterlab-codex/completion?1632299928862 (::1) 1.90ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [I 2021-09-22 08:38:50.645 ServerApp] Kernel restarted: 3df28524-75d2-4f9b-b83e-2cf1b7a75f5d [I 2021-09-22 08:38:53.891 ServerApp] Kernel interrupted: 3df28524-75d2-4f9b-b83e-2cf1b7a75f5d [W 2021-09-22 08:39:19.919 ServerApp] 404 POST /jupyterlab-codex/completion?1632299960806 (::1) 2.12ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [I 2021-09-22 08:39:38.038 ServerApp] Saving file at /Untitled.ipynb [I 2021-09-22 08:41:38.160 ServerApp] Saving file at /Untitled.ipynb [W 2021-09-22 08:41:52.833 ServerApp] 404 POST /jupyterlab-codex/completion?1632300113722 (::1) 1.92ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:41:54.704 ServerApp] 404 POST /jupyterlab-codex/completion?1632300115594 (::1) 2.12ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:42:57.361 ServerApp] 404 POST /jupyterlab-codex/completion?1632300178252 (::1) 2.12ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [I 2021-09-22 08:43:38.284 ServerApp] Saving file at /Untitled.ipynb [W 2021-09-22 08:47:03.024 ServerApp] 404 POST /jupyterlab-codex/completion?1632300423920 (::1) 1.74ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:47:05.154 ServerApp] 404 POST /jupyterlab-codex/completion?1632300426050 (::1) 1.59ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:47:08.264 ServerApp] 404 POST /jupyterlab-codex/completion?1632300429160 (::1) 1.82ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:47:38.341 ServerApp] 404 POST /jupyterlab-codex/completion?1632300459235 (::1) 2.23ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [I 2021-09-22 08:47:38.396 ServerApp] Saving file at /Untitled.ipynb [W 2021-09-22 08:47:38.531 ServerApp] 404 POST /jupyterlab-codex/completion?1632300459425 (::1) 1.91ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [W 2021-09-22 08:47:38.658 ServerApp] 404 POST /jupyterlab-codex/completion?1632300459554 (::1) 1.77ms referer=http://localhost:8888/lab/tree/Untitled.ipynb [I 2021-09-22 08:49:38.513 ServerApp] Saving file at /Untitled.ipynb [I 2021-09-22 08:50:11.763 ServerApp] Kernel shutdown: 3df28524-75d2-4f9b-b83e-2cf1b7a75f5d [I 2021-09-22 08:50:48.646 ServerApp] Kernel started: e851663d-451a-4c56-8a25-408562fb01ff [I 2021-09-22 08:50:54.016 ServerApp] Starting buffering for e851663d-451a-4c56-8a25-408562fb01ff:1b7ae149-09c2-434f-a1fa-0ff6b70284df [I 2021-09-22 08:50:55.425 ServerApp] Creating new notebook in [I 2021-09-22 08:50:55.742 ServerApp] Kernel started: 750b958f-86c1-4dee-b727-10595f07fddd [W 2021-09-22 08:51:06.575 ServerApp] 404 POST /jupyterlab-codex/completion?1632300667473 (::1) 1.92ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [W 2021-09-22 08:51:29.062 ServerApp] 404 POST /jupyterlab-codex/completion?1632300689962 (::1) 2.06ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [W 2021-09-22 08:51:32.369 ServerApp] 404 POST /jupyterlab-codex/completion?1632300693269 (::1) 1.72ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [W 2021-09-22 08:51:32.726 ServerApp] 404 POST /jupyterlab-codex/completion?1632300693626 (::1) 1.62ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [W 2021-09-22 08:51:32.863 ServerApp] 404 POST /jupyterlab-codex/completion?1632300693763 (::1) 1.72ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [W 2021-09-22 08:51:33.005 ServerApp] 404 POST /jupyterlab-codex/completion?1632300693905 (::1) 1.63ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [W 2021-09-22 08:51:33.146 ServerApp] 404 POST /jupyterlab-codex/completion?1632300694047 (::1) 1.63ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [W 2021-09-22 08:51:33.290 ServerApp] 404 POST /jupyterlab-codex/completion?1632300694190 (::1) 1.79ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [W 2021-09-22 08:51:33.417 ServerApp] 404 POST /jupyterlab-codex/completion?1632300694313 (::1) 1.64ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [W 2021-09-22 08:51:48.783 ServerApp] 404 POST /jupyterlab-codex/completion?1632300709684 (::1) 1.70ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [I 2021-09-22 08:52:55.666 ServerApp] Saving file at /Untitled1.ipynb [I 2021-09-22 08:53:26.934 ServerApp] Saving file at /Untitled1.ipynb [W 2021-09-22 08:54:15.375 ServerApp] 404 POST /jupyterlab-codex/completion?1632300856275 (::1) 1.88ms referer=http://localhost:8888/lab/tree/Untitled1.ipynb [I 2021-09-22 08:54:34.463 ServerApp] Starting buffering for 750b958f-86c1-4dee-b727-10595f07fddd:e7088c12-1b89-4532-af13-68f1393668d8 [I 2021-09-22 08:54:36.058 ServerApp] Creating new notebook in [I 2021-09-22 08:54:36.371 ServerApp] Kernel started: 60c70768-446e-48be-bf0a-d80fa2417477 [W 2021-09-22 08:54:53.655 ServerApp] 404 POST /jupyterlab-codex/completion?1632300894557 (::1) 2.02ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:54:55.440 ServerApp] 404 POST /jupyterlab-codex/completion?1632300896343 (::1) 1.61ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:54:55.563 ServerApp] 404 POST /jupyterlab-codex/completion?1632300896466 (::1) 1.60ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:54:55.687 ServerApp] 404 POST /jupyterlab-codex/completion?1632300896589 (::1) 1.62ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:54:55.817 ServerApp] 404 POST /jupyterlab-codex/completion?1632300896720 (::1) 1.70ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:54:55.942 ServerApp] 404 POST /jupyterlab-codex/completion?1632300896844 (::1) 2.01ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:54:56.087 ServerApp] 404 POST /jupyterlab-codex/completion?1632300896990 (::1) 1.62ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [I 2021-09-22 08:55:50.642 ServerApp] Kernel shutdown: e851663d-451a-4c56-8a25-408562fb01ff [I 2021-09-22 08:55:52.768 ServerApp] Kernel shutdown: 750b958f-86c1-4dee-b727-10595f07fddd [W 2021-09-22 08:56:10.000 ServerApp] 404 POST /jupyterlab-codex/completion?1632300970904 (::1) 1.71ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:56:10.246 ServerApp] 404 POST /jupyterlab-codex/completion?1632300971150 (::1) 1.78ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:56:10.375 ServerApp] 404 POST /jupyterlab-codex/completion?1632300971278 (::1) 1.75ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:56:10.521 ServerApp] 404 POST /jupyterlab-codex/completion?1632300971424 (::1) 1.66ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:56:10.623 ServerApp] 404 POST /jupyterlab-codex/completion?1632300971527 (::1) 1.61ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 08:56:10.778 ServerApp] 404 POST /jupyterlab-codex/completion?1632300971682 (::1) 1.66ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [I 2021-09-22 08:56:36.308 ServerApp] Saving file at /Untitled2.ipynb [W 2021-09-22 09:00:29.108 ServerApp] 404 POST /jupyterlab-codex/completion?1632301230016 (::1) 1.87ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:01:35.930 ServerApp] delete /Untitled1.ipynb [W 2021-09-22 09:01:40.347 ServerApp] delete /Untitled.ipynb [W 2021-09-22 09:02:07.874 ServerApp] 404 POST /jupyterlab-codex/completion?1632301328784 (::1) 1.84ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [I 2021-09-22 09:02:13.903 ServerApp] Saving file at /Untitled2.ipynb [W 2021-09-22 09:02:15.409 ServerApp] 404 POST /jupyterlab-codex/completion?1632301336318 (::1) 1.71ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:05:19.399 ServerApp] 404 POST /jupyterlab-codex/completion?1632301520310 (::1) 2.02ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:05:30.099 ServerApp] 404 POST /jupyterlab-codex/completion?1632301531011 (::1) 1.64ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:05:32.547 ServerApp] 404 POST /jupyterlab-codex/completion?1632301533458 (::1) 1.80ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:05:32.703 ServerApp] 404 POST /jupyterlab-codex/completion?1632301533615 (::1) 1.84ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:05:32.827 ServerApp] 404 POST /jupyterlab-codex/completion?1632301533740 (::1) 1.64ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:05:32.987 ServerApp] 404 POST /jupyterlab-codex/completion?1632301533899 (::1) 1.67ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:06:09.653 ServerApp] 404 POST /jupyterlab-codex/completion?1632301570566 (::1) 1.88ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [I 2021-09-22 09:06:14.034 ServerApp] Saving file at /Untitled2.ipynb [W 2021-09-22 09:06:23.142 ServerApp] 404 POST /jupyterlab-codex/completion?1632301584054 (::1) 1.75ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [I 2021-09-22 09:08:14.147 ServerApp] Saving file at /Untitled2.ipynb [W 2021-09-22 09:13:08.718 ServerApp] 404 POST /jupyterlab-codex/completion?1632301989637 (::1) 1.78ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:15:53.218 ServerApp] 404 POST /jupyterlab-codex/completion?1632302154137 (::1) 1.72ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:16:06.515 ServerApp] 404 POST /jupyterlab-codex/completion?1632302167436 (::1) 1.76ms referer=http://localhost:8888/doc/tree/Untitled2.ipynb [I 2021-09-22 09:16:19.537 ServerApp] Kernel shutdown: 60c70768-446e-48be-bf0a-d80fa2417477 [I 2021-09-22 09:16:19.807 ServerApp] Kernel started: b31a240f-389a-4126-acf1-66e05afe6b60 [W 2021-09-22 09:16:31.642 ServerApp] 404 POST /jupyterlab-codex/completion?1632302192565 (::1) 2.18ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [I 2021-09-22 09:17:04.734 ServerApp] Kernel restarted: b31a240f-389a-4126-acf1-66e05afe6b60 [I 2021-09-22 09:17:05.494 ServerApp] Starting buffering for b31a240f-389a-4126-acf1-66e05afe6b60:9187bc00-0a69-4d89-bf88-d7c815def958 [I 2021-09-22 09:17:05.543 ServerApp] Restoring connection for b31a240f-389a-4126-acf1-66e05afe6b60:9187bc00-0a69-4d89-bf88-d7c815def958 [W 2021-09-22 09:17:07.635 ServerApp] 404 POST /jupyterlab-codex/completion?1632302228555 (::1) 1.94ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:17:07.903 ServerApp] 404 POST /jupyterlab-codex/completion?1632302228826 (::1) 1.71ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:17:08.013 ServerApp] 404 POST /jupyterlab-codex/completion?1632302228936 (::1) 1.62ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:17:08.149 ServerApp] 404 POST /jupyterlab-codex/completion?1632302229072 (::1) 1.62ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:17:08.291 ServerApp] 404 POST /jupyterlab-codex/completion?1632302229213 (::1) 1.63ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:17:14.889 ServerApp] 404 POST /jupyterlab-codex/completion?1632302235812 (::1) 1.91ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [W 2021-09-22 09:17:18.993 ServerApp] 404 POST /jupyterlab-codex/completion?1632302239903 (::1) 1.71ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [I 2021-09-22 09:18:14.311 ServerApp] Saving file at /Untitled2.ipynb [I 2021-09-22 09:19:23.237 ServerApp] Starting buffering for b31a240f-389a-4126-acf1-66e05afe6b60:9187bc00-0a69-4d89-bf88-d7c815def958 [I 2021-09-22 09:19:28.562 ServerApp] Kernel started: 640cfe38-22a7-4589-b3db-df6420947d57 [I 2021-09-22 09:19:35.067 ServerApp] Starting buffering for 640cfe38-22a7-4589-b3db-df6420947d57:1a4040f4-6b86-4fce-87b2-b415de2a5fa2 [I 2021-09-22 09:19:37.570 ServerApp] Kernel shutdown: 640cfe38-22a7-4589-b3db-df6420947d57 [W 2021-09-22 09:19:39.189 ServerApp] Notebook Untitled2.ipynb is not trusted [W 2021-09-22 09:19:56.210 ServerApp] 404 POST /jupyterlab-codex/completion?1632302397127 (::1) 2.11ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb [I 2021-09-22 09:20:07.191 ServerApp] Starting buffering for b31a240f-389a-4126-acf1-66e05afe6b60:e99e5bf9-db31-4757-98be-7a03e5eb08c2 ```
@renanmb Hey I noticed in the server logs you provided, the server endpoint returns 404. You may need to restart the jupyter lab server after installing the plugin. The plugin uses a server module that posts the request from the jupyter lab server side to OpenAI. Let me know if you have tried it.
It certainly is not about restarting the server. I believe it is a security issue.
[I 2021-09-22 19:00:03.921 ServerApp] 302 GET / (::1) 0.61ms
[W 2021-09-22 19:00:07.030 LabApp] Could not determine jupyterlab build status without nodejs
[W 2021-09-22 19:00:08.247 ServerApp] Notebook Untitled2.ipynb is not trusted
[I 2021-09-22 19:00:08.739 ServerApp] Kernel started: c9114e1c-70b4-4791-b32d-35aae6dbc686
[W 2021-09-22 19:00:12.470 ServerApp] 404 POST /jupyterlab-codex/completion?1632337212823 (::1) 26.81ms referer=http://localhost:8888/lab/tree/Untitled2.ipynb
Go to JupyterLab: > settings->advanced settings select jupyterlab-codex in User Preferences add an API key