diff --git a/htdocs/ai/lib/ai.lib.php b/htdocs/ai/lib/ai.lib.php index 0762a24e0d5..dc6804b7820 100644 --- a/htdocs/ai/lib/ai.lib.php +++ b/htdocs/ai/lib/ai.lib.php @@ -84,7 +84,10 @@ function getListForAISummarize() '100_w' => 'SummarizeHundredWords', '200_w' => 'SummarizeTwoHundredWords', '1_p' => 'SummarizeOneParagraphs', - '2_p' => 'SummarizeTwoParagraphs' + '2_p' => 'SummarizeTwoParagraphs', + '25_pc' => 'SummarizeTwentyFivePercent', + '50_pc' => 'SummarizeFiftyPercent', + '75_pc' => 'SummarizeSeventyFivePercent' ); return $arrayforaisummarize; diff --git a/htdocs/core/class/html.formai.class.php b/htdocs/core/class/html.formai.class.php index eda1d8977e0..1cb1d8396fa 100644 --- a/htdocs/core/class/html.formai.class.php +++ b/htdocs/core/class/html.formai.class.php @@ -231,12 +231,15 @@ class FormAI extends Form case 'p': unit = 'paragraphs'; break; + case 'pc': + unit = 'percent'; + break; default: console.log('unit not found so we choose words'); unit = 'words'; break; } - instructions = 'Summarize the following text in ' + width + ' ' + unit + ': ' + texttomodify; + instructions = 'Summarize the following text '+ (unit == 'percent' ? 'by ' : 'in') + width + ' ' + unit + ': ' + texttomodify; }else { instructions = userprompt; } diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index ec9db4ac0a7..29f1413e10d 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -364,6 +364,9 @@ SummarizeFiftyWords=50 words SummarizeHundredWords=100 words SummarizeTwoHundredWords=200 words SummarizeOneParagraphs=1 paragraph -SummarizeTwoParagraphs=2 Paragraphs +SummarizeTwoParagraphs=2 paragraphs +SummarizeTwentyFivePercent=25%% +SummarizeFiftyPercent=50%% +SummarizeSeventyFivePercent=75%% TextSummarize=Text summarize AIEnhancements=AI Enhancements