@@ -30,7 +30,7 @@ func (m *LlmModule) GenerateNotebook(ctx context.Context, body io.Reader) (*http
3030 return nil , fmt .Errorf ("failed to read request body: %w" , err )
3131 }
3232
33- var requestData map [string ]interface {}
33+ var requestData map [string ]any
3434 if err := json .Unmarshal (bodyBytes , & requestData ); err != nil {
3535 return nil , fmt .Errorf ("failed to decode request body as JSON: %w" , err )
3636 }
@@ -54,7 +54,7 @@ func (m *LlmModule) ModifyNotebook(ctx context.Context, sessionID string, body i
5454 return nil , fmt .Errorf ("failed to read request body: %w" , err )
5555 }
5656
57- var requestData map [string ]interface {}
57+ var requestData map [string ]any
5858 if err := json .Unmarshal (bodyBytes , & requestData ); err != nil {
5959 return nil , fmt .Errorf ("failed to decode request body as JSON: %w" , err )
6060 }
@@ -67,12 +67,12 @@ func (m *LlmModule) ModifyNotebook(ctx context.Context, sessionID string, body i
6767 return nil , fmt .Errorf ("request body must contain a non-empty 'instruction' string" )
6868 }
6969
70- currentNotebook , ok := requestData ["current_notebook " ].(map [string ]interface {} )
70+ currentNotebook , ok := requestData ["notebook " ].(map [string ]any )
7171 if ! ok {
72- return nil , fmt .Errorf ("request body must contain a 'current_notebook ' object" )
72+ return nil , fmt .Errorf ("request body must contain a 'notebook ' object" )
7373 }
74- if _ , ok := currentNotebook ["cells" ].([]interface {} ); ! ok {
75- return nil , fmt .Errorf ("'current_notebook ' object must contain a 'cells' array" )
74+ if _ , ok := currentNotebook ["cells" ].([]any ); ! ok {
75+ return nil , fmt .Errorf ("'notebook ' object must contain a 'cells' array" )
7676 }
7777
7878 return m .Repo .ModifyNotebook (ctx , bytes .NewBuffer (bodyBytes ))
@@ -85,7 +85,7 @@ func (m *LlmModule) FixNotebook(ctx context.Context, sessionID string, body io.R
8585 return nil , fmt .Errorf ("failed to read request body: %w" , err )
8686 }
8787
88- var requestData map [string ]interface {}
88+ var requestData map [string ]any
8989 if err := json .Unmarshal (bodyBytes , & requestData ); err != nil {
9090 return nil , fmt .Errorf ("failed to decode request body as JSON: %w" , err )
9191 }
@@ -98,18 +98,18 @@ func (m *LlmModule) FixNotebook(ctx context.Context, sessionID string, body io.R
9898 return nil , fmt .Errorf ("request body must contain a non-empty 'traceback' string" )
9999 }
100100
101- currentNotebook , ok := requestData ["current_notebook " ].(map [string ]interface {} )
101+ currentNotebook , ok := requestData ["notebook " ].(map [string ]any )
102102 if ! ok {
103- return nil , fmt .Errorf ("request body must contain a 'current_notebook ' object" )
103+ return nil , fmt .Errorf ("request body must contain a 'notebook ' object" )
104104 }
105- if _ , ok := currentNotebook ["cells" ].([]interface {} ); ! ok {
106- return nil , fmt .Errorf ("'current_notebook ' object must contain a 'cells' array" )
105+ if _ , ok := currentNotebook ["cells" ].([]any ); ! ok {
106+ return nil , fmt .Errorf ("'notebook ' object must contain a 'cells' array" )
107107 }
108108
109109 return m .Repo .FixNotebook (ctx , bytes .NewBuffer (bodyBytes ))
110110}
111111
112- func IsUserIDandNotebookIDPresent (requestData map [string ]interface {} ) error {
112+ func IsUserIDandNotebookIDPresent (requestData map [string ]any ) error {
113113 // TODO: User ID should not be passed in the body.
114114 // TODO: It should be extracted from the auth context, which i am not going to do now :)
115115 // making sure user_id and notebook_id are present
0 commit comments