fix: clamp z.ai developer role
This commit is contained in:
1 parent
7660a78330
commit
57e6a9a762
5 files changed
+383
-1
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import type { Api, Model } from "@mariozechner/pi-ai";
|
||||
|
||||
export function normalizeModelCompat(model: Model<Api>): Model<Api> {
|
||||
const baseUrl = model.baseUrl ?? "";
|
||||
const isZai = model.provider === "zai" || baseUrl.includes("api.z.ai");
|
||||
if (!isZai) return model;
|
||||
|
||||
const compat = model.compat ?? {};
|
||||
if (compat.supportsDeveloperRole === false) return model;
|
||||
|
||||
model.compat = { ...compat, supportsDeveloperRole: false };
|
||||
return model;
|
||||
}
|
||||
Reference in new issue
Block a user