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 'setup' =>
'https://platform.openai.com/account/api-keys',
74 'textgeneration' =>
'gpt-4.1-turbo',
75 'imagegeneration' =>
'dall-e-3',
76 'audiogeneration' =>
'tts-1',
77 'videogeneration' =>
'na',
78 'transcription' =>
'whisper-1',
79 'translation' =>
'whisper-1',
83 'url' =>
'https://api.groq.com/openai/',
84 'setup' =>
'https://platform.groq.com/signup',
85 'textgeneration' =>
'mixtral-8x7b-32768',
86 'imagegeneration' =>
'na',
87 'audiogeneration' =>
'na',
88 'videogeneration' =>
'na',
89 'transcription' =>
'na',
90 'translation' =>
'na',
94 'url' =>
'https://api.mistral.ai/v1/',
95 'setup' =>
'https://console.mistral.ai/',
96 'textgeneration' =>
'open-mistral-7b',
97 'imagegeneration' =>
'na',
98 'audiogeneration' =>
'na',
99 'videogeneration' =>
'na',
100 'transcription' =>
'na',
101 'translation' =>
'na',
105 'url' =>
'https://domainofapi.com/v1/',
106 'setup' =>
'Ask your AI provider how to get your API key',
107 'textgeneration' =>
'tinyllama-1.1b',
108 'imagegeneration' =>
'mixtral-8x7b-32768',
109 'audiogeneration' =>
'mixtral-8x7b-32768',
110 'videogeneration' =>
'na',
111 'transcription' =>
'mixtral-8x7b-32768',
112 'translation' =>
'mixtral-8x7b-32768',
132 $arrayforaisummarize = array(
134 '50_w' =>
'SummarizeFiftyWords',
135 '100_w' =>
'SummarizeHundredWords',
136 '200_w' =>
'SummarizeTwoHundredWords',
137 '1_p' =>
'SummarizeOneParagraphs',
138 '2_p' =>
'SummarizeTwoParagraphs',
139 '25_pc' =>
'SummarizeTwentyFivePercent',
140 '50_pc' =>
'SummarizeFiftyPercent',
141 '75_pc' =>
'SummarizeSeventyFivePercent'
144 return $arrayforaisummarize;
154 $arrayforaierephrasestyle = array(
155 'professional' =>
'RephraseStyleProfessional',
156 'humouristic' =>
'RephraseStyleHumouristic'
159 return $arrayforaierephrasestyle;
169 global $langs, $conf;
171 $langs->load(
"agenda");
177 $head[$h][1] = $langs->trans(
"Settings");
178 $head[$h][2] =
'settings';
181 $head[$h][0] =
dol_buildpath(
"/ai/admin/custom_prompt.php", 1);
182 $head[$h][1] = $langs->trans(
"CustomPrompt");
183 $head[$h][2] =
'custom';
188 $head[$h][1] = $langs->trans(
"MCPServer");
189 $head[$h][2] =
'servermcp';
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.