mirror of
https://github.com/open-webui/open-webui
synced 2025-01-29 13:58:09 +00:00
refac
This commit is contained in:
parent
827dd1b044
commit
bf1936de34
@ -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}
|
||||
|
@ -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
|
||||
>
|
||||
<option value={null} class=" text-gray-900">{$i18n.t('Select a base model')}</option>
|
||||
|
Loading…
Reference in New Issue
Block a user