@tokagent/tokagentos 2.0.20 → 2.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -115,8 +115,24 @@ function configureBillingChatMirror(): void {
|
|
|
115
115
|
.replace(/\/v1$/, "");
|
|
116
116
|
process.env.OPENAI_API_KEY = process.env.BILLING_CHAT_KEY!.trim();
|
|
117
117
|
process.env.OPENAI_BASE_URL = `${base}/v1`;
|
|
118
|
+
|
|
119
|
+
// Default model: glm-4.7 is on the Tokamak LiteLLM allowlist. Without
|
|
120
|
+
// this, plugin-openai falls back to its OpenAI default (gpt-4o-mini /
|
|
121
|
+
// gpt-4o), which the billing gateway rejects with
|
|
122
|
+
// "unsupported_model" — and the agent's retry loop turns a fast 400
|
|
123
|
+
// into a multi-minute "Something went wrong" UX. User can override
|
|
124
|
+
// with OPENAI_SMALL_MODEL / OPENAI_LARGE_MODEL in .env.
|
|
125
|
+
const TOKAMAK_DEFAULT_MODEL = "glm-4.7";
|
|
126
|
+
if (!process.env.OPENAI_SMALL_MODEL?.trim()) {
|
|
127
|
+
process.env.OPENAI_SMALL_MODEL = TOKAMAK_DEFAULT_MODEL;
|
|
128
|
+
}
|
|
129
|
+
if (!process.env.OPENAI_LARGE_MODEL?.trim()) {
|
|
130
|
+
process.env.OPENAI_LARGE_MODEL = TOKAMAK_DEFAULT_MODEL;
|
|
131
|
+
}
|
|
118
132
|
console.info(
|
|
119
|
-
"[tokagent] BILLING_CHAT_KEY + TOKAGENT_GATEWAY_URL detected — wired as OpenAI-compatible provider for chat
|
|
133
|
+
"[tokagent] BILLING_CHAT_KEY + TOKAGENT_GATEWAY_URL detected — wired as OpenAI-compatible provider for chat (model=" +
|
|
134
|
+
process.env.OPENAI_SMALL_MODEL +
|
|
135
|
+
").",
|
|
120
136
|
);
|
|
121
137
|
}
|
|
122
138
|
configureBillingChatMirror();
|