-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsmart_templates_model_settings.ejs
38 lines (38 loc) · 1.67 KB
/
smart_templates_model_settings.ejs
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
<div class="setting-component"
data-name="Model platform"
data-setting="smart_templates.chat_model_platform_key"
data-type="dropdown"
data-description="Select a model platform to use with Smart Chat."
data-callback="changed_smart_chat_platform"
<%- chat_platforms.map((platform, i) => `data-option-${i + 1}="${platform.key}|${platform.description}"`).join('\n') %>
></div>
<% if(chat_platform?.fetch_models) { %>
<% if(settings[settings.chat_model_platform_key]?.api_key) { %>
<div class="setting-component"
data-name="Model name"
data-type="dropdown"
data-setting="smart_templates.<%= settings.chat_model_platform_key %>.model_name"
<%- platform_chat_models.map((model, i) => `data-option-${i}="${model.key}|${model.model_name} (${model.description})"`).join('\n') %>
></div>
<% } %>
<% if(!platform_chat_models.length) { %>
<div class="setting-component"
data-name="Refresh models list"
data-type="button"
data-callback="changed_smart_chat_platform"
></div>
<% } %>
<div class="setting-component"
data-name="<%= chat_platform.description %> API key"
data-type="password"
data-setting="smart_templates.<%= settings.chat_model_platform_key %>.api_key"
<% if(chat_platform.signup_url) { %>
data-description="<a href='<%= chat_platform.signup_url %>'>Get API Key</a> for <%= chat_platform.description %>."
<% } else { %>
data-description="API Key for <%= chat_platform.description %>."
<% } %>
data-placeholder="Enter an API key"
data-button="Save"
data-callback="changed_smart_chat_platform"
></div>
<% } %>