xref: /plugin/dokullm/conf/metadata.php (revision db43cc0996840949e34ced7b0f71ad5df44b6d2a)
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('string');
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
136/**
137 * Metadata for the ChromaDB host configuration option
138 *
139 * Defines the ChromaDB host as a string input field in the configuration interface.
140 *
141 * @var array
142 */
143$meta['chroma_host'] = array('string');
144
145/**
146 * Metadata for the ChromaDB port configuration option
147 *
148 * Defines the ChromaDB port as a numeric input field.
149 *
150 * @var array
151 */
152$meta['chroma_port'] = array('numeric');
153
154/**
155 * Metadata for the ChromaDB tenant configuration option
156 *
157 * Defines the ChromaDB tenant as a string input field in the configuration interface.
158 *
159 * @var array
160 */
161$meta['chroma_tenant'] = array('string');
162
163/**
164 * Metadata for the ChromaDB database configuration option
165 *
166 * Defines the ChromaDB database as a string input field in the configuration interface.
167 *
168 * @var array
169 */
170$meta['chroma_database'] = array('string');
171
172/**
173 * Metadata for the ChromaDB collection configuration option
174 *
175 * Defines the ChromaDB collection as a string input field in the configuration interface.
176 *
177 * @var array
178 */
179$meta['chroma_collection'] = array('string');
180
181/**
182 * Metadata for the default institution configuration option
183 *
184 * Defines the default institution as a string input field in the configuration interface.
185 *
186 * @var array
187 */
188$meta['default_institution'] = array('string');
189
190/**
191 * Metadata for the Ollama host configuration option
192 *
193 * Defines the Ollama host as a string input field in the configuration interface.
194 *
195 * @var array
196 */
197$meta['ollama_host'] = array('string');
198
199/**
200 * Metadata for the Ollama port configuration option
201 *
202 * Defines the Ollama port as a numeric input field.
203 *
204 * @var array
205 */
206$meta['ollama_port'] = array('numeric');
207
208/**
209 * Metadata for the Ollama embeddings model configuration option
210 *
211 * Defines the Ollama embeddings model as a string input field in the configuration interface.
212 *
213 * @var array
214 */
215$meta['ollama_embeddings_model'] = array('string');
216