File: /home4/cca63905/public_html/nueva/modules/btecommercecopilot/configuration/moduleConfiguration.php
<?php
/**
* Ecommerce copilot
*
* @author businesstech.fr <modules@businesstech.fr> - https://www.businesstech.fr/
* @copyright https://www.businesstech.fr/
* @license see file: LICENSE.txt
*
* ____ _______
* | _ \ |__ __|
* | |_) | | |
* | _ < | |
* | |_) | | |
* |____/ |_|
*/
namespace btecommercecopilot\Configuration;
if (!defined('_PS_VERSION_')) {
exit;
}
class moduleConfiguration
{
/**
* return the array of available generation type
*
* @return array
*/
public static function getGenerationType()
{
$dataType = [
0 => ['name' => \btecommercecopilot::$moduleObject->l('Long product description', 'moduleConfiguration'), 'type' => 'long-description'],
1 => ['name' => \btecommercecopilot::$moduleObject->l('Short product description', 'moduleConfiguration'), 'type' => 'short-description'],
2 => ['name' => \btecommercecopilot::$moduleObject->l('Product meta-description', 'moduleConfiguration'), 'type' => 'meta-description'],
3 => ['name' => \btecommercecopilot::$moduleObject->l('Category description', 'moduleConfiguration'), 'type' => 'category-description'],
4 => ['name' => \btecommercecopilot::$moduleObject->l('Additional category description', 'moduleConfiguration'), 'type' => 'category-additional-description'],
5 => ['name' => \btecommercecopilot::$moduleObject->l('Category meta-description', 'moduleConfiguration'), 'type' => 'category-meta-description'],
6 => ['name' => \btecommercecopilot::$moduleObject->l('CMS page content', 'moduleConfiguration'), 'type' => 'cms-page-content'],
];
if (empty(\btecommercecopilot::$compare80)) {
unset($dataType[4]);
}
return $dataType;
}
public static function getLimitOfSize()
{
return [
'long-description' => \btecommercecopilot::$moduleObject->l('Text length must not exceed 21000 characters.', 'moduleConfiguration'),
'short-description' => \btecommercecopilot::$moduleObject->l('Text length must not exceed 800 characters.', 'moduleConfiguration'),
'meta-description' => \btecommercecopilot::$moduleObject->l('Text length must not exceed 160 characters.', 'moduleConfiguration'),
'category-description' => \btecommercecopilot::$moduleObject->l('Text length must not exceed 21000 characters.', 'moduleConfiguration'),
'category-additional-description' => \btecommercecopilot::$moduleObject->l('Text length must not exceed 21000 characters.', 'moduleConfiguration'),
'category-meta-description' => \btecommercecopilot::$moduleObject->l('Text length must not exceed 160 characters.', 'moduleConfiguration'),
'cms-page-content' => \btecommercecopilot::$moduleObject->l('The number of characters allowed is unlimited.', 'moduleConfiguration'),
];
}
public static function getTypeOfIA(string $type)
{
$IaToUSe = '';
switch ($type) {
case 'long-description':
case 'short-description':
case 'meta-description':
case 'category-description':
case 'category-additional-description':
case 'category-meta-description':
case 'cms-page-content':
$IaToUSe = 'completions';
break;
default:
break;
}
return $IaToUSe;
}
public static function getAvailableModelListForCompletion()
{
return ['text-davinci-003', 'text-davinci-002', 'text-curie-001', 'stext-babbage-001', 'ext-ada-001'];
}
}