refactor(plugins): move auth and model policy to providers

This commit is contained in:
Peter Steinberger
2026-03-15 20:58:59 -07:00
parent ca2f046668
commit a33caab280
30 changed files with 1080 additions and 653 deletions

View File

@@ -98,6 +98,16 @@ const zaiPlugin = {
},
wrapStreamFn: (ctx) =>
createZaiToolStreamWrapper(ctx.streamFn, ctx.extraParams?.tool_stream !== false),
isBinaryThinking: () => true,
isModernModelRef: ({ modelId }) => {
const lower = modelId.trim().toLowerCase();
return (
lower.startsWith("glm-5") ||
lower.startsWith("glm-4.7") ||
lower.startsWith("glm-4.7-flash") ||
lower.startsWith("glm-4.7-flashx")
);
},
resolveUsageAuth: async (ctx) => {
const apiKey = ctx.resolveApiKeyFromConfigAndStore({
providerIds: [PROVIDER_ID, "z-ai"],