Skip to content

Commit

Permalink
fix: fixing llmsummarize plugin options
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjmpb committed Sep 27, 2024
1 parent fc16ac6 commit 651968a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions lms/static/js/edxnotes/plugins/llm_summarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@
let annotator = this.annotator;
document.head.appendChild(style);
this.modifyDom(this.annotator);
annotator.editor.options.llmSummarize = {
courseId: annotator.options.llmSummarize.courseId,
}
annotator.editor.options.llmSummarize = annotator.options.llmSummarize
const summarizeButton = document.getElementById('summarizeButton');

summarizeButton.addEventListener('click', function(ev) {
Expand Down Expand Up @@ -117,7 +115,7 @@
},
body: JSON.stringify({
text_to_summarize: annotation.quote,
course_id: editor.options?.llmSummarize.courseId,
course_id: editor.options?.llmSummarize?.courseId,
}),
});

Expand Down
6 changes: 3 additions & 3 deletions lms/static/js/edxnotes/views/notes_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
}
},
llmSummarize: {
isEnabled: params.llmSummarize.isEnabled,
courseId: params.llmSummarize.courseId,
isEnabled: params?.llmSummarize?.isEnabled,
courseId: params?.llmSummarize?.courseId,
},
};
};
Expand Down Expand Up @@ -89,7 +89,7 @@
logger = NotesLogger.getLogger(element.id, params.debug),
annotator;

if (options.llmSummarize?.isEnabled) plugins.push('LlmSummarize')
if (options?.llmSummarize?.isEnabled) plugins.push('LlmSummarize')
annotator = $el.annotator(options).data('annotator');
setupPlugins(annotator, plugins, options);
NotesCollector.storeNotesRequestData(
Expand Down

0 comments on commit 651968a

Please sign in to comment.