diff --git a/backend/main.py b/backend/main.py index 1e4a416dd..39a053203 100644 --- a/backend/main.py +++ b/backend/main.py @@ -299,6 +299,8 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware): context += ("\n" if context != "" else "") + response del data["tool_ids"] + print(context) + # If docs field is present, generate RAG completions if "docs" in data: data = {**data} diff --git a/src/routes/(app)/workspace/models/create/+page.svelte b/src/routes/(app)/workspace/models/create/+page.svelte index 181aafe2f..8f1215dde 100644 --- a/src/routes/(app)/workspace/models/create/+page.svelte +++ b/src/routes/(app)/workspace/models/create/+page.svelte @@ -60,10 +60,9 @@ id = name.replace(/\s+/g, '-').toLowerCase(); } - let baseModel = null; - $: { - baseModel = $models.find((m) => m.id === info.base_model_id); - console.log(baseModel); + const addUsage = (base_model_id) => { + const baseModel = $models.find((m) => m.id === base_model_id); + if (baseModel) { if (baseModel.owned_by === 'openai') { capabilities.usage = baseModel.info?.meta?.capabilities?.usage ?? false; @@ -72,7 +71,7 @@ } capabilities = capabilities; } - } + }; const submitHandler = async () => { loading = true; @@ -360,6 +359,9 @@ class="px-3 py-1.5 text-sm w-full bg-transparent border dark:border-gray-600 outline-none rounded-lg" placeholder="Select a base model (e.g. llama3, gpt-4o)" bind:value={info.base_model_id} + on:change={(e) => { + addUsage(e.target.value); + }} required >