-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.phtml
100 lines (99 loc) · 5.3 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<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_base_url"><?php echo _t('ext.field.openai_base_url'); ?></label>
<div class="group-controls">
<input type="text" name="openai_base_url" id="openai_base_url" value="<?php echo FreshRSS_Context::$system_conf->openai_base_url ?? 'https://api.openai.com'; ?>">
</div>
</div>
<div class="form-group">
<label class="group-name" for="provider"><a href="https://github.com/Portkey-AI/gateway/blob/4f6faec65298a0b99a32550f93abf0039fc5930f/src/providers/index.ts#L21" target="_blank"><?php echo _t('ext.field.provider') . " (?)"; ?></a></label>
<div class="group-controls">
<input list="select-providers" id="provider" name="provider" value="<?php echo htmlentities(FreshRSS_Context::$system_conf->provider ?? 'openai'); ?>">
<datalist id="select-providers">
<option value="openai">
<option value="cohere">
<option value="anthropic">
<option value="azure-openai">
<option value="anyscale">
<option value="palm">
<option value="together-ai">
<option value="google">
<option value="mistral-ai">
<option value="deepinfra">
<option value="stability-ai">
<option value="nomic">
<option value="ollama">
<option value="ai21">
<option value="bedrock">
<option value="groq">
<option value="segmind">
</datalist>
</div>
</div>
<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/chat/create#chat/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/chat/create#chat/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 ?? 'title'); ?>" selected="selected"><?php echo htmlentities(FreshRSS_Context::$system_conf->field ?? 'title'); ?></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/chat/create#chat/create-content" 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">
<!-- make the input element to support input and select -->
<label class="group-name" for="model"><a href="https://platform.openai.com/docs/api-reference/chat/create#chat/create-model" target="_blank"><?php echo _t('ext.field.model') . " (?)"; ?></a></label>
<div class="group-controls">
<input list="select-models" id="model" name="model" value="<?php echo htmlentities(FreshRSS_Context::$system_conf->model ?? 'gpt-3.5-turbo-16k'); ?>">
<datalist id="select-models">
<option value="gpt-4">
<option value="gpt-4-0613">
<option value="gpt-4-32k">
<option value="gpt-4-32k-0613">
<option value="gpt-3.5-turbo">
<option value="gpt-3.5-turbo-0613">
<option value="gpt-3.5-turbo-16k">
<option value="gpt-3.5-turbo-16k-0613">
</datalist>
</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>