-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
76 lines (73 loc) · 2.6 KB
/
config.php
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
require_once INCLUDE_DIR . 'class.plugin.php';
class Speech2TextPluginConfig extends PluginConfig
{
public function translate()
{
if (!method_exists('Plugin', 'translate')) {
return array(
function ($x) {
return $x;
}
,
function ($x, $y, $n) {
return $n != 1 ? $y : $x;
}
,
);
}
return Plugin::translate('speech2text');
}
public function getOptions()
{
list ($__, $_N) = self::translate();
return array(
'speech2text' => new SectionBreakField(array(
'label' => 'Speech to Text Plugin',
)),
'speech2text-title' => new TextboxField(array(
'label' => $__('Note Title'),
'hint' => $__('Summary of the note (optional)')
)),
'speech2text-poster' => new TextboxField(array(
'label' => $__('Note Poster'),
'hint' => $__('Name of Note Poster (optional - defaults to "SYSTEM")')
)),
'speech2text-provider' => new ChoiceField(array(
'label' => $__('Transcription Provider'),
'choices' => array(
'azure' => 'Azure Speech services',
'openai' => 'OpenAI Whisper'
)
)),
'speech2text-location' => new TextboxField(array(
'label' => $__('Azure Server Location'),
'hint' => $__('Location of azure speech resource, e.g. uksouth')
)),
'speech2text-apikey' => new TextboxField(array(
'label' => $__('Speech service API Key'),
'hint' => $__('Available from Azure portal'),
'configuration' => array(
'size' => 32,
'length' => 32
)
)),
'speech2text-openaikey' => new TextboxField(array(
'label' => $__('OpenAI API Key'),
'hint' => $__('Available from OpenAI'),
'configuration' => array(
'size' => 52,
'length' => 52
)
)),
'speech2text-prompt' => new TextareaField(array(
'label' => $__('Whisper prompt'),
'hint' => $__('An optional text to guide the model\'s style'),
'configuration' => array(
'html' => true,
'size' => 'small',
)
)),
);
}
}