Llama-cpp inference, database stored models
This commit is contained in:
1 parent
a3700ca15a
commit
f2a6fc0cd5
11 files changed
+192
-6
No files matched your search
@@ -21,6 +21,7 @@
|
||||
const configFields = ref([]);
|
||||
// Only used for scripted agents.
|
||||
const actionDefinitions = ref([]);
|
||||
const modelList = ref([]);
|
||||
|
||||
|
||||
// === State Management === //
|
||||
@@ -54,6 +55,7 @@
|
||||
name: field.name,
|
||||
type: field.type,
|
||||
value: field.value,
|
||||
kind: field.type,
|
||||
default: null,
|
||||
enabled: field.value != null,
|
||||
}));
|
||||
@@ -72,6 +74,11 @@
|
||||
});
|
||||
}
|
||||
|
||||
async function loadModels () {
|
||||
let res = await backend.sendAction("get-models");
|
||||
modelList.value = res.models;
|
||||
}
|
||||
|
||||
// This won't fire when immediately, the mounted callback will take care
|
||||
watch(() => props.id, newId => {
|
||||
loadAgentData(newId);
|
||||
@@ -79,6 +86,7 @@
|
||||
|
||||
onMounted(async () => {
|
||||
loadAgentData(props.id);
|
||||
loadModels();
|
||||
});
|
||||
|
||||
// === Prompt === //
|
||||
@@ -336,7 +344,11 @@
|
||||
<span class="label">{{ configField.name }}</span>
|
||||
<input type="checkbox" v-model="configField.enabled" />
|
||||
<br>
|
||||
<textarea v-model="configField.value" class="config-input" :disabled="!configField.enabled"/>
|
||||
<select v-if="configField.kind == 'model_id'" v-model="configField.value">
|
||||
<option v-if="!modelList.length" disabled>empty</option>
|
||||
<option :value="model.id" v-for="model in modelList">{{ model.name }}</option>
|
||||
</select>
|
||||
<textarea v-else v-model="configField.value" class="config-input" :disabled="!configField.enabled"/>
|
||||
</div>
|
||||
|
||||
<button type="submit" @click="saveChanges()">Save</button>
|
||||
|
||||
Reference in new issue
Block a user