@bubblebrain-ai/bubble 0.0.27 → 0.0.28
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/dist/provider-anthropic.js +13 -0
- package/package.json +1 -1
|
@@ -6,6 +6,11 @@ const ANTHROPIC_VERSION = "2023-06-01";
|
|
|
6
6
|
const DEFAULT_MAX_TOKENS = 8192;
|
|
7
7
|
const ANTHROPIC_OPUS_LONG_OUTPUT_MAX_TOKENS = 128000;
|
|
8
8
|
const ANTHROPIC_LONG_OUTPUT_MAX_TOKENS = 64000;
|
|
9
|
+
// MiniMax thinking is always-on (M2.x) or default-on (M3), so the 8192 default
|
|
10
|
+
// gets consumed by thinking and the turn truncates before any visible text.
|
|
11
|
+
// MiniMax's docs recommend M3 128K, M2.x 64K output.
|
|
12
|
+
const MINIMAX_M3_MAX_TOKENS = 128000;
|
|
13
|
+
const MINIMAX_M2_MAX_TOKENS = 64000;
|
|
9
14
|
const ANTHROPIC_PROMPT_CACHE_CONTROL = { type: "ephemeral" };
|
|
10
15
|
const MINIMAX_PROMPT_CACHE_MODELS = new Set([
|
|
11
16
|
"minimax-m2.7",
|
|
@@ -122,6 +127,10 @@ export function buildAnthropicRequest(options, messages, chatOptions) {
|
|
|
122
127
|
return body;
|
|
123
128
|
}
|
|
124
129
|
export function resolveAnthropicMaxTokens(options, model) {
|
|
130
|
+
// MiniMax needs a large output budget so thinking doesn't starve the answer.
|
|
131
|
+
if (isMiniMaxProvider(options)) {
|
|
132
|
+
return /m3/i.test(model) ? MINIMAX_M3_MAX_TOKENS : MINIMAX_M2_MAX_TOKENS;
|
|
133
|
+
}
|
|
125
134
|
if (!isOfficialAnthropicBaseUrl(options.baseURL)) {
|
|
126
135
|
return DEFAULT_MAX_TOKENS;
|
|
127
136
|
}
|
|
@@ -724,3 +733,7 @@ function isOfficialAnthropicBaseUrl(baseURL) {
|
|
|
724
733
|
return false;
|
|
725
734
|
}
|
|
726
735
|
}
|
|
736
|
+
function isMiniMaxProvider(options) {
|
|
737
|
+
return (options.providerId || "").toLowerCase().startsWith("minimax")
|
|
738
|
+
|| options.baseURL.toLowerCase().includes("minimaxi");
|
|
739
|
+
}
|