Spaces:
Running
Running
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
- 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.
|
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) {
|