AI: Add capabilities
@ -82,7 +82,13 @@
|
||||
<div class="form-horizontal-item" id="block-use-for" style="margin-bottom: 0;">
|
||||
<div id="use-for-text"></div>
|
||||
<div id="use-for-image"></div>
|
||||
<div id="use-for-embeddings"></div>
|
||||
<div id="use-for-audio"></div>
|
||||
<div id="use-for-moderations"></div>
|
||||
<div id="use-for-realtime"></div>
|
||||
<div id="use-for-code"></div>
|
||||
<div id="use-for-vision"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="scripts/aiModelEdit.js"></script>
|
||||
|
||||
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-audio.png
Normal file
|
After Width: | Height: | Size: 117 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-audio@1.25x.png
Normal file
|
After Width: | Height: | Size: 121 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-audio@1.5x.png
Normal file
|
After Width: | Height: | Size: 125 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-audio@1.75x.png
Normal file
|
After Width: | Height: | Size: 133 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-audio@2x.png
Normal file
|
After Width: | Height: | Size: 147 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-code.png
Normal file
|
After Width: | Height: | Size: 163 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-code@1.25x.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-code@1.5x.png
Normal file
|
After Width: | Height: | Size: 247 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-code@1.75x.png
Normal file
|
After Width: | Height: | Size: 213 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-code@2x.png
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-embeddings.png
Normal file
|
After Width: | Height: | Size: 187 B |
|
After Width: | Height: | Size: 209 B |
|
After Width: | Height: | Size: 227 B |
|
After Width: | Height: | Size: 264 B |
|
After Width: | Height: | Size: 306 B |
|
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 177 B |
|
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 177 B |
|
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 294 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-moderations.png
Normal file
|
After Width: | Height: | Size: 172 B |
|
After Width: | Height: | Size: 204 B |
|
After Width: | Height: | Size: 236 B |
|
After Width: | Height: | Size: 255 B |
|
After Width: | Height: | Size: 269 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-realtime.png
Normal file
|
After Width: | Height: | Size: 229 B |
|
After Width: | Height: | Size: 279 B |
|
After Width: | Height: | Size: 297 B |
|
After Width: | Height: | Size: 335 B |
BIN
sdkjs-plugins/content/ai/resources/icons/dark/ai-realtime@2x.png
Normal file
|
After Width: | Height: | Size: 417 B |
|
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 101 B |
|
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 104 B |
|
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 108 B |
|
Before Width: | Height: | Size: 176 B After Width: | Height: | Size: 113 B |
|
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 237 B |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 289 B |
|
Before Width: | Height: | Size: 374 B After Width: | Height: | Size: 340 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-audio.png
Normal file
|
After Width: | Height: | Size: 116 B |
|
After Width: | Height: | Size: 118 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-audio@1.5x.png
Normal file
|
After Width: | Height: | Size: 122 B |
|
After Width: | Height: | Size: 128 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-audio@2x.png
Normal file
|
After Width: | Height: | Size: 147 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-code.png
Normal file
|
After Width: | Height: | Size: 156 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-code@1.25x.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-code@1.5x.png
Normal file
|
After Width: | Height: | Size: 230 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-code@1.75x.png
Normal file
|
After Width: | Height: | Size: 208 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-code@2x.png
Normal file
|
After Width: | Height: | Size: 235 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-embeddings.png
Normal file
|
After Width: | Height: | Size: 180 B |
|
After Width: | Height: | Size: 197 B |
|
After Width: | Height: | Size: 220 B |
|
After Width: | Height: | Size: 247 B |
|
After Width: | Height: | Size: 310 B |
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 176 B |
|
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 179 B |
|
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 214 B |
|
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 217 B |
|
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 294 B |
|
After Width: | Height: | Size: 170 B |
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 226 B |
|
After Width: | Height: | Size: 241 B |
|
After Width: | Height: | Size: 268 B |
BIN
sdkjs-plugins/content/ai/resources/icons/light/ai-realtime.png
Normal file
|
After Width: | Height: | Size: 219 B |
|
After Width: | Height: | Size: 265 B |
|
After Width: | Height: | Size: 285 B |
|
After Width: | Height: | Size: 320 B |
|
After Width: | Height: | Size: 411 B |
|
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 99 B |
|
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 104 B |
|
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 108 B |
|
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 112 B |
|
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 216 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 231 B |
|
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 305 B After Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 348 B |
@ -10,6 +10,7 @@ var providerNameCmbEl = document.getElementById('provider-name-cmb');
|
||||
var providerUrlInputEl = document.getElementById('provider-url-input');
|
||||
var providerKeyInputEl = document.getElementById('provider-key-input');
|
||||
var modelNameCmbEl = document.getElementById('model-name-cmb');
|
||||
$(modelNameCmbEl).select2();
|
||||
var updateModelsBtnEl = document.getElementById('update-models-btn');
|
||||
var updateModelsErrorEl = document.getElementById('update-models-error');
|
||||
|
||||
@ -37,32 +38,96 @@ var updateModelsErrorTip = new Tooltip(updateModelsErrorEl, {
|
||||
align: 'right'
|
||||
});
|
||||
|
||||
var useForTextBtn = new ToggleButton({
|
||||
id: 'use-for-text',
|
||||
icon: 'resources/icons/light/ai-texts.png'
|
||||
});
|
||||
var useForTextTip = new Tooltip(document.getElementById('use-for-text'), {
|
||||
text: 'Texts',
|
||||
yAnchor: 'top'
|
||||
});
|
||||
|
||||
var useForImageBtn = new ToggleButton({
|
||||
id: 'use-for-image',
|
||||
icon: 'resources/icons/light/ai-images.png'
|
||||
});
|
||||
var useForImageTip = new Tooltip(document.getElementById('use-for-image'), {
|
||||
text: 'Images',
|
||||
yAnchor: 'top'
|
||||
});
|
||||
|
||||
var useForVisionBtn = new ToggleButton({
|
||||
id: 'use-for-vision',
|
||||
icon: 'resources/icons/light/ai-visual-analysis.png'
|
||||
});
|
||||
var useForVisionTip = new Tooltip(document.getElementById('use-for-vision'), {
|
||||
text: 'Visual Analysis',
|
||||
yAnchor: 'top'
|
||||
});
|
||||
var capabilitiesElements = {
|
||||
text: {
|
||||
btn: new ToggleButton({
|
||||
id: 'use-for-text',
|
||||
icon: 'resources/icons/light/ai-texts.png'
|
||||
}),
|
||||
tip: new Tooltip(document.getElementById('use-for-text'), {
|
||||
text: 'Text',
|
||||
yAnchor: 'top'
|
||||
}),
|
||||
capabilities: AI.CapabilitiesUI.Chat
|
||||
},
|
||||
image: {
|
||||
btn: new ToggleButton({
|
||||
id: 'use-for-image',
|
||||
icon: 'resources/icons/light/ai-images.png'
|
||||
}),
|
||||
tip: new Tooltip(document.getElementById('use-for-image'), {
|
||||
text: 'Images',
|
||||
yAnchor: 'top'
|
||||
}),
|
||||
capabilities: AI.CapabilitiesUI.Image
|
||||
},
|
||||
embeddings: {
|
||||
btn: new ToggleButton({
|
||||
id: 'use-for-embeddings',
|
||||
icon: 'resources/icons/light/ai-embeddings.png'
|
||||
}),
|
||||
tip: new Tooltip(document.getElementById('use-for-embeddings'), {
|
||||
text: 'Embeddings',
|
||||
yAnchor: 'top'
|
||||
}),
|
||||
capabilities: AI.CapabilitiesUI.Embeddings
|
||||
},
|
||||
audio: {
|
||||
btn: new ToggleButton({
|
||||
id: 'use-for-audio',
|
||||
icon: 'resources/icons/light/ai-audio.png'
|
||||
}),
|
||||
tip: new Tooltip(document.getElementById('use-for-audio'), {
|
||||
text: 'Audio Processing',
|
||||
yAnchor: 'top'
|
||||
}),
|
||||
capabilities: AI.CapabilitiesUI.Audio
|
||||
},
|
||||
moderations: {
|
||||
btn: new ToggleButton({
|
||||
id: 'use-for-moderations',
|
||||
icon: 'resources/icons/light/ai-moderations.png'
|
||||
}),
|
||||
tip: new Tooltip(document.getElementById('use-for-moderations'), {
|
||||
text: 'Content Moderation',
|
||||
yAnchor: 'top'
|
||||
}),
|
||||
capabilities: AI.CapabilitiesUI.Moderations
|
||||
},
|
||||
realtime: {
|
||||
btn: new ToggleButton({
|
||||
id: 'use-for-realtime',
|
||||
icon: 'resources/icons/light/ai-realtime.png'
|
||||
}),
|
||||
tip: new Tooltip(document.getElementById('use-for-realtime'), {
|
||||
text: 'Realtime Tasks',
|
||||
yAnchor: 'top'
|
||||
}),
|
||||
capabilities: AI.CapabilitiesUI.Realtime
|
||||
},
|
||||
code: {
|
||||
btn: new ToggleButton({
|
||||
id: 'use-for-code',
|
||||
icon: 'resources/icons/light/ai-code.png'
|
||||
}),
|
||||
tip: new Tooltip(document.getElementById('use-for-code'), {
|
||||
text: 'Coding Help',
|
||||
yAnchor: 'top'
|
||||
}),
|
||||
capabilities: AI.CapabilitiesUI.Code
|
||||
},
|
||||
vision: {
|
||||
btn: new ToggleButton({
|
||||
id: 'use-for-vision',
|
||||
icon: 'resources/icons/light/ai-visual-analysis.png'
|
||||
}),
|
||||
tip: new Tooltip(document.getElementById('use-for-vision'), {
|
||||
text: 'Visual Analysis',
|
||||
yAnchor: 'top'
|
||||
}),
|
||||
capabilities: AI.CapabilitiesUI.Vision
|
||||
}
|
||||
};
|
||||
|
||||
var resolveModels = null;
|
||||
var rejectModels = null;
|
||||
@ -211,17 +276,20 @@ function onChangeModelComboBox() {
|
||||
|
||||
function getCapabilities() {
|
||||
var result = 0;
|
||||
useForTextBtn.getValue() && (result += AI.CapabilitiesUI.Chat);
|
||||
useForImageBtn.getValue() && (result += AI.CapabilitiesUI.Image);
|
||||
useForVisionBtn.getValue() && (result += AI.CapabilitiesUI.Vision);
|
||||
for (const key in capabilitiesElements) {
|
||||
var itemProps = capabilitiesElements[key];
|
||||
itemProps.btn.getValue() && (result += itemProps.capabilities);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function updateCapabilitiesBtns(capabilities) {
|
||||
if(capabilities === undefined) return;
|
||||
useForTextBtn.setValue((capabilities & AI.CapabilitiesUI.Chat) !== 0);
|
||||
useForImageBtn.setValue((capabilities & AI.CapabilitiesUI.Image) !== 0);
|
||||
useForVisionBtn.setValue((capabilities & AI.CapabilitiesUI.Vision) !== 0);
|
||||
|
||||
for (const key in capabilitiesElements) {
|
||||
var itemProps = capabilitiesElements[key];
|
||||
itemProps.btn.setValue((capabilities & itemProps.capabilities) !== 0);
|
||||
}
|
||||
}
|
||||
|
||||
function updateModelsList() {
|
||||
|
||||
@ -155,7 +155,7 @@ function onOpenEditModal(data) {
|
||||
});
|
||||
aiModelEditWindow.attachEvent("onGetModels", async function(provider){
|
||||
let models = await AI.getModels(provider);
|
||||
aiModelEditWindow.command("onGetModels", models);
|
||||
aiModelEditWindow && aiModelEditWindow.command("onGetModels", models);
|
||||
});
|
||||
|
||||
aiModelEditWindow.attachEvent("onInit", function() {
|
||||
|
||||
@ -4,7 +4,12 @@ var aiModelsList = [];
|
||||
var capabilitiesList = {
|
||||
[AI.CapabilitiesUI.Chat]: {name: 'Text-Based', icon: 'ai-texts.png'},
|
||||
[AI.CapabilitiesUI.Image]: {name: 'Images', icon: 'ai-images.png'},
|
||||
[AI.CapabilitiesUI.Vision]: {name: 'Vision', icon: 'ai-visual-analysis.png'},
|
||||
[AI.CapabilitiesUI.Embeddings]: {name: 'Embeddings', icon: 'ai-embeddings.png'},
|
||||
[AI.CapabilitiesUI.Audio]: {name: 'Audio', icon: 'ai-audio.png'},
|
||||
[AI.CapabilitiesUI.Moderations]: {name: 'Moderations', icon: 'ai-moderations.png'},
|
||||
[AI.CapabilitiesUI.Realtime]: {name: 'Realtime', icon: 'ai-realtime.png'},
|
||||
[AI.CapabilitiesUI.Code]: {name: 'Code', icon: 'ai-code.png'},
|
||||
[AI.CapabilitiesUI.Vision]: {name: 'Vision', icon: 'ai-visual-analysis.png'}
|
||||
};
|
||||
|
||||
var scrollbarList = new PerfectScrollbar("#actions-list", {});
|
||||
@ -112,7 +117,7 @@ function updatedComboBoxes() {
|
||||
return data.text;
|
||||
}
|
||||
|
||||
var capability = capabilitiesList[action.capabilities + 100];
|
||||
var capability = capabilitiesList[action.capabilities];
|
||||
if(!capability) {
|
||||
return 'Available models';
|
||||
}
|
||||
|
||||