From ffd33515604b1eb3233afbe2fbc1e257959a5631 Mon Sep 17 00:00:00 2001 From: Agustin Z Date: Fri, 15 Mar 2024 15:06:50 -0300 Subject: [PATCH 1/2] Added the fitzgerald key to the response, this needs to be processed in the UI to show the right color, in the issue it is a table to match them. --- run.ts | 12 ++++++------ src/engine.ts | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/run.ts b/run.ts index d4dd82e..d8920c6 100644 --- a/run.ts +++ b/run.ts @@ -27,8 +27,8 @@ const engineInstance = initEngine({ pictonizerConfiguration, }); -const prompt = "animals"; -const maxSuggestions = 30; +const prompt = "good morning"; +const maxSuggestions = 5; const symbolSet = "arasaac"; const language = "eng"; @@ -43,12 +43,12 @@ engineInstance .then((suggestions) => console.log( "\nSuggestions -----------------------------------------------\n", - suggestions, - "length: "+suggestions.length + "label: " + suggestions[1].label, + "images: " + JSON.stringify(suggestions[1].pictogram.images), ) ); -// Get suggestions with GlobalSymbol and Pictonizer images +/* // Get suggestions with GlobalSymbol and Pictonizer images engineInstance .getSuggestionsAndProcessPictograms({ prompt, @@ -69,4 +69,4 @@ engineInstance.pictonizer("dog").then((image) => { "Pictonizer image -----------------------------------------------\n" ); console.dir(image, { depth: null }); -}); +}); */ diff --git a/src/engine.ts b/src/engine.ts index c66daf5..3c81da0 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -25,6 +25,7 @@ export type Suggestion = { id: string; symbolSet: string; url: string; + fitzgerald: string; }[] | AIImage[]; }; @@ -141,6 +142,7 @@ async function fetchPictogramsURLs({ id: label.id.toString(), symbolSet: label.picto.symbolset_id.toString(), url: label.picto.image_url, + fitzgerald: label.picto.part_of_speech, })), }, }; From 15d682047e922666ae23eb4fcacaa7e4a805f2d9 Mon Sep 17 00:00:00 2001 From: Agustin Z Date: Fri, 15 Mar 2024 17:16:01 -0300 Subject: [PATCH 2/2] Remove logs. --- run.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/run.ts b/run.ts index d8920c6..fa98b1d 100644 --- a/run.ts +++ b/run.ts @@ -43,12 +43,11 @@ engineInstance .then((suggestions) => console.log( "\nSuggestions -----------------------------------------------\n", - "label: " + suggestions[1].label, - "images: " + JSON.stringify(suggestions[1].pictogram.images), + suggestions ) ); -/* // Get suggestions with GlobalSymbol and Pictonizer images +// Get suggestions with GlobalSymbol and Pictonizer images engineInstance .getSuggestionsAndProcessPictograms({ prompt, @@ -69,4 +68,4 @@ engineInstance.pictonizer("dog").then((image) => { "Pictonizer image -----------------------------------------------\n" ); console.dir(image, { depth: null }); -}); */ +});