refac: models

This commit is contained in:
Timothy Jaeryang Baek
2024-11-15 18:21:41 -08:00
parent 1c16920dba
commit 9dae7d0572
11 changed files with 186 additions and 119 deletions
@@ -17,7 +17,7 @@
import { getTools } from '$lib/apis/tools';
import { getFunctions } from '$lib/apis/functions';
import { getKnowledgeItems } from '$lib/apis/knowledge';
import AccessPermissions from '../common/AccessPermissionsModal.svelte';
import AccessControl from '../common/AccessControl.svelte';
const i18n = getContext('i18n');
@@ -79,6 +79,8 @@
let filterIds = [];
let actionIds = [];
let accessControl = null;
const addUsage = (base_model_id) => {
const baseModel = $models.find((m) => m.id === base_model_id);
@@ -208,6 +210,8 @@
capabilities.usage = false;
}
accessControl = model?.access_control ?? null;
info = {
...info,
...JSON.parse(
@@ -641,7 +645,7 @@
</div>
<div class="my-2">
<AccessPermissions />
<AccessControl bind:accessControl />
</div>
<div class="my-2 text-gray-300 dark:text-gray-700">