26include_once DOL_DOCUMENT_ROOT.
'/ai/class/ai.class.php';
38 $arrayofaifeatures = array(
39 'textgenerationemail' => array(
'label' => $langs->trans(
'TextGeneration').
' ('.$langs->trans(
"EmailContent").
')',
'picto' =>
'',
'status' =>
'dolibarr',
'function' =>
'TEXT',
'placeholder' => Ai::AI_DEFAULT_PROMPT_FOR_EMAIL),
40 'textgenerationwebpage' => array(
'label' => $langs->trans(
'TextGeneration').
' ('.$langs->trans(
"WebsitePage").
')',
'picto' =>
'',
'status' =>
'dolibarr',
'function' =>
'TEXT',
'placeholder' => Ai::AI_DEFAULT_PROMPT_FOR_WEBPAGE),
41 'textgeneration' => array(
'label' => $langs->trans(
'TextGeneration').
' ('.$langs->trans(
"Other").
')',
'picto' =>
'',
'status' =>
'notused',
'function' =>
'TEXT'),
43 'texttranslation' => array(
'label' => $langs->trans(
'TextTranslation'),
'picto' =>
'',
'status'=>
'dolibarr',
'function' =>
'TEXT',
'placeholder' => Ai::AI_DEFAULT_PROMPT_FOR_TEXT_TRANSLATION),
44 'textsummarize' => array(
'label' => $langs->trans(
'TextSummarize'),
'picto' =>
'',
'status'=>
'dolibarr',
'function' =>
'TEXT',
'placeholder' => Ai::AI_DEFAULT_PROMPT_FOR_TEXT_SUMMARIZE),
45 'textrephrase' => array(
'label' => $langs->trans(
'TextRephraser'),
'picto' =>
'',
'status'=>
'dolibarr',
'function' =>
'TEXT',
'placeholder' => Ai::AI_DEFAULT_PROMPT_FOR_TEXT_REPHRASER),
47 'textgenerationextrafield' => array(
'label' => $langs->trans(
'TextGeneration').
' ('.$langs->trans(
"ExtrafieldFiller").
')',
'picto' =>
'',
'status'=>
'dolibarr',
'function' =>
'TEXT',
'placeholder' => Ai::AI_DEFAULT_PROMPT_FOR_EXTRAFIELD_FILLER),
49 'imagegeneration' => array(
'label' =>
'ImageGeneration',
'picto' =>
'',
'status' =>
'notused',
'function' =>
'IMAGE'),
50 'videogeneration' => array(
'label' =>
'VideoGeneration',
'picto' =>
'',
'status' =>
'notused',
'function' =>
'VIDEO'),
51 'audiogeneration' => array(
'label' =>
'AudioGeneration',
'picto' =>
'',
'status' =>
'notused',
'function' =>
'AUDIO'),
52 'transcription' => array(
'label' =>
'AudioTranscription',
'picto' =>
'',
'status' =>
'notused',
'function' =>
'TRANSCRIPT'),
53 'translation' => array(
'label' =>
'AudioTranslation',
'picto' =>
'',
'status' =>
'notused',
'function' =>
'TRANSLATE')
56 return $arrayofaifeatures;
69 '-1' => array(
'label' => $langs->trans(
'SelectAService')),
72 'url' =>
'https://api.openai.com/v1/',
73 'textgeneration' =>
'gpt-3.5-turbo',
74 'imagegeneration' =>
'dall-e-3',
75 'audiogeneration' =>
'tts-1',
76 'videogeneration' =>
'na',
77 'transcription' =>
'whisper-1',
78 'translation' =>
'whisper-1',
82 'url' =>
'https://api.groq.com/openai/',
83 'textgeneration' =>
'mixtral-8x7b-32768',
84 'imagegeneration' =>
'na',
85 'audiogeneration' =>
'na',
86 'videogeneration' =>
'na',
87 'transcription' =>
'na',
88 'translation' =>
'na',
92 'url' =>
'https://api.mistral.ai/v1/',
93 'textgeneration' =>
'open-mistral-7b',
94 'imagegeneration' =>
'na',
95 'audiogeneration' =>
'na',
96 'videogeneration' =>
'na',
97 'transcription' =>
'na',
98 'translation' =>
'na',
102 'url' =>
'https://domainofapi.com/v1/',
103 'textgeneration' =>
'tinyllama-1.1b',
104 'imagegeneration' =>
'mixtral-8x7b-32768',
105 'audiogeneration' =>
'mixtral-8x7b-32768',
106 'videogeneration' =>
'na',
107 'transcription' =>
'mixtral-8x7b-32768',
108 'translation' =>
'mixtral-8x7b-32768',
128 $arrayforaisummarize = array(
130 '50_w' =>
'SummarizeFiftyWords',
131 '100_w' =>
'SummarizeHundredWords',
132 '200_w' =>
'SummarizeTwoHundredWords',
133 '1_p' =>
'SummarizeOneParagraphs',
134 '2_p' =>
'SummarizeTwoParagraphs',
135 '25_pc' =>
'SummarizeTwentyFivePercent',
136 '50_pc' =>
'SummarizeFiftyPercent',
137 '75_pc' =>
'SummarizeSeventyFivePercent'
140 return $arrayforaisummarize;
150 $arrayforaierephrasestyle = array(
151 'professional' =>
'RephraseStyleProfessional',
152 'humouristic' =>
'RephraseStyleHumouristic'
155 return $arrayforaierephrasestyle;
165 global $langs,
$conf;
167 $langs->load(
"agenda");
173 $head[$h][1] = $langs->trans(
"Settings");
174 $head[$h][2] =
'settings';
177 $head[$h][0] =
dol_buildpath(
"/ai/admin/custom_prompt.php", 1);
178 $head[$h][1] = $langs->trans(
"CustomPrompt");
179 $head[$h][2] =
'custom';
getListOfAIFeatures()
Prepare admin pages header.
aiAdminPrepareHead()
Prepare admin pages header.
getListOfAIServices()
Get list of available ai services.
getListForAIRephraseStyle()
Get list for AI style of writing.
getListForAISummarize()
Get list for AI summarize.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...