xref: /plugin/dokullm/conf/metadata.php (revision 590368144294a28ecf0e0e39feb976bf79fefb1e)
1<?php
2/**
3 * Options for the dokullm plugin
4 *
5 * This file defines the configuration metadata for the LLM integration plugin.
6 * It specifies the type and validation rules for each configuration option.
7 */
8
9/**
10 * Metadata for the API URL configuration option
11 *
12 * Defines the API endpoint URL as a string input field in the configuration interface.
13 *
14 * @var array
15 */
16$meta['api_url'] = array('string');
17
18/**
19 * Metadata for the API key configuration option
20 *
21 * Defines the API key as a password field in the configuration interface.
22 * This ensures the value is masked when entered and stored securely.
23 *
24 * @var array
25 */
26$meta['api_key'] = array('password');
27
28/**
29 * Metadata for the model configuration option
30 *
31 * Defines the model identifier as a string input field in the configuration interface.
32 *
33 * @var array
34 */
35$meta['model'] = array('string');
36
37/**
38 * Metadata for the timeout configuration option
39 *
40 * Defines the timeout value as a numeric input field with a minimum value of 5 seconds.
41 * This prevents users from setting an unreasonably low timeout value.
42 *
43 * @var array
44 */
45$meta['timeout'] = array('numeric', '_min' => 5);
46
47/**
48 * Metadata for the language configuration option
49 *
50 * Defines the language as a multichoice field with 'default' and 'ro' options.
51 *
52 * @var array
53 */
54$meta['language'] = array('multichoice', '_choices' => array('default', 'ro'));
55
56/**
57 * Metadata for the temperature configuration option
58 *
59 * Defines the temperature as a numeric field with a range from 0.0 to 1.0,
60 * with a default of 0.3. This controls the randomness of the LLM responses.
61 *
62 * @var array
63 */
64$meta['temperature'] = array('numeric', '_min' => 0.0, '_max' => 1.0, '_pattern' => '/^\d+(\.\d+)?$/');
65
66/**
67 * Metadata for the top-p configuration option
68 *
69 * Defines the top-p (nucleus sampling) as a numeric field with a range from 0.0 to 1.0,
70 * with a default of 0.8. This controls the cumulative probability of token selection.
71 *
72 * @var array
73 */
74$meta['top_p'] = array('numeric', '_min' => 0.0, '_max' => 1.0, '_pattern' => '/^\d+(\.\d+)?$/');
75
76/**
77 * Metadata for the top-k configuration option
78 *
79 * Defines the top-k as a numeric field with a minimum value of 1,
80 * with a default of 20. This controls the number of highest probability tokens considered.
81 *
82 * @var array
83 */
84$meta['top_k'] = array('numeric', '_min' => 1);
85
86/**
87 * Metadata for the min-p configuration option
88 *
89 * Defines the min-p as a numeric field with a range from 0.0 to 1.0,
90 * with a default of 0.0. This controls the minimum probability threshold for token selection.
91 *
92 * @var array
93 */
94$meta['min_p'] = array('numeric', '_min' => 0.0, '_max' => 1.0, '_pattern' => '/^\d+(\.\d+)?$/');
95
96/**
97 * Metadata for the show_copy_button configuration option
98 *
99 * Defines whether the copy button should be shown as a boolean field.
100 *
101 * @var array
102 */
103$meta['show_copy_button'] = array('onoff');
104
105/**
106 * Metadata for the replace_id configuration option
107 *
108 * Defines whether the template ID should be replaced with the new page ID
109 * when copying a page with a template.
110 *
111 * @var array
112 */
113$meta['replace_id'] = array('onoff');
114
115/**
116 * Metadata for the think configuration option
117 *
118 * Defines whether the LLM should engage in deeper thinking processes before responding.
119 * When enabled, the LLM will use thinking capabilities; when disabled, it will provide direct responses.
120 *
121 * @var array
122 */
123$meta['think'] = array('onoff');
124
125/**
126 * Metadata for the use_tools configuration option
127 *
128 * Defines whether the LLM can use tools to enhance its responses.
129 * When enabled, the LLM can call tools like get_document, get_template, and get_examples;
130 * when disabled, these tools will not be available to the LLM.
131 *
132 * @var array
133 */
134$meta['use_tools'] = array('onoff');
135