Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c11b97197 |
Generated
+1
-1
@@ -285,7 +285,7 @@ checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cortiq-gateway"
|
name = "cortiq-gateway"
|
||||||
version = "0.2.10"
|
version = "0.2.11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cortiq-gateway"
|
name = "cortiq-gateway"
|
||||||
version = "0.2.10"
|
version = "0.2.11"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.75"
|
rust-version = "1.75"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|||||||
+14
-4
@@ -694,15 +694,25 @@ async fn delete_model(State(state): State<SharedState>, Path(id): Path<String>)
|
|||||||
|
|
||||||
async fn probe_model(State(state): State<SharedState>, Path(id): Path<String>) -> ApiResult {
|
async fn probe_model(State(state): State<SharedState>, Path(id): Path<String>) -> ApiResult {
|
||||||
let live = state.live();
|
let live = state.live();
|
||||||
let mcfg = live
|
// Provider string: from the static pool, or "openai" for a managed local
|
||||||
|
// model (which is synthesized into the registry, not [[models]]).
|
||||||
|
let provider_str = live
|
||||||
.cfg
|
.cfg
|
||||||
.models
|
.models
|
||||||
.iter()
|
.iter()
|
||||||
.find(|m| m.id == id)
|
.find(|m| m.id == id)
|
||||||
.ok_or_else(|| ApiError::not_found(format!("model '{id}' not found")))?
|
.map(|m| m.provider.clone())
|
||||||
.clone();
|
.or_else(|| {
|
||||||
|
live.cfg
|
||||||
|
.cmf
|
||||||
|
.effective_servers()
|
||||||
|
.iter()
|
||||||
|
.find(|s| s.id == id)
|
||||||
|
.map(|_| "openai".to_string())
|
||||||
|
})
|
||||||
|
.ok_or_else(|| ApiError::not_found(format!("model '{id}' not found")))?;
|
||||||
|
|
||||||
if mcfg.provider == "anthropic" {
|
if provider_str == "anthropic" {
|
||||||
return ok(json!({
|
return ok(json!({
|
||||||
"ok": false,
|
"ok": false,
|
||||||
"error": "anthropic provider not yet implemented (planned v0.2)",
|
"error": "anthropic provider not yet implemented (planned v0.2)",
|
||||||
|
|||||||
Vendored
+3
-1
@@ -25,7 +25,9 @@ export function clear(node) {
|
|||||||
|
|
||||||
export function mount(node, ...children) {
|
export function mount(node, ...children) {
|
||||||
clear(node);
|
clear(node);
|
||||||
for (const c of children.flat()) if (c != null && c !== false) node.appendChild(c);
|
for (const c of children.flat())
|
||||||
|
if (c != null && c !== false)
|
||||||
|
node.appendChild(typeof c === "object" ? c : document.createTextNode(String(c)));
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -264,7 +264,7 @@ function row(m, meta, reload) {
|
|||||||
try {
|
try {
|
||||||
await api.deleteModel(m.id);
|
await api.deleteModel(m.id);
|
||||||
toast(t("toast.deleted"), "good");
|
toast(t("toast.deleted"), "good");
|
||||||
reload();
|
await reload();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
toast(String(e.message || e), "bad");
|
toast(String(e.message || e), "bad");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user