@prestyj/ai 4.13.3 → 4.14.0
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/index.cjs +17 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
3
|
import OpenAI from 'openai';
|
|
4
4
|
|
|
5
|
-
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "palsu";
|
|
5
|
+
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "sakana" | "palsu";
|
|
6
6
|
type ThinkingLevel = "low" | "medium" | "high" | "xhigh" | "max";
|
|
7
7
|
type CacheRetention = "none" | "short" | "long";
|
|
8
8
|
interface TextContent {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
3
|
import OpenAI from 'openai';
|
|
4
4
|
|
|
5
|
-
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "palsu";
|
|
5
|
+
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "sakana" | "palsu";
|
|
6
6
|
type ThinkingLevel = "low" | "medium" | "high" | "xhigh" | "max";
|
|
7
7
|
type CacheRetention = "none" | "short" | "long";
|
|
8
8
|
interface TextContent {
|
package/dist/index.js
CHANGED
|
@@ -57,6 +57,7 @@ var PROVIDER_DISPLAY = {
|
|
|
57
57
|
moonshot: "Moonshot",
|
|
58
58
|
deepseek: "DeepSeek",
|
|
59
59
|
openrouter: "OpenRouter",
|
|
60
|
+
sakana: "Sakana",
|
|
60
61
|
xiaomi: "Xiaomi (MiMo)",
|
|
61
62
|
minimax: "MiniMax"
|
|
62
63
|
};
|
|
@@ -965,8 +966,12 @@ function toOpenAIToolChoice(choice) {
|
|
|
965
966
|
if (choice === "required") return "required";
|
|
966
967
|
return { type: "function", function: { name: choice.name } };
|
|
967
968
|
}
|
|
968
|
-
function toOpenAIReasoningEffort(level,
|
|
969
|
-
|
|
969
|
+
function toOpenAIReasoningEffort(level, model) {
|
|
970
|
+
const effort = level === "max" ? "xhigh" : level;
|
|
971
|
+
if (model.startsWith("fugu") && (effort === "low" || effort === "medium")) {
|
|
972
|
+
return "high";
|
|
973
|
+
}
|
|
974
|
+
return effort;
|
|
970
975
|
}
|
|
971
976
|
function normalizeAnthropicStopReason(reason) {
|
|
972
977
|
switch (reason) {
|
|
@@ -3129,6 +3134,16 @@ providerRegistry.register("openrouter", {
|
|
|
3129
3134
|
baseUrl: options.baseUrl ?? "https://openrouter.ai/api/v1"
|
|
3130
3135
|
})
|
|
3131
3136
|
});
|
|
3137
|
+
providerRegistry.register("sakana", {
|
|
3138
|
+
// Sakana Fugu is a multi-agent system exposed as a standard LLM through the
|
|
3139
|
+
// OpenAI-compatible Sakana API. We ride the Chat Completions transport (the
|
|
3140
|
+
// Responses API is also offered). Fugu models only accept "high"/"xhigh"
|
|
3141
|
+
// reasoning effort — clamped centrally in toOpenAIReasoningEffort.
|
|
3142
|
+
stream: (options) => streamOpenAI({
|
|
3143
|
+
...options,
|
|
3144
|
+
baseUrl: options.baseUrl ?? "https://api.sakana.ai/v1"
|
|
3145
|
+
})
|
|
3146
|
+
});
|
|
3132
3147
|
providerRegistry.register("minimax", {
|
|
3133
3148
|
stream: (options) => streamAnthropic({
|
|
3134
3149
|
...options,
|