Build coffee history and experiment workflows with Ask Bean Bro
Test and deploy / test-and-deploy (push) Successful in 1m21s
Test and deploy / test-and-deploy (push) Successful in 1m21s
This commit is contained in:
1 parent
1fd53091ac
commit
8c21750356
28 files changed
+3848
-384
No files matched your search
+7
-11
@@ -97,10 +97,10 @@ async function loadLlm() {
|
||||
const select = document.getElementById("llm-model-select");
|
||||
const note = document.getElementById("llm-model-note");
|
||||
try {
|
||||
const { current, models, modelsError } = await api("/api/admin/llm");
|
||||
const { current, models, modelsError, effective } = await api("/api/admin/llm");
|
||||
const auto = document.createElement("option");
|
||||
auto.value = "";
|
||||
auto.textContent = "Auto (first available model)";
|
||||
auto.textContent = "Auto (server default)";
|
||||
select.replaceChildren(
|
||||
auto,
|
||||
...models.map((model) => {
|
||||
@@ -119,15 +119,9 @@ async function loadLlm() {
|
||||
select.append(missing);
|
||||
}
|
||||
select.value = current;
|
||||
note.textContent = modelsError
|
||||
? "No models are configured on the server — reviews and prefill will fail until one is set up."
|
||||
: current
|
||||
? ""
|
||||
: models.length
|
||||
? `Auto currently resolves to ${models[0].name} (${models[0].provider}).`
|
||||
: "";
|
||||
note.textContent = modelsError ? "Could not list providers. Check the server configuration." : `Effective selection: ${effective || "No model configured"}. Provider credentials are managed on the server.`;
|
||||
} catch {
|
||||
note.textContent = "Could not load LLM settings.";
|
||||
note.textContent = "Could not load Bean Bro settings.";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +135,7 @@ function wireLlmSave() {
|
||||
method: "PUT",
|
||||
body: JSON.stringify({ model }),
|
||||
});
|
||||
showToast(model ? "LLM model saved." : "LLM model set to auto.");
|
||||
showToast(model ? "Bean Bro model saved." : "Bean Bro model set to auto.");
|
||||
await loadLlm();
|
||||
} catch (error) {
|
||||
showToast(error.message, "fail");
|
||||
@@ -439,3 +433,5 @@ async function init() {
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
document.getElementById('bro-test').addEventListener('click',async e=>{e.currentTarget.disabled=true;const out=document.getElementById('bro-test-result');out.textContent='Contacting Bean Bro…';try{const result=await api('/api/admin/llm/test',{method:'POST'});out.textContent=`Connected: ${result.model||'configured provider'} · ${result.reply}`;}catch(error){out.textContent=error.message;}finally{document.getElementById('bro-test').disabled=false;}});
|
||||
Reference in new issue
Block a user