milwright commited on
Commit
6174db0
·
1 Parent(s): 47a380e

fix: correct AI contextualization method call

Browse files

- Fix method name from generateContextualization to getContextualization
- Pass passage excerpt (first 200 chars) as required third parameter
- This should fix the metadata field showing fallback text

Files changed (1) hide show
  1. src/clozeGameEngine.js +3 -2
src/clozeGameEngine.js CHANGED
@@ -333,9 +333,10 @@ class ClozeGame {
333
  async generateContextualization() {
334
  // Always use AI for contextualization
335
  try {
336
- this.contextualization = await aiService.generateContextualization(
337
  this.currentBook.title,
338
- this.currentBook.author
 
339
  );
340
  return this.contextualization;
341
  } catch (error) {
 
333
  async generateContextualization() {
334
  // Always use AI for contextualization
335
  try {
336
+ this.contextualization = await aiService.getContextualization(
337
  this.currentBook.title,
338
+ this.currentBook.author,
339
+ this.originalText.substring(0, 200) // Pass first 200 chars of passage
340
  );
341
  return this.contextualization;
342
  } catch (error) {