forked from reply2future/xExtension-NewsAssistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.phtml
73 lines (72 loc) · 4.45 KB
/
configure.phtml
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
<form action="<?php echo _url('extension', 'configure', 'e', urlencode($this->getName())); ?>" method="post">
<input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
<div class="form-group">
<label class="group-name" for="openai_api_key"><a href="https://platform.openai.com/account/api-keys" target="_blank"><?php echo _t('ext.field.openai_api_key') . " (?)"; ?></a></label>
<div class="group-controls">
<input type="text" name="openai_api_key" id="openai_api_key" value="<?php echo FreshRSS_Context::$system_conf->openai_api_key ?? ''; ?>">
</div>
</div>
<div class="form-group">
<label class="group-name" for="max_tokens"><a href="https://platform.openai.com/docs/api-reference/completions/create#completions/create-max_tokens" target="_blank"><?php echo _t('ext.field.max_tokens') . " (?)"; ?></a></label>
<div class="group-controls">
<input type="range" name="max_tokens" id="max_tokens" min="7" max="4096" value="<?php echo FreshRSS_Context::$system_conf->max_tokens ?? 2048; ?>">
<output for="max_tokens"><?php echo FreshRSS_Context::$system_conf->max_tokens ?? 2048; ?></output>
</div>
</div>
<div class="form-group">
<label class="group-name" for="temperature"><a href="https://platform.openai.com/docs/api-reference/completions/create#completions/create-temperature" target="_blank" ><?php echo _t('ext.field.temperature') . " (?)"; ?></a></label>
<div class="group-controls">
<input type="range" name="temperature" id="temperature" min="0" max="2" step="0.1" value="<?php echo FreshRSS_Context::$system_conf->temperature ?? 1.0; ?>">
<output for="temperature"><?php echo FreshRSS_Context::$system_conf->temperature ?? 1.0; ?></output>
</div>
</div>
<div class="form-group">
<label class="group-name" for="field"><?php echo _t('ext.field.field'); ?></label>
<div class="group-controls">
<select name="field" id="field">
<option value="<?php echo htmlentities(FreshRSS_Context::$system_conf->field ?? 'content'); ?>" selected="selected"><?php echo htmlentities(FreshRSS_Context::$system_conf->field ?? 'content'); ?></option>
<option value="title">title</option>
<option value="content">content</option>
</select>
</div>
</div>
<div class="form-group">
<label class="group-name" for="limit"><?php echo _t('ext.field.limit'); ?></label>
<div class="group-controls">
<input type="number" name="limit" id="limit" value="<?php echo FreshRSS_Context::$system_conf->limit ?? 30; ?>">
</div>
</div>
<div class="form-group">
<label class="group-name" for="prompt"><a href="https://platform.openai.com/docs/api-reference/completions/create#completions/create-prompt" target="_blank" ><?php echo _t('ext.field.prompt') . " (?)"; ?></a></label>
<div class="group-controls">
<textarea id="prompt" name="prompt" rows="4" cols="50"><?php echo FreshRSS_Context::$system_conf->prompt ?? 'Summarize this as you are news editor, you should merge the similar topic.'; ?></textarea>
</div>
</div>
<div class="form-group">
<label class="group-name" for="model"><a href="https://platform.openai.com/docs/api-reference/completions/create#completions/create-model" target="_blank"><?php echo _t('ext.field.model') . " (?)"; ?></a></label>
<div class="group-controls">
<select name="model" id="model">
<option value="<?php echo htmlentities(FreshRSS_Context::$system_conf->model ?? 'text-davinci-003'); ?>" selected="selected"><?php echo htmlentities(FreshRSS_Context::$system_conf->model ?? 'text-davinci-003'); ?></option>
<option value="-">-</option>
<option value="babbage">babbage</option>
<option value="davinci">davinci</option>
<option value="text-davinci-001">text-davinci-001</option>
<option value="ada">ada</option>
<option value="text-curie-001">text-curie-001</option>
<option value="text-davinci-003">text-davinci-003</option>
<option value="text-ada-001">text-ada-001</option>
<option value="curie-instruct-beta">curie-instruct-beta</option>
<option value="davinci-instruct-beta">davinci-instruct-beta</option>
<option value="text-babbage-001">text-babbage-001</option>
<option value="curie">curie</option>
<option value="text-davinci-002">text-davinci-002</option>
</select>
</div>
</div>
<div class="form-group form-actions">
<div class="group-controls">
<button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
<button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
</div>
</div>
</form>