fix: fix configurations
CI / verify (pull_request) Successful in 10s

This commit is contained in:
2026-10-08 09:18:01 +02:00
parent dd71bcb4d4
commit deaa4bfd07
12 changed files with 232 additions and 250 deletions
+9
View File
@@ -0,0 +1,9 @@
/** Parses `provider/model[#variant]`; `name` prefixes the error for the offending option. */
export function model(reference: string, name: string) {
const [path = "", variant] = reference.split("#");
const slash = path.indexOf("/");
if (slash <= 0) throw new Error(`${name} must be provider/model[#variant]: ${reference}`);
const providerID = path.slice(0, slash);
const id = path.slice(slash + 1);
return variant ? { providerID, id, variant } : { providerID, id };
}