Skip to content

Commit 2b55eea

Browse files
committed
fix usage
1 parent d8a83b3 commit 2b55eea

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { INotebookTracker } from '@jupyterlab/notebook';
1717
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
1818
import { ISettingRegistry } from '@jupyterlab/settingregistry';
1919

20-
import { PartialJSONValue } from '@lumino/coreutils';
2120
import { ChatHandler } from './chat-handler';
2221
import { getSettings } from './llm-models';
2322
import { AIProvider } from './provider';
@@ -203,15 +202,13 @@ const magicProviderPlugin: JupyterFrontEndPlugin<IMagicProvider> = {
203202
const events = app.serviceManager.events;
204203

205204
return {
206-
magic: async (
207-
cellId: string,
208-
codeInput: string,
209-
content: PartialJSONValue | undefined
210-
) => {
205+
magic: async (magicContext: IMagicProvider.IMagicContext) => {
206+
const { codeInput, cellId, content } = magicContext;
211207
const trimmedPrompt = codeInput.trim();
212208

213209
// TODO: taken from jupyterlab-magic-wand
214-
const PROMPT = 'The input below came from a code cell in Jupyter. If the input does not look like code, but instead a prompt, write code based on the prompt. Then, update the code to make it more efficient, add code comments, and respond with only the code and comments. Do not format the response using backticks or code block delimiters, just give the code that will be inserted into the cell directly.';
210+
const PROMPT =
211+
'The input below came from a code cell in Jupyter. If the input does not look like code, but instead a prompt, write code based on the prompt. Then, update the code to make it more efficient, add code comments, and respond with only the code and comments. Do not format the response using backticks or code block delimiters, just give the code that will be inserted into the cell directly.';
215212

216213
const messages = [
217214
new SystemMessage(PROMPT),

0 commit comments

Comments
 (0)