mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Fix add percent to Summarize feature (#33731)
* Fix add percent to Summarize feature * fix
This commit is contained in:
committed by
GitHub
parent
8b1d8d7d19
commit
dce77a84b1
@@ -84,7 +84,10 @@ function getListForAISummarize()
|
|||||||
'100_w' => 'SummarizeHundredWords',
|
'100_w' => 'SummarizeHundredWords',
|
||||||
'200_w' => 'SummarizeTwoHundredWords',
|
'200_w' => 'SummarizeTwoHundredWords',
|
||||||
'1_p' => 'SummarizeOneParagraphs',
|
'1_p' => 'SummarizeOneParagraphs',
|
||||||
'2_p' => 'SummarizeTwoParagraphs'
|
'2_p' => 'SummarizeTwoParagraphs',
|
||||||
|
'25_pc' => 'SummarizeTwentyFivePercent',
|
||||||
|
'50_pc' => 'SummarizeFiftyPercent',
|
||||||
|
'75_pc' => 'SummarizeSeventyFivePercent'
|
||||||
);
|
);
|
||||||
|
|
||||||
return $arrayforaisummarize;
|
return $arrayforaisummarize;
|
||||||
|
|||||||
@@ -231,12 +231,15 @@ class FormAI extends Form
|
|||||||
case 'p':
|
case 'p':
|
||||||
unit = 'paragraphs';
|
unit = 'paragraphs';
|
||||||
break;
|
break;
|
||||||
|
case 'pc':
|
||||||
|
unit = 'percent';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
console.log('unit not found so we choose words');
|
console.log('unit not found so we choose words');
|
||||||
unit = 'words';
|
unit = 'words';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
instructions = 'Summarize the following text in ' + width + ' ' + unit + ': ' + texttomodify;
|
instructions = 'Summarize the following text '+ (unit == 'percent' ? 'by ' : 'in') + width + ' ' + unit + ': ' + texttomodify;
|
||||||
}else {
|
}else {
|
||||||
instructions = userprompt;
|
instructions = userprompt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -364,6 +364,9 @@ SummarizeFiftyWords=50 words
|
|||||||
SummarizeHundredWords=100 words
|
SummarizeHundredWords=100 words
|
||||||
SummarizeTwoHundredWords=200 words
|
SummarizeTwoHundredWords=200 words
|
||||||
SummarizeOneParagraphs=1 paragraph
|
SummarizeOneParagraphs=1 paragraph
|
||||||
SummarizeTwoParagraphs=2 Paragraphs
|
SummarizeTwoParagraphs=2 paragraphs
|
||||||
|
SummarizeTwentyFivePercent=25%%
|
||||||
|
SummarizeFiftyPercent=50%%
|
||||||
|
SummarizeSeventyFivePercent=75%%
|
||||||
TextSummarize=Text summarize
|
TextSummarize=Text summarize
|
||||||
AIEnhancements=AI Enhancements
|
AIEnhancements=AI Enhancements
|
||||||
|
|||||||
Reference in New Issue
Block a user