File tree Expand file tree Collapse file tree 3 files changed +19
-12
lines changed
Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -355,7 +355,11 @@ export class AICellTracker implements IAICellTracker {
355355
356356 const codeInput = cell ?. model ?. sharedModel . getSource ( ) ?? '' ;
357357 const content = currentNotebook ?. content . model ?. toJSON ( ) ;
358- await this . _magicProvider . magic ( cellId , codeInput , content ) ;
358+ await this . _magicProvider . magic ( {
359+ cellId,
360+ codeInput,
361+ content
362+ } ) ;
359363
360364 this . _commandRegistry . notifyCommandChanged ( this . commandId ) ;
361365 }
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ import { IEventListener } from 'jupyterlab-eventlistener';
1818import { ICellFooterTracker } from 'jupyterlab-cell-input-footer' ;
1919import { requestAPI } from './handler' ;
2020import { IMagicProvider } from './provider' ;
21- import { PartialJSONValue } from '@lumino/coreutils' ;
2221
2322const PLUGIN_ID = 'jupyterlab_magic_wand' ;
2423
@@ -138,11 +137,11 @@ const magicProviderPlugin: JupyterFrontEndPlugin<IMagicProvider> = {
138137 provides : IMagicProvider ,
139138 activate : async app => {
140139 return {
141- magic : async (
142- cellId : string ,
143- codeInput : string ,
144- content : PartialJSONValue | undefined
145- ) => {
140+ magic : async ( {
141+ codeInput ,
142+ content ,
143+ cellId
144+ } : IMagicProvider . IMagicContext ) => {
146145 // Make the request.
147146 requestAPI ( '/api/ai/magic' , {
148147 method : 'POST' ,
Original file line number Diff line number Diff line change @@ -5,9 +5,13 @@ export const IMagicProvider = new Token<IMagicProvider>(
55) ;
66
77export interface IMagicProvider {
8- magic (
9- cellId : string ,
10- codeInput : string ,
11- content : PartialJSONValue | undefined
12- ) : Promise < void > ;
8+ magic ( context : IMagicProvider . IMagicContext ) : Promise < void > ;
9+ }
10+
11+ export namespace IMagicProvider {
12+ export interface IMagicContext {
13+ cellId : string ;
14+ codeInput : string ;
15+ content : PartialJSONValue | undefined ;
16+ }
1317}
You can’t perform that action at this time.
0 commit comments