-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMeasurableSettings.php
More file actions
59 lines (48 loc) · 1.92 KB
/
MeasurableSettings.php
File metadata and controls
59 lines (48 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\MistralAI;
use Piwik\Settings\Setting;
use Piwik\Settings\FieldConfig;
/**
* Site-specific settings for MistralAI plugin.
* These settings override system settings when configured.
*/
class MeasurableSettings extends \Piwik\Settings\Measurable\MeasurableSettings
{
use SettingsBase;
/** @var Setting */
public $host;
public $apiKey;
public $modelPreset;
public $modelCustom;
public $chatBasePrompt;
public $insightBasePrompt;
/** @var Setting|null @deprecated Legacy property for backwards compatibility during updates */
public $model;
protected function init()
{
$this->host = $this->makeSetting('host', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$this->configureHostField($field);
});
$this->apiKey = $this->makeSetting('apiKey', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$this->configureApiKeyField($field);
});
$this->modelPreset = $this->makeSetting('modelPreset', '', FieldConfig::TYPE_ARRAY, function (FieldConfig $field) {
$this->configureModelPresetField($field, true);
});
$this->modelCustom = $this->makeSetting('modelCustom', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$this->configureModelCustomField($field, true);
});
$this->chatBasePrompt = $this->makeSetting('chatBasePrompt', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$this->configureChatBasePromptField($field);
});
$this->insightBasePrompt = $this->makeSetting('insightBasePrompt', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$this->configureInsightBasePromptField($field);
});
}
}