@aituber-onair/chat 0.48.0 → 0.50.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/README.ja.md +125 -21
- package/README.md +132 -21
- package/dist/cjs/constants/claude.d.ts +15 -0
- package/dist/cjs/constants/claude.d.ts.map +1 -1
- package/dist/cjs/constants/claude.js +61 -1
- package/dist/cjs/constants/claude.js.map +1 -1
- package/dist/cjs/constants/deepseek.d.ts +6 -0
- package/dist/cjs/constants/deepseek.d.ts.map +1 -1
- package/dist/cjs/constants/deepseek.js +47 -0
- package/dist/cjs/constants/deepseek.js.map +1 -1
- package/dist/cjs/constants/kimi.d.ts +5 -1
- package/dist/cjs/constants/kimi.d.ts.map +1 -1
- package/dist/cjs/constants/kimi.js +8 -1
- package/dist/cjs/constants/kimi.js.map +1 -1
- package/dist/cjs/constants/openrouter.d.ts +18 -0
- package/dist/cjs/constants/openrouter.d.ts.map +1 -1
- package/dist/cjs/constants/openrouter.js +88 -1
- package/dist/cjs/constants/openrouter.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/ChatServiceFactory.d.ts.map +1 -1
- package/dist/cjs/services/ChatServiceFactory.js +17 -2
- package/dist/cjs/services/ChatServiceFactory.js.map +1 -1
- package/dist/cjs/services/providers/ChatServiceProvider.d.ts +22 -5
- package/dist/cjs/services/providers/ChatServiceProvider.d.ts.map +1 -1
- package/dist/cjs/services/providers/claude/ClaudeChatService.d.ts +3 -1
- package/dist/cjs/services/providers/claude/ClaudeChatService.d.ts.map +1 -1
- package/dist/cjs/services/providers/claude/ClaudeChatService.js +51 -4
- package/dist/cjs/services/providers/claude/ClaudeChatService.js.map +1 -1
- package/dist/cjs/services/providers/claude/ClaudeChatServiceProvider.d.ts.map +1 -1
- package/dist/cjs/services/providers/claude/ClaudeChatServiceProvider.js +13 -2
- package/dist/cjs/services/providers/claude/ClaudeChatServiceProvider.js.map +1 -1
- package/dist/cjs/services/providers/claude/claudeMessageConverter.d.ts.map +1 -1
- package/dist/cjs/services/providers/claude/claudeMessageConverter.js +7 -1
- package/dist/cjs/services/providers/claude/claudeMessageConverter.js.map +1 -1
- package/dist/cjs/services/providers/deepseek/DeepSeekChatService.d.ts +2 -1
- package/dist/cjs/services/providers/deepseek/DeepSeekChatService.d.ts.map +1 -1
- package/dist/cjs/services/providers/deepseek/DeepSeekChatService.js +9 -2
- package/dist/cjs/services/providers/deepseek/DeepSeekChatService.js.map +1 -1
- package/dist/cjs/services/providers/deepseek/DeepSeekChatServiceProvider.d.ts.map +1 -1
- package/dist/cjs/services/providers/deepseek/DeepSeekChatServiceProvider.js +1 -1
- package/dist/cjs/services/providers/deepseek/DeepSeekChatServiceProvider.js.map +1 -1
- package/dist/cjs/services/providers/geminiNano/GeminiNanoChatService.d.ts +8 -3
- package/dist/cjs/services/providers/geminiNano/GeminiNanoChatService.d.ts.map +1 -1
- package/dist/cjs/services/providers/geminiNano/GeminiNanoChatService.js +85 -32
- package/dist/cjs/services/providers/geminiNano/GeminiNanoChatService.js.map +1 -1
- package/dist/cjs/services/providers/geminiNano/GeminiNanoChatServiceProvider.d.ts.map +1 -1
- package/dist/cjs/services/providers/geminiNano/GeminiNanoChatServiceProvider.js +1 -0
- package/dist/cjs/services/providers/geminiNano/GeminiNanoChatServiceProvider.js.map +1 -1
- package/dist/cjs/services/providers/kimi/KimiChatService.d.ts.map +1 -1
- package/dist/cjs/services/providers/kimi/KimiChatService.js +3 -5
- package/dist/cjs/services/providers/kimi/KimiChatService.js.map +1 -1
- package/dist/cjs/services/providers/kimi/KimiChatServiceProvider.d.ts.map +1 -1
- package/dist/cjs/services/providers/kimi/KimiChatServiceProvider.js +1 -1
- package/dist/cjs/services/providers/kimi/KimiChatServiceProvider.js.map +1 -1
- package/dist/cjs/services/providers/openai/openaiRequestBuilder.d.ts.map +1 -1
- package/dist/cjs/services/providers/openai/openaiRequestBuilder.js +8 -0
- package/dist/cjs/services/providers/openai/openaiRequestBuilder.js.map +1 -1
- package/dist/cjs/services/providers/openrouter/OpenRouterChatService.d.ts +2 -1
- package/dist/cjs/services/providers/openrouter/OpenRouterChatService.d.ts.map +1 -1
- package/dist/cjs/services/providers/openrouter/OpenRouterChatService.js +41 -23
- package/dist/cjs/services/providers/openrouter/OpenRouterChatService.js.map +1 -1
- package/dist/cjs/services/providers/openrouter/OpenRouterChatServiceProvider.d.ts.map +1 -1
- package/dist/cjs/services/providers/openrouter/OpenRouterChatServiceProvider.js +16 -0
- package/dist/cjs/services/providers/openrouter/OpenRouterChatServiceProvider.js.map +1 -1
- package/dist/cjs/types/chat.d.ts +2 -0
- package/dist/cjs/types/chat.d.ts.map +1 -1
- package/dist/cjs/types/toolChat.d.ts +2 -3
- package/dist/cjs/types/toolChat.d.ts.map +1 -1
- package/dist/cjs/utils/openaiCompatibleSse.d.ts +1 -0
- package/dist/cjs/utils/openaiCompatibleSse.d.ts.map +1 -1
- package/dist/cjs/utils/openaiCompatibleSse.js +22 -0
- package/dist/cjs/utils/openaiCompatibleSse.js.map +1 -1
- package/dist/esm/constants/claude.d.ts +15 -0
- package/dist/esm/constants/claude.d.ts.map +1 -1
- package/dist/esm/constants/claude.js +56 -0
- package/dist/esm/constants/claude.js.map +1 -1
- package/dist/esm/constants/deepseek.d.ts +6 -0
- package/dist/esm/constants/deepseek.d.ts.map +1 -1
- package/dist/esm/constants/deepseek.js +43 -0
- package/dist/esm/constants/deepseek.js.map +1 -1
- package/dist/esm/constants/kimi.d.ts +5 -1
- package/dist/esm/constants/kimi.d.ts.map +1 -1
- package/dist/esm/constants/kimi.js +7 -1
- package/dist/esm/constants/kimi.js.map +1 -1
- package/dist/esm/constants/openrouter.d.ts +18 -0
- package/dist/esm/constants/openrouter.d.ts.map +1 -1
- package/dist/esm/constants/openrouter.js +83 -0
- package/dist/esm/constants/openrouter.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/ChatServiceFactory.d.ts.map +1 -1
- package/dist/esm/services/ChatServiceFactory.js +17 -2
- package/dist/esm/services/ChatServiceFactory.js.map +1 -1
- package/dist/esm/services/providers/ChatServiceProvider.d.ts +22 -5
- package/dist/esm/services/providers/ChatServiceProvider.d.ts.map +1 -1
- package/dist/esm/services/providers/claude/ClaudeChatService.d.ts +3 -1
- package/dist/esm/services/providers/claude/ClaudeChatService.d.ts.map +1 -1
- package/dist/esm/services/providers/claude/ClaudeChatService.js +52 -5
- package/dist/esm/services/providers/claude/ClaudeChatService.js.map +1 -1
- package/dist/esm/services/providers/claude/ClaudeChatServiceProvider.d.ts.map +1 -1
- package/dist/esm/services/providers/claude/ClaudeChatServiceProvider.js +14 -3
- package/dist/esm/services/providers/claude/ClaudeChatServiceProvider.js.map +1 -1
- package/dist/esm/services/providers/claude/claudeMessageConverter.d.ts.map +1 -1
- package/dist/esm/services/providers/claude/claudeMessageConverter.js +7 -1
- package/dist/esm/services/providers/claude/claudeMessageConverter.js.map +1 -1
- package/dist/esm/services/providers/deepseek/DeepSeekChatService.d.ts +2 -1
- package/dist/esm/services/providers/deepseek/DeepSeekChatService.d.ts.map +1 -1
- package/dist/esm/services/providers/deepseek/DeepSeekChatService.js +10 -3
- package/dist/esm/services/providers/deepseek/DeepSeekChatService.js.map +1 -1
- package/dist/esm/services/providers/deepseek/DeepSeekChatServiceProvider.d.ts.map +1 -1
- package/dist/esm/services/providers/deepseek/DeepSeekChatServiceProvider.js +1 -1
- package/dist/esm/services/providers/deepseek/DeepSeekChatServiceProvider.js.map +1 -1
- package/dist/esm/services/providers/geminiNano/GeminiNanoChatService.d.ts +8 -3
- package/dist/esm/services/providers/geminiNano/GeminiNanoChatService.d.ts.map +1 -1
- package/dist/esm/services/providers/geminiNano/GeminiNanoChatService.js +86 -33
- package/dist/esm/services/providers/geminiNano/GeminiNanoChatService.js.map +1 -1
- package/dist/esm/services/providers/geminiNano/GeminiNanoChatServiceProvider.d.ts.map +1 -1
- package/dist/esm/services/providers/geminiNano/GeminiNanoChatServiceProvider.js +1 -0
- package/dist/esm/services/providers/geminiNano/GeminiNanoChatServiceProvider.js.map +1 -1
- package/dist/esm/services/providers/kimi/KimiChatService.d.ts.map +1 -1
- package/dist/esm/services/providers/kimi/KimiChatService.js +4 -6
- package/dist/esm/services/providers/kimi/KimiChatService.js.map +1 -1
- package/dist/esm/services/providers/kimi/KimiChatServiceProvider.d.ts.map +1 -1
- package/dist/esm/services/providers/kimi/KimiChatServiceProvider.js +2 -2
- package/dist/esm/services/providers/kimi/KimiChatServiceProvider.js.map +1 -1
- package/dist/esm/services/providers/openai/openaiRequestBuilder.d.ts.map +1 -1
- package/dist/esm/services/providers/openai/openaiRequestBuilder.js +8 -0
- package/dist/esm/services/providers/openai/openaiRequestBuilder.js.map +1 -1
- package/dist/esm/services/providers/openrouter/OpenRouterChatService.d.ts +2 -1
- package/dist/esm/services/providers/openrouter/OpenRouterChatService.d.ts.map +1 -1
- package/dist/esm/services/providers/openrouter/OpenRouterChatService.js +42 -24
- package/dist/esm/services/providers/openrouter/OpenRouterChatService.js.map +1 -1
- package/dist/esm/services/providers/openrouter/OpenRouterChatServiceProvider.d.ts.map +1 -1
- package/dist/esm/services/providers/openrouter/OpenRouterChatServiceProvider.js +17 -1
- package/dist/esm/services/providers/openrouter/OpenRouterChatServiceProvider.js.map +1 -1
- package/dist/esm/types/chat.d.ts +2 -0
- package/dist/esm/types/chat.d.ts.map +1 -1
- package/dist/esm/types/toolChat.d.ts +2 -3
- package/dist/esm/types/toolChat.d.ts.map +1 -1
- package/dist/esm/utils/openaiCompatibleSse.d.ts +1 -0
- package/dist/esm/utils/openaiCompatibleSse.d.ts.map +1 -1
- package/dist/esm/utils/openaiCompatibleSse.js +22 -0
- package/dist/esm/utils/openaiCompatibleSse.js.map +1 -1
- package/dist/umd/aituber-onair-chat.js +444 -63
- package/dist/umd/aituber-onair-chat.min.js +9 -11
- package/package.json +1 -1
|
@@ -2,10 +2,16 @@ export declare const DEEPSEEK_API_BASE_URL = "https://api.deepseek.com";
|
|
|
2
2
|
export declare const ENDPOINT_DEEPSEEK_CHAT_COMPLETIONS_API = "https://api.deepseek.com/chat/completions";
|
|
3
3
|
export declare const MODEL_DEEPSEEK_V4_FLASH = "deepseek-v4-flash";
|
|
4
4
|
export declare const MODEL_DEEPSEEK_V4_PRO = "deepseek-v4-pro";
|
|
5
|
+
export type DeepSeekReasoningEffort = 'none' | 'low' | 'high' | 'max';
|
|
5
6
|
/** @deprecated Use MODEL_DEEPSEEK_V4_FLASH instead. */
|
|
6
7
|
export declare const MODEL_DEEPSEEK_CHAT = "deepseek-chat";
|
|
7
8
|
/** @deprecated Use MODEL_DEEPSEEK_V4_FLASH or MODEL_DEEPSEEK_V4_PRO instead. */
|
|
8
9
|
export declare const MODEL_DEEPSEEK_REASONER = "deepseek-reasoner";
|
|
9
10
|
export declare const DEEPSEEK_SUPPORTED_MODELS: string[];
|
|
10
11
|
export declare const DEEPSEEK_DEPRECATED_MODELS: string[];
|
|
12
|
+
export declare function getDeepSeekSupportedReasoningEfforts(model: string): readonly DeepSeekReasoningEffort[];
|
|
13
|
+
export declare function isDeepSeekReasoningEffortModel(model: string): boolean;
|
|
14
|
+
/** Chat-oriented default that disables DeepSeek thinking for lower latency. */
|
|
15
|
+
export declare function getDefaultDeepSeekReasoningEffort(model: string): DeepSeekReasoningEffort | undefined;
|
|
16
|
+
export declare function normalizeDeepSeekReasoningEffort(model: string, effort?: DeepSeekReasoningEffort): DeepSeekReasoningEffort | undefined;
|
|
11
17
|
//# sourceMappingURL=deepseek.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepseek.d.ts","sourceRoot":"","sources":["../../../src/constants/deepseek.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,6BAA6B,CAAC;AAChE,eAAO,MAAM,sCAAsC,8CAA8C,CAAC;AAGlG,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"deepseek.d.ts","sourceRoot":"","sources":["../../../src/constants/deepseek.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,6BAA6B,CAAC;AAChE,eAAO,MAAM,sCAAsC,8CAA8C,CAAC;AAGlG,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAgBtE,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,gFAAgF;AAChF,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAE3D,eAAO,MAAM,yBAAyB,UAGrC,CAAC;AAEF,eAAO,MAAM,0BAA0B,UAGtC,CAAC;AAEF,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,MAAM,GACZ,SAAS,uBAAuB,EAAE,CAUpC;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErE;AAED,+EAA+E;AAC/E,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,MAAM,GACZ,uBAAuB,GAAG,SAAS,CAErC;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,uBAAuB,GAC/B,uBAAuB,GAAG,SAAS,CAkBrC"}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEEPSEEK_DEPRECATED_MODELS = exports.DEEPSEEK_SUPPORTED_MODELS = exports.MODEL_DEEPSEEK_REASONER = exports.MODEL_DEEPSEEK_CHAT = exports.MODEL_DEEPSEEK_V4_PRO = exports.MODEL_DEEPSEEK_V4_FLASH = exports.ENDPOINT_DEEPSEEK_CHAT_COMPLETIONS_API = exports.DEEPSEEK_API_BASE_URL = void 0;
|
|
4
|
+
exports.getDeepSeekSupportedReasoningEfforts = getDeepSeekSupportedReasoningEfforts;
|
|
5
|
+
exports.isDeepSeekReasoningEffortModel = isDeepSeekReasoningEffortModel;
|
|
6
|
+
exports.getDefaultDeepSeekReasoningEffort = getDefaultDeepSeekReasoningEffort;
|
|
7
|
+
exports.normalizeDeepSeekReasoningEffort = normalizeDeepSeekReasoningEffort;
|
|
4
8
|
exports.DEEPSEEK_API_BASE_URL = 'https://api.deepseek.com';
|
|
5
9
|
exports.ENDPOINT_DEEPSEEK_CHAT_COMPLETIONS_API = `${exports.DEEPSEEK_API_BASE_URL}/chat/completions`;
|
|
6
10
|
// DeepSeek V4 models
|
|
7
11
|
exports.MODEL_DEEPSEEK_V4_FLASH = 'deepseek-v4-flash';
|
|
8
12
|
exports.MODEL_DEEPSEEK_V4_PRO = 'deepseek-v4-pro';
|
|
13
|
+
const DEEPSEEK_V4_FLASH_REASONING_EFFORTS = [
|
|
14
|
+
'none',
|
|
15
|
+
'low',
|
|
16
|
+
'high',
|
|
17
|
+
'max',
|
|
18
|
+
];
|
|
19
|
+
const DEEPSEEK_V4_PRO_REASONING_EFFORTS = [
|
|
20
|
+
'none',
|
|
21
|
+
'high',
|
|
22
|
+
'max',
|
|
23
|
+
];
|
|
9
24
|
// Legacy DeepSeek model aliases
|
|
10
25
|
/** @deprecated Use MODEL_DEEPSEEK_V4_FLASH instead. */
|
|
11
26
|
exports.MODEL_DEEPSEEK_CHAT = 'deepseek-chat';
|
|
@@ -19,4 +34,36 @@ exports.DEEPSEEK_DEPRECATED_MODELS = [
|
|
|
19
34
|
exports.MODEL_DEEPSEEK_CHAT,
|
|
20
35
|
exports.MODEL_DEEPSEEK_REASONER,
|
|
21
36
|
];
|
|
37
|
+
function getDeepSeekSupportedReasoningEfforts(model) {
|
|
38
|
+
if (model === exports.MODEL_DEEPSEEK_V4_FLASH) {
|
|
39
|
+
return DEEPSEEK_V4_FLASH_REASONING_EFFORTS;
|
|
40
|
+
}
|
|
41
|
+
if (model === exports.MODEL_DEEPSEEK_V4_PRO) {
|
|
42
|
+
return DEEPSEEK_V4_PRO_REASONING_EFFORTS;
|
|
43
|
+
}
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
function isDeepSeekReasoningEffortModel(model) {
|
|
47
|
+
return getDeepSeekSupportedReasoningEfforts(model).length > 0;
|
|
48
|
+
}
|
|
49
|
+
/** Chat-oriented default that disables DeepSeek thinking for lower latency. */
|
|
50
|
+
function getDefaultDeepSeekReasoningEffort(model) {
|
|
51
|
+
return isDeepSeekReasoningEffortModel(model) ? 'none' : undefined;
|
|
52
|
+
}
|
|
53
|
+
function normalizeDeepSeekReasoningEffort(model, effort) {
|
|
54
|
+
const supported = getDeepSeekSupportedReasoningEfforts(model);
|
|
55
|
+
if (supported.length === 0) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
const requested = effort ?? getDefaultDeepSeekReasoningEffort(model);
|
|
59
|
+
if (requested && supported.includes(requested)) {
|
|
60
|
+
return requested;
|
|
61
|
+
}
|
|
62
|
+
// DeepSeek currently maps V4 Pro low to high. Normalize it explicitly so
|
|
63
|
+
// callers and capability metadata observe the effective behavior.
|
|
64
|
+
if (model === exports.MODEL_DEEPSEEK_V4_PRO && requested === 'low') {
|
|
65
|
+
return 'high';
|
|
66
|
+
}
|
|
67
|
+
return getDefaultDeepSeekReasoningEffort(model);
|
|
68
|
+
}
|
|
22
69
|
//# sourceMappingURL=deepseek.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepseek.js","sourceRoot":"","sources":["../../../src/constants/deepseek.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"deepseek.js","sourceRoot":"","sources":["../../../src/constants/deepseek.ts"],"names":[],"mappings":";;;AAsCA,oFAYC;AAED,wEAEC;AAGD,8EAIC;A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C9D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,IAAI,iCAAiC,CAAC,KAAK,CAAC,CAAC;IACrE,IAAI,SAAS,IAAI,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,yEAAyE;IACzE,kEAAkE;IAClE,IAAI,KAAK,KAAK,6BAAqB,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,iCAAiC,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -4,7 +4,7 @@ export declare const MODEL_KIMI_K2_7_CODE = "kimi-k2.7-code";
|
|
|
4
4
|
export declare const MODEL_KIMI_K2_7_CODE_HIGHSPEED = "kimi-k2.7-code-highspeed";
|
|
5
5
|
export declare const MODEL_KIMI_K2_6 = "kimi-k2.6";
|
|
6
6
|
export declare const MODEL_KIMI_K2_5 = "kimi-k2.5";
|
|
7
|
-
export type KimiReasoningEffort = 'max';
|
|
7
|
+
export type KimiReasoningEffort = 'low' | 'high' | 'max';
|
|
8
8
|
export declare const KIMI_VISION_SUPPORTED_MODELS: string[];
|
|
9
9
|
export declare const KIMI_THINKING_REQUIRED_MODELS: string[];
|
|
10
10
|
/**
|
|
@@ -19,6 +19,10 @@ export declare function isKimiThinkingRequiredModel(model: string): boolean;
|
|
|
19
19
|
* Get officially supported reasoning effort values for a Kimi model.
|
|
20
20
|
*/
|
|
21
21
|
export declare function getKimiSupportedReasoningEfforts(model: string): readonly KimiReasoningEffort[];
|
|
22
|
+
/**
|
|
23
|
+
* Get the official default reasoning effort for a Kimi model.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getDefaultKimiReasoningEffort(model: string): KimiReasoningEffort | undefined;
|
|
22
26
|
/**
|
|
23
27
|
* Check if a model uses reasoning_effort instead of the K2.x thinking field.
|
|
24
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi.d.ts","sourceRoot":"","sources":["../../../src/constants/kimi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kCAAkC,gDACA,CAAC;AAGhD,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,eAAO,MAAM,8BAA8B,6BAA6B,CAAC;AACzE,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"kimi.d.ts","sourceRoot":"","sources":["../../../src/constants/kimi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kCAAkC,gDACA,CAAC;AAGhD,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,eAAO,MAAM,8BAA8B,6BAA6B,CAAC;AACzE,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAUzD,eAAO,MAAM,4BAA4B,UAMxC,CAAC;AAGF,eAAO,MAAM,6BAA6B,UAGzC,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElE;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,GACZ,SAAS,mBAAmB,EAAE,CAEhC;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,MAAM,GACZ,mBAAmB,GAAG,SAAS,CAEjC;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjE"}
|
|
@@ -4,6 +4,7 @@ exports.KIMI_THINKING_REQUIRED_MODELS = exports.KIMI_VISION_SUPPORTED_MODELS = e
|
|
|
4
4
|
exports.isKimiVisionModel = isKimiVisionModel;
|
|
5
5
|
exports.isKimiThinkingRequiredModel = isKimiThinkingRequiredModel;
|
|
6
6
|
exports.getKimiSupportedReasoningEfforts = getKimiSupportedReasoningEfforts;
|
|
7
|
+
exports.getDefaultKimiReasoningEffort = getDefaultKimiReasoningEffort;
|
|
7
8
|
exports.isKimiReasoningEffortModel = isKimiReasoningEffortModel;
|
|
8
9
|
exports.ENDPOINT_KIMI_CHAT_COMPLETIONS_API = 'https://api.moonshot.ai/v1/chat/completions';
|
|
9
10
|
// Kimi models
|
|
@@ -13,7 +14,7 @@ exports.MODEL_KIMI_K2_7_CODE_HIGHSPEED = 'kimi-k2.7-code-highspeed';
|
|
|
13
14
|
exports.MODEL_KIMI_K2_6 = 'kimi-k2.6';
|
|
14
15
|
exports.MODEL_KIMI_K2_5 = 'kimi-k2.5';
|
|
15
16
|
const KIMI_REASONING_EFFORTS_BY_MODEL = {
|
|
16
|
-
[exports.MODEL_KIMI_K3]: ['max'],
|
|
17
|
+
[exports.MODEL_KIMI_K3]: ['low', 'high', 'max'],
|
|
17
18
|
};
|
|
18
19
|
// Vision support for models
|
|
19
20
|
exports.KIMI_VISION_SUPPORTED_MODELS = [
|
|
@@ -46,6 +47,12 @@ function isKimiThinkingRequiredModel(model) {
|
|
|
46
47
|
function getKimiSupportedReasoningEfforts(model) {
|
|
47
48
|
return KIMI_REASONING_EFFORTS_BY_MODEL[model] ?? [];
|
|
48
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Get the official default reasoning effort for a Kimi model.
|
|
52
|
+
*/
|
|
53
|
+
function getDefaultKimiReasoningEffort(model) {
|
|
54
|
+
return model === exports.MODEL_KIMI_K3 ? 'max' : undefined;
|
|
55
|
+
}
|
|
49
56
|
/**
|
|
50
57
|
* Check if a model uses reasoning_effort instead of the K2.x thinking field.
|
|
51
58
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi.js","sourceRoot":"","sources":["../../../src/constants/kimi.ts"],"names":[],"mappings":";;;AAqCA,8CAEC;AAKD,kEAEC;AAKD,4EAIC;AAKD,gEAEC;
|
|
1
|
+
{"version":3,"file":"kimi.js","sourceRoot":"","sources":["../../../src/constants/kimi.ts"],"names":[],"mappings":";;;AAqCA,8CAEC;AAKD,kEAEC;AAKD,4EAIC;AAKD,sEAIC;AAKD,gEAEC;AAvEY,QAAA,kCAAkC,GAC7C,6CAA6C,CAAC;AAEhD,cAAc;AACD,QAAA,aAAa,GAAG,SAAS,CAAC;AAC1B,QAAA,oBAAoB,GAAG,gBAAgB,CAAC;AACxC,QAAA,8BAA8B,GAAG,0BAA0B,CAAC;AAC5D,QAAA,eAAe,GAAG,WAAW,CAAC;AAC9B,QAAA,eAAe,GAAG,WAAW,CAAC;AAI3C,MAAM,+BAA+B,GAGjC;IACF,CAAC,qBAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;CACxC,CAAC;AAEF,4BAA4B;AACf,QAAA,4BAA4B,GAAG;IAC1C,qBAAa;IACb,4BAAoB;IACpB,sCAA8B;IAC9B,uBAAe;IACf,uBAAe;CAChB,CAAC;AAEF,8CAA8C;AACjC,QAAA,6BAA6B,GAAG;IAC3C,4BAAoB;IACpB,sCAA8B;CAC/B,CAAC;AAEF;;GAEG;AACH,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,OAAO,oCAA4B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,SAAgB,2BAA2B,CAAC,KAAa;IACvD,OAAO,qCAA6B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,SAAgB,gCAAgC,CAC9C,KAAa;IAEb,OAAO,+BAA+B,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,SAAgB,6BAA6B,CAC3C,KAAa;IAEb,OAAO,KAAK,KAAK,qBAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,SAAgB,0BAA0B,CAAC,KAAa;IACtD,OAAO,gCAAgC,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
export declare const ENDPOINT_OPENROUTER_API = "https://openrouter.ai/api/v1/chat/completions";
|
|
2
2
|
export declare const MODEL_OPENROUTER_AUTO = "openrouter/auto";
|
|
3
|
+
export declare const MODEL_OPENROUTER_AUTO_BETA = "openrouter/auto-beta";
|
|
3
4
|
export declare const MODEL_OPENROUTER_FUSION = "openrouter/fusion";
|
|
4
5
|
export declare const MODEL_GPT_OSS_20B_FREE = "openai/gpt-oss-20b:free";
|
|
6
|
+
export declare const MODEL_MOONSHOTAI_KIMI_K3 = "moonshotai/kimi-k3";
|
|
5
7
|
export declare const MODEL_MOONSHOTAI_KIMI_K2_7_CODE = "moonshotai/kimi-k2.7-code";
|
|
6
8
|
export declare const MODEL_MOONSHOTAI_KIMI_K2_5 = "moonshotai/kimi-k2.5";
|
|
7
9
|
export declare const MODEL_MOONSHOTAI_KIMI_LATEST = "~moonshotai/kimi-latest";
|
|
8
10
|
export declare const MODEL_OPENAI_GPT_LATEST = "~openai/gpt-latest";
|
|
9
11
|
export declare const MODEL_OPENAI_GPT_MINI_LATEST = "~openai/gpt-mini-latest";
|
|
12
|
+
export declare const MODEL_OPENAI_GPT_5_6_SOL = "openai/gpt-5.6-sol";
|
|
13
|
+
export declare const MODEL_OPENAI_GPT_5_6_TERRA = "openai/gpt-5.6-terra";
|
|
14
|
+
export declare const MODEL_OPENAI_GPT_5_6_LUNA = "openai/gpt-5.6-luna";
|
|
10
15
|
export declare const MODEL_OPENAI_GPT_5_5_PRO = "openai/gpt-5.5-pro";
|
|
11
16
|
export declare const MODEL_OPENAI_GPT_5_5 = "openai/gpt-5.5";
|
|
12
17
|
export declare const MODEL_OPENAI_GPT_5_1_CHAT = "openai/gpt-5.1-chat";
|
|
@@ -18,6 +23,7 @@ export declare const MODEL_OPENAI_GPT_4_1_MINI = "openai/gpt-4.1-mini";
|
|
|
18
23
|
export declare const MODEL_OPENAI_GPT_4_1_NANO = "openai/gpt-4.1-nano";
|
|
19
24
|
export declare const MODEL_ANTHROPIC_CLAUDE_SONNET_LATEST = "~anthropic/claude-sonnet-latest";
|
|
20
25
|
export declare const MODEL_ANTHROPIC_CLAUDE_HAIKU_LATEST = "~anthropic/claude-haiku-latest";
|
|
26
|
+
export declare const MODEL_ANTHROPIC_CLAUDE_OPUS_5 = "anthropic/claude-opus-5";
|
|
21
27
|
export declare const MODEL_ANTHROPIC_CLAUDE_OPUS_4 = "anthropic/claude-opus-4";
|
|
22
28
|
export declare const MODEL_ANTHROPIC_CLAUDE_SONNET_4 = "anthropic/claude-sonnet-4";
|
|
23
29
|
export declare const MODEL_ANTHROPIC_CLAUDE_3_7_SONNET = "anthropic/claude-3.7-sonnet";
|
|
@@ -25,6 +31,8 @@ export declare const MODEL_ANTHROPIC_CLAUDE_3_5_SONNET = "anthropic/claude-3.5-s
|
|
|
25
31
|
export declare const MODEL_ANTHROPIC_CLAUDE_4_5_HAIKU = "anthropic/claude-haiku-4.5";
|
|
26
32
|
export declare const MODEL_GOOGLE_GEMINI_PRO_LATEST = "~google/gemini-pro-latest";
|
|
27
33
|
export declare const MODEL_GOOGLE_GEMINI_FLASH_LATEST = "~google/gemini-flash-latest";
|
|
34
|
+
export declare const MODEL_GOOGLE_GEMINI_3_6_FLASH = "google/gemini-3.6-flash";
|
|
35
|
+
export declare const MODEL_GOOGLE_GEMINI_3_5_FLASH_LITE = "google/gemini-3.5-flash-lite";
|
|
28
36
|
export declare const MODEL_GOOGLE_GEMINI_2_5_PRO = "google/gemini-2.5-pro";
|
|
29
37
|
export declare const MODEL_GOOGLE_GEMINI_2_5_FLASH = "google/gemini-2.5-flash";
|
|
30
38
|
export declare const MODEL_GOOGLE_GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025 = "google/gemini-2.5-flash-lite-preview-09-2025";
|
|
@@ -32,6 +40,13 @@ export declare const MODEL_ZAI_GLM_5_2 = "z-ai/glm-5.2";
|
|
|
32
40
|
export declare const MODEL_ZAI_GLM_4_7_FLASH = "z-ai/glm-4.7-flash";
|
|
33
41
|
export declare const MODEL_ZAI_GLM_4_5_AIR = "z-ai/glm-4.5-air";
|
|
34
42
|
export declare const MODEL_ZAI_GLM_4_5_AIR_FREE = "z-ai/glm-4.5-air:free";
|
|
43
|
+
export declare const MODEL_KWAIPILOT_KAT_CODER_AIR_V2_5 = "kwaipilot/kat-coder-air-v2.5";
|
|
44
|
+
export declare const MODEL_KWAIPILOT_KAT_CODER_PRO_V2_5 = "kwaipilot/kat-coder-pro-v2.5";
|
|
45
|
+
export declare const MODEL_XAI_GROK_LATEST = "~x-ai/grok-latest";
|
|
46
|
+
export declare const MODEL_XAI_GROK_4_5 = "x-ai/grok-4.5";
|
|
47
|
+
export declare const MODEL_OPENROUTER_DEEPSEEK_V4_FLASH = "deepseek/deepseek-v4-flash";
|
|
48
|
+
export declare const MODEL_OPENROUTER_DEEPSEEK_V4_FLASH_0731 = "deepseek/deepseek-v4-flash-0731";
|
|
49
|
+
export type OpenRouterReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
35
50
|
export declare const OPENROUTER_FREE_MODELS: string[];
|
|
36
51
|
export declare const OPENROUTER_VISION_SUPPORTED_MODELS: string[];
|
|
37
52
|
export declare const OPENROUTER_FREE_RATE_LIMIT_PER_MINUTE = 20;
|
|
@@ -50,4 +65,7 @@ export declare function isOpenRouterFreeModel(model: string): boolean;
|
|
|
50
65
|
* @returns True if the model supports vision
|
|
51
66
|
*/
|
|
52
67
|
export declare function isOpenRouterVisionModel(model: string): boolean;
|
|
68
|
+
export declare function getOpenRouterSupportedReasoningEfforts(model: string): readonly OpenRouterReasoningEffort[];
|
|
69
|
+
export declare function getDefaultOpenRouterReasoningEffort(model: string): OpenRouterReasoningEffort | undefined;
|
|
70
|
+
export declare function normalizeOpenRouterReasoningEffort(model: string, effort?: OpenRouterReasoningEffort): OpenRouterReasoningEffort | undefined;
|
|
53
71
|
//# sourceMappingURL=openrouter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openrouter.d.ts","sourceRoot":"","sources":["../../../src/constants/openrouter.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,kDACa,CAAC;AAGlD,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AACvD,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAChE,eAAO,MAAM,+BAA+B,8BAA8B,CAAC;AAC3E,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AACtE,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AACtE,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAC7D,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAC/D,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAC/D,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAC/D,eAAO,MAAM,oCAAoC,o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CAAkC,iCACf,CAAC;AACjC,eAAO,MAAM,kCAAkC,iCACf,CAAC;AACjC,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,eAAO,MAAM,kCAAkC,+BAA+B,CAAC;AAC/E,eAAO,MAAM,uCAAuC,oCACjB,CAAC;AAEpC,MAAM,MAAM,yBAAyB,GACjC,MAAM,GACN,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,KAAK,CAAC;AAwBV,eAAO,MAAM,sBAAsB,UAGlC,CAAC;AAGF,eAAO,MAAM,kCAAkC,UAoC9C,CAAC;AAGF,eAAO,MAAM,qCAAqC,KAAK,CAAC;AACxD,eAAO,MAAM,uCAAuC,KAAK,CAAC;AAC1D,eAAO,MAAM,wCAAwC,OAAO,CAAC;AAC7D,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI9D;AAED,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,MAAM,GACZ,SAAS,yBAAyB,EAAE,CAWtC;AAED,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,MAAM,GACZ,yBAAyB,GAAG,SAAS,CAOvC;AAED,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,yBAAyB,GACjC,yBAAyB,GAAG,SAAS,CA0BvC"}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.OPENROUTER_VISION_SUPPORTED_MODELS = exports.OPENROUTER_FREE_MODELS = exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH_0731 = exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH = exports.MODEL_XAI_GROK_4_5 = exports.MODEL_XAI_GROK_LATEST = exports.MODEL_KWAIPILOT_KAT_CODER_PRO_V2_5 = exports.MODEL_KWAIPILOT_KAT_CODER_AIR_V2_5 = exports.MODEL_ZAI_GLM_4_5_AIR_FREE = exports.MODEL_ZAI_GLM_4_5_AIR = exports.MODEL_ZAI_GLM_4_7_FLASH = exports.MODEL_ZAI_GLM_5_2 = exports.MODEL_GOOGLE_GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025 = exports.MODEL_GOOGLE_GEMINI_2_5_FLASH = exports.MODEL_GOOGLE_GEMINI_2_5_PRO = exports.MODEL_GOOGLE_GEMINI_3_5_FLASH_LITE = exports.MODEL_GOOGLE_GEMINI_3_6_FLASH = exports.MODEL_GOOGLE_GEMINI_FLASH_LATEST = exports.MODEL_GOOGLE_GEMINI_PRO_LATEST = exports.MODEL_ANTHROPIC_CLAUDE_4_5_HAIKU = exports.MODEL_ANTHROPIC_CLAUDE_3_5_SONNET = exports.MODEL_ANTHROPIC_CLAUDE_3_7_SONNET = exports.MODEL_ANTHROPIC_CLAUDE_SONNET_4 = exports.MODEL_ANTHROPIC_CLAUDE_OPUS_4 = exports.MODEL_ANTHROPIC_CLAUDE_OPUS_5 = exports.MODEL_ANTHROPIC_CLAUDE_HAIKU_LATEST = exports.MODEL_ANTHROPIC_CLAUDE_SONNET_LATEST = exports.MODEL_OPENAI_GPT_4_1_NANO = exports.MODEL_OPENAI_GPT_4_1_MINI = exports.MODEL_OPENAI_GPT_4O = exports.MODEL_OPENAI_GPT_5_NANO = exports.MODEL_OPENAI_GPT_5_MINI = exports.MODEL_OPENAI_GPT_5_1_CODEX = exports.MODEL_OPENAI_GPT_5_1_CHAT = exports.MODEL_OPENAI_GPT_5_5 = exports.MODEL_OPENAI_GPT_5_5_PRO = exports.MODEL_OPENAI_GPT_5_6_LUNA = exports.MODEL_OPENAI_GPT_5_6_TERRA = exports.MODEL_OPENAI_GPT_5_6_SOL = exports.MODEL_OPENAI_GPT_MINI_LATEST = exports.MODEL_OPENAI_GPT_LATEST = exports.MODEL_MOONSHOTAI_KIMI_LATEST = exports.MODEL_MOONSHOTAI_KIMI_K2_5 = exports.MODEL_MOONSHOTAI_KIMI_K2_7_CODE = exports.MODEL_MOONSHOTAI_KIMI_K3 = exports.MODEL_GPT_OSS_20B_FREE = exports.MODEL_OPENROUTER_FUSION = exports.MODEL_OPENROUTER_AUTO_BETA = exports.MODEL_OPENROUTER_AUTO = exports.ENDPOINT_OPENROUTER_API = void 0;
|
|
4
|
+
exports.OPENROUTER_CREDITS_THRESHOLD = exports.OPENROUTER_FREE_DAILY_LIMIT_HIGH_CREDITS = exports.OPENROUTER_FREE_DAILY_LIMIT_LOW_CREDITS = exports.OPENROUTER_FREE_RATE_LIMIT_PER_MINUTE = void 0;
|
|
4
5
|
exports.isOpenRouterFreeModel = isOpenRouterFreeModel;
|
|
5
6
|
exports.isOpenRouterVisionModel = isOpenRouterVisionModel;
|
|
7
|
+
exports.getOpenRouterSupportedReasoningEfforts = getOpenRouterSupportedReasoningEfforts;
|
|
8
|
+
exports.getDefaultOpenRouterReasoningEffort = getDefaultOpenRouterReasoningEffort;
|
|
9
|
+
exports.normalizeOpenRouterReasoningEffort = normalizeOpenRouterReasoningEffort;
|
|
6
10
|
exports.ENDPOINT_OPENROUTER_API = 'https://openrouter.ai/api/v1/chat/completions';
|
|
7
11
|
// OpenRouter models
|
|
8
12
|
exports.MODEL_OPENROUTER_AUTO = 'openrouter/auto';
|
|
13
|
+
exports.MODEL_OPENROUTER_AUTO_BETA = 'openrouter/auto-beta';
|
|
9
14
|
exports.MODEL_OPENROUTER_FUSION = 'openrouter/fusion';
|
|
10
15
|
exports.MODEL_GPT_OSS_20B_FREE = 'openai/gpt-oss-20b:free';
|
|
16
|
+
exports.MODEL_MOONSHOTAI_KIMI_K3 = 'moonshotai/kimi-k3';
|
|
11
17
|
exports.MODEL_MOONSHOTAI_KIMI_K2_7_CODE = 'moonshotai/kimi-k2.7-code';
|
|
12
18
|
exports.MODEL_MOONSHOTAI_KIMI_K2_5 = 'moonshotai/kimi-k2.5';
|
|
13
19
|
exports.MODEL_MOONSHOTAI_KIMI_LATEST = '~moonshotai/kimi-latest';
|
|
14
20
|
exports.MODEL_OPENAI_GPT_LATEST = '~openai/gpt-latest';
|
|
15
21
|
exports.MODEL_OPENAI_GPT_MINI_LATEST = '~openai/gpt-mini-latest';
|
|
22
|
+
exports.MODEL_OPENAI_GPT_5_6_SOL = 'openai/gpt-5.6-sol';
|
|
23
|
+
exports.MODEL_OPENAI_GPT_5_6_TERRA = 'openai/gpt-5.6-terra';
|
|
24
|
+
exports.MODEL_OPENAI_GPT_5_6_LUNA = 'openai/gpt-5.6-luna';
|
|
16
25
|
exports.MODEL_OPENAI_GPT_5_5_PRO = 'openai/gpt-5.5-pro';
|
|
17
26
|
exports.MODEL_OPENAI_GPT_5_5 = 'openai/gpt-5.5';
|
|
18
27
|
exports.MODEL_OPENAI_GPT_5_1_CHAT = 'openai/gpt-5.1-chat';
|
|
@@ -24,6 +33,7 @@ exports.MODEL_OPENAI_GPT_4_1_MINI = 'openai/gpt-4.1-mini';
|
|
|
24
33
|
exports.MODEL_OPENAI_GPT_4_1_NANO = 'openai/gpt-4.1-nano';
|
|
25
34
|
exports.MODEL_ANTHROPIC_CLAUDE_SONNET_LATEST = '~anthropic/claude-sonnet-latest';
|
|
26
35
|
exports.MODEL_ANTHROPIC_CLAUDE_HAIKU_LATEST = '~anthropic/claude-haiku-latest';
|
|
36
|
+
exports.MODEL_ANTHROPIC_CLAUDE_OPUS_5 = 'anthropic/claude-opus-5';
|
|
27
37
|
exports.MODEL_ANTHROPIC_CLAUDE_OPUS_4 = 'anthropic/claude-opus-4';
|
|
28
38
|
exports.MODEL_ANTHROPIC_CLAUDE_SONNET_4 = 'anthropic/claude-sonnet-4';
|
|
29
39
|
exports.MODEL_ANTHROPIC_CLAUDE_3_7_SONNET = 'anthropic/claude-3.7-sonnet';
|
|
@@ -31,6 +41,8 @@ exports.MODEL_ANTHROPIC_CLAUDE_3_5_SONNET = 'anthropic/claude-3.5-sonnet';
|
|
|
31
41
|
exports.MODEL_ANTHROPIC_CLAUDE_4_5_HAIKU = 'anthropic/claude-haiku-4.5';
|
|
32
42
|
exports.MODEL_GOOGLE_GEMINI_PRO_LATEST = '~google/gemini-pro-latest';
|
|
33
43
|
exports.MODEL_GOOGLE_GEMINI_FLASH_LATEST = '~google/gemini-flash-latest';
|
|
44
|
+
exports.MODEL_GOOGLE_GEMINI_3_6_FLASH = 'google/gemini-3.6-flash';
|
|
45
|
+
exports.MODEL_GOOGLE_GEMINI_3_5_FLASH_LITE = 'google/gemini-3.5-flash-lite';
|
|
34
46
|
exports.MODEL_GOOGLE_GEMINI_2_5_PRO = 'google/gemini-2.5-pro';
|
|
35
47
|
exports.MODEL_GOOGLE_GEMINI_2_5_FLASH = 'google/gemini-2.5-flash';
|
|
36
48
|
exports.MODEL_GOOGLE_GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025 = 'google/gemini-2.5-flash-lite-preview-09-2025';
|
|
@@ -38,6 +50,30 @@ exports.MODEL_ZAI_GLM_5_2 = 'z-ai/glm-5.2';
|
|
|
38
50
|
exports.MODEL_ZAI_GLM_4_7_FLASH = 'z-ai/glm-4.7-flash';
|
|
39
51
|
exports.MODEL_ZAI_GLM_4_5_AIR = 'z-ai/glm-4.5-air';
|
|
40
52
|
exports.MODEL_ZAI_GLM_4_5_AIR_FREE = 'z-ai/glm-4.5-air:free';
|
|
53
|
+
exports.MODEL_KWAIPILOT_KAT_CODER_AIR_V2_5 = 'kwaipilot/kat-coder-air-v2.5';
|
|
54
|
+
exports.MODEL_KWAIPILOT_KAT_CODER_PRO_V2_5 = 'kwaipilot/kat-coder-pro-v2.5';
|
|
55
|
+
exports.MODEL_XAI_GROK_LATEST = '~x-ai/grok-latest';
|
|
56
|
+
exports.MODEL_XAI_GROK_4_5 = 'x-ai/grok-4.5';
|
|
57
|
+
exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH = 'deepseek/deepseek-v4-flash';
|
|
58
|
+
exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH_0731 = 'deepseek/deepseek-v4-flash-0731';
|
|
59
|
+
const DEFAULT_OPENROUTER_REASONING_EFFORTS = [
|
|
60
|
+
'none',
|
|
61
|
+
'minimal',
|
|
62
|
+
'low',
|
|
63
|
+
'medium',
|
|
64
|
+
'high',
|
|
65
|
+
];
|
|
66
|
+
const OPENROUTER_DEEPSEEK_V4_FLASH_REASONING_EFFORTS = [
|
|
67
|
+
'none',
|
|
68
|
+
'high',
|
|
69
|
+
'xhigh',
|
|
70
|
+
];
|
|
71
|
+
const OPENROUTER_DEEPSEEK_V4_FLASH_0731_REASONING_EFFORTS = [
|
|
72
|
+
'none',
|
|
73
|
+
'low',
|
|
74
|
+
'high',
|
|
75
|
+
'max',
|
|
76
|
+
];
|
|
41
77
|
// Free tier models
|
|
42
78
|
exports.OPENROUTER_FREE_MODELS = [
|
|
43
79
|
exports.MODEL_GPT_OSS_20B_FREE,
|
|
@@ -45,9 +81,14 @@ exports.OPENROUTER_FREE_MODELS = [
|
|
|
45
81
|
];
|
|
46
82
|
// Vision supported models on OpenRouter
|
|
47
83
|
exports.OPENROUTER_VISION_SUPPORTED_MODELS = [
|
|
84
|
+
exports.MODEL_OPENROUTER_AUTO_BETA,
|
|
85
|
+
exports.MODEL_MOONSHOTAI_KIMI_K3,
|
|
48
86
|
exports.MODEL_MOONSHOTAI_KIMI_LATEST,
|
|
49
87
|
exports.MODEL_OPENAI_GPT_LATEST,
|
|
50
88
|
exports.MODEL_OPENAI_GPT_MINI_LATEST,
|
|
89
|
+
exports.MODEL_OPENAI_GPT_5_6_SOL,
|
|
90
|
+
exports.MODEL_OPENAI_GPT_5_6_TERRA,
|
|
91
|
+
exports.MODEL_OPENAI_GPT_5_6_LUNA,
|
|
51
92
|
exports.MODEL_OPENAI_GPT_5_5_PRO,
|
|
52
93
|
exports.MODEL_OPENAI_GPT_5_5,
|
|
53
94
|
exports.MODEL_OPENAI_GPT_5_1_CHAT,
|
|
@@ -59,17 +100,22 @@ exports.OPENROUTER_VISION_SUPPORTED_MODELS = [
|
|
|
59
100
|
exports.MODEL_OPENAI_GPT_4_1_NANO,
|
|
60
101
|
exports.MODEL_ANTHROPIC_CLAUDE_SONNET_LATEST,
|
|
61
102
|
exports.MODEL_ANTHROPIC_CLAUDE_HAIKU_LATEST,
|
|
103
|
+
exports.MODEL_ANTHROPIC_CLAUDE_OPUS_5,
|
|
62
104
|
exports.MODEL_ANTHROPIC_CLAUDE_OPUS_4,
|
|
63
105
|
exports.MODEL_ANTHROPIC_CLAUDE_SONNET_4,
|
|
64
106
|
exports.MODEL_ANTHROPIC_CLAUDE_3_7_SONNET,
|
|
65
107
|
exports.MODEL_ANTHROPIC_CLAUDE_4_5_HAIKU,
|
|
66
108
|
exports.MODEL_GOOGLE_GEMINI_PRO_LATEST,
|
|
67
109
|
exports.MODEL_GOOGLE_GEMINI_FLASH_LATEST,
|
|
110
|
+
exports.MODEL_GOOGLE_GEMINI_3_6_FLASH,
|
|
111
|
+
exports.MODEL_GOOGLE_GEMINI_3_5_FLASH_LITE,
|
|
68
112
|
exports.MODEL_GOOGLE_GEMINI_2_5_PRO,
|
|
69
113
|
exports.MODEL_GOOGLE_GEMINI_2_5_FLASH,
|
|
70
114
|
exports.MODEL_GOOGLE_GEMINI_2_5_FLASH_LITE_PREVIEW_09_2025,
|
|
71
115
|
exports.MODEL_MOONSHOTAI_KIMI_K2_7_CODE,
|
|
72
116
|
exports.MODEL_MOONSHOTAI_KIMI_K2_5,
|
|
117
|
+
exports.MODEL_XAI_GROK_LATEST,
|
|
118
|
+
exports.MODEL_XAI_GROK_4_5,
|
|
73
119
|
];
|
|
74
120
|
// Rate limits for free tier
|
|
75
121
|
exports.OPENROUTER_FREE_RATE_LIMIT_PER_MINUTE = 20;
|
|
@@ -92,4 +138,45 @@ function isOpenRouterFreeModel(model) {
|
|
|
92
138
|
function isOpenRouterVisionModel(model) {
|
|
93
139
|
return exports.OPENROUTER_VISION_SUPPORTED_MODELS.some((visionModel) => model.includes(visionModel));
|
|
94
140
|
}
|
|
141
|
+
function getOpenRouterSupportedReasoningEfforts(model) {
|
|
142
|
+
const normalizedModel = model.trim();
|
|
143
|
+
if (normalizedModel === exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH) {
|
|
144
|
+
return OPENROUTER_DEEPSEEK_V4_FLASH_REASONING_EFFORTS;
|
|
145
|
+
}
|
|
146
|
+
if (normalizedModel === exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH_0731) {
|
|
147
|
+
return OPENROUTER_DEEPSEEK_V4_FLASH_0731_REASONING_EFFORTS;
|
|
148
|
+
}
|
|
149
|
+
return DEFAULT_OPENROUTER_REASONING_EFFORTS;
|
|
150
|
+
}
|
|
151
|
+
function getDefaultOpenRouterReasoningEffort(model) {
|
|
152
|
+
const normalizedModel = model.trim();
|
|
153
|
+
return normalizedModel === exports.MODEL_ZAI_GLM_5_2 ||
|
|
154
|
+
normalizedModel === exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH ||
|
|
155
|
+
normalizedModel === exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH_0731
|
|
156
|
+
? 'none'
|
|
157
|
+
: undefined;
|
|
158
|
+
}
|
|
159
|
+
function normalizeOpenRouterReasoningEffort(model, effort) {
|
|
160
|
+
const normalizedModel = model.trim();
|
|
161
|
+
const requested = effort ?? getDefaultOpenRouterReasoningEffort(model);
|
|
162
|
+
if (!requested) {
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
const supported = getOpenRouterSupportedReasoningEfforts(model);
|
|
166
|
+
if (supported.includes(requested)) {
|
|
167
|
+
return requested;
|
|
168
|
+
}
|
|
169
|
+
if (normalizedModel === exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH) {
|
|
170
|
+
return requested === 'max' ? 'xhigh' : 'none';
|
|
171
|
+
}
|
|
172
|
+
if (normalizedModel === exports.MODEL_OPENROUTER_DEEPSEEK_V4_FLASH_0731) {
|
|
173
|
+
if (requested === 'minimal' || requested === 'medium') {
|
|
174
|
+
return 'low';
|
|
175
|
+
}
|
|
176
|
+
if (requested === 'xhigh') {
|
|
177
|
+
return 'high';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return requested;
|
|
181
|
+
}
|
|
95
182
|
//# sourceMappingURL=openrouter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openrouter.js","sourceRoot":"","sources":["../../../src/constants/openrouter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openrouter.js","sourceRoot":"","sources":["../../../src/constants/openrouter.ts"],"names":[],"mappings":";;;;AAiJA,sDAEC;AAOD,0DAIC;AAED,wFAaC;AAED,kFASC;AAED,gFA6BC;AAvNY,QAAA,uBAAuB,GAClC,+CAA+C,CAAC;AAElD,oBAAoB;AACP,QAAA,qBAAqB,GAAG,iBAAiB,CAAC;AAC1C,QAAA,0BAA0B,GAAG,sBAAsB,CAAC;AACpD,QAAA,uBAAuB,GAAG,mBAAmB,CAAC;AAC9C,QAAA,sBAAsB,GAAG,yBAAyB,CAAC;AACnD,QAAA,wBAAwB,GAAG,oBAAoB,CAAC;AAChD,QAAA,+BAA+B,GAAG,2BAA2B,CAAC;AAC9D,QAAA,0BAA0B,GAAG,sBAAsB,CAAC;AACpD,QAAA,4BAA4B,GAAG,yBAAyB,CAAC;AACzD,QAAA,uBAAuB,GAAG,oBAAoB,CAAC;AAC/C,QAAA,4BAA4B,GAAG,yBAAyB,CAAC;AACzD,QAAA,wBAAwB,GAAG,oBAAoB,CAAC;AAChD,QAAA,0BAA0B,GAAG,sBAAsB,CAAC;AACpD,QAAA,yBAAyB,GAAG,qBAAqB,CAAC;AAClD,QAAA,wBAAwB,GAAG,oBAAoB,CAAC;AAChD,QAAA,oBAAoB,GAAG,gBAAgB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AC3D,OAAO,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,CAAC;IAED,IAAI,eAAe,KAAK,+CAAuC,EAAE,CAAC;QAChE,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YACtD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export * from './types';
|
|
6
6
|
export type { ChatService } from './services/ChatService';
|
|
7
7
|
export { ChatServiceFactory } from './services/ChatServiceFactory';
|
|
8
|
-
export type { ChatServiceOptions, ChatServiceOptionsByProvider, ChatProviderName, OpenAIChatServiceOptions, OpenAICompatibleChatServiceOptions, OpenRouterChatServiceOptions, GeminiChatServiceOptions, GeminiNanoChatServiceOptions, ClaudeChatServiceOptions, ZAIChatServiceOptions, XAIChatServiceOptions, KimiChatServiceOptions, DeepSeekChatServiceOptions, MistralChatServiceOptions, SakanaChatServiceOptions, PlamoChatServiceOptions, ChatServiceProvider, VisionSupportLevel, } from './services/providers/ChatServiceProvider';
|
|
8
|
+
export type { ChatServiceOptions, ChatServiceOptionsByProvider, ChatProviderName, OpenAIChatServiceOptions, OpenAICompatibleChatServiceOptions, OpenRouterChatServiceOptions, GeminiChatServiceOptions, GeminiNanoChatServiceOptions, GeminiNanoInitialPrompt, ClaudeChatServiceOptions, ZAIChatServiceOptions, XAIChatServiceOptions, KimiChatServiceOptions, DeepSeekChatServiceOptions, MistralChatServiceOptions, SakanaChatServiceOptions, PlamoChatServiceOptions, ChatServiceProvider, VisionSupportLevel, } from './services/providers/ChatServiceProvider';
|
|
9
9
|
export { OpenAIChatService } from './services/providers/openai/OpenAIChatService';
|
|
10
10
|
export { OpenAIChatServiceProvider } from './services/providers/openai/OpenAIChatServiceProvider';
|
|
11
11
|
export { OpenAICompatibleChatServiceProvider } from './services/providers/openaiCompatible/OpenAICompatibleChatServiceProvider';
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,SAAS,CAAC;AAGxB,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,YAAY,EACV,kBAAkB,EAClB,4BAA4B,EAC5B,gBAAgB,EAChB,wBAAwB,EACxB,kCAAkC,EAClC,4BAA4B,EAC5B,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,mCAAmC,EAAE,MAAM,2EAA2E,CAAC;AAGhI,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAGlG,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,6BAA6B,EAAE,MAAM,+DAA+D,CAAC;AAG9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAGlG,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD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G,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAC;AAGrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAGlG,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAG/F,cAAc,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAEH,2BAA2B;AAC3B,0CAAwB;AAIxB,oEAAmE;AAA1D,wHAAA,kBAAkB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAEH,2BAA2B;AAC3B,0CAAwB;AAIxB,oEAAmE;AAA1D,wHAAA,kBAAkB,OAAA;AAyB3B,0BAA0B;AAC1B,mFAAkF;AAAzE,sHAAA,iBAAiB,OAAA;AAC1B,mGAAkG;AAAzF,sIAAA,yBAAyB,OAAA;AAClC,iIAAgI;AAAvH,0JAAA,mCAAmC,OAAA;AAE5C,0BAA0B;AAC1B,mFAAkF;AAAzE,sHAAA,iBAAiB,OAAA;AAC1B,mGAAkG;AAAzF,sIAAA,yBAAyB,OAAA;AAElC,+BAA+B;AAC/B,+FAA8F;AAArF,8HAAA,qBAAqB,OAAA;AAC9B,+GAA8G;AAArG,8IAAA,6BAA6B,OAAA;AAEtC,0BAA0B;AAC1B,mFAAkF;AAAzE,sHAAA,iBAA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AKtE;;OAEG;IACH,MAAM,CAAC,6BAA6B,CAClC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GACZ,kBAAkB;CAkBtB"}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChatServiceFactory = void 0;
|
|
4
4
|
const providers_1 = require("./providers");
|
|
5
|
+
const claude_1 = require("../constants/claude");
|
|
6
|
+
const kimi_1 = require("../constants/kimi");
|
|
7
|
+
const deepseek_1 = require("../constants/deepseek");
|
|
8
|
+
const openrouter_1 = require("../constants/openrouter");
|
|
5
9
|
const TOOL_SUPPORTED_PROVIDERS = new Set([
|
|
6
10
|
'openai',
|
|
7
11
|
'openai-compatible',
|
|
@@ -25,11 +29,14 @@ const JSON_MODE_SUPPORTED_PROVIDERS = new Set([
|
|
|
25
29
|
]);
|
|
26
30
|
const REASONING_EFFORT_BY_PROVIDER = {
|
|
27
31
|
openai: ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'],
|
|
32
|
+
claude: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
28
33
|
gemini: ['minimal', 'low', 'medium', 'high'],
|
|
29
|
-
openrouter: ['none', 'minimal', 'low', 'medium', 'high'],
|
|
34
|
+
openrouter: ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'],
|
|
35
|
+
kimi: ['low', 'high', 'max'],
|
|
30
36
|
mistral: ['low', 'medium', 'high'],
|
|
31
37
|
plamo: ['none', 'medium'],
|
|
32
38
|
xai: ['none', 'low', 'medium', 'high'],
|
|
39
|
+
deepseek: ['none', 'low', 'high', 'max'],
|
|
33
40
|
};
|
|
34
41
|
/**
|
|
35
42
|
* Chat service factory
|
|
@@ -97,7 +104,15 @@ class ChatServiceFactory {
|
|
|
97
104
|
mcp: MCP_SUPPORTED_PROVIDERS.has(providerName),
|
|
98
105
|
jsonMode: JSON_MODE_SUPPORTED_PROVIDERS.has(providerName),
|
|
99
106
|
responseLength: true,
|
|
100
|
-
reasoningEffort:
|
|
107
|
+
reasoningEffort: providerName === 'claude' && model
|
|
108
|
+
? [...(0, claude_1.getClaudeSupportedReasoningEfforts)(model)]
|
|
109
|
+
: providerName === 'kimi' && model
|
|
110
|
+
? [...(0, kimi_1.getKimiSupportedReasoningEfforts)(model)]
|
|
111
|
+
: providerName === 'deepseek' && model
|
|
112
|
+
? [...(0, deepseek_1.getDeepSeekSupportedReasoningEfforts)(model)]
|
|
113
|
+
: providerName === 'openrouter' && model
|
|
114
|
+
? [...(0, openrouter_1.getOpenRouterSupportedReasoningEfforts)(model)]
|
|
115
|
+
: (REASONING_EFFORT_BY_PROVIDER[providerName] ?? []),
|
|
101
116
|
};
|
|
102
117
|
}
|
|
103
118
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatServiceFactory.js","sourceRoot":"","sources":["../../../src/services/ChatServiceFactory.ts"],"names":[],"mappings":";;;AAQA,2CAA6D;
|
|
1
|
+
{"version":3,"file":"ChatServiceFactory.js","sourceRoot":"","sources":["../../../src/services/ChatServiceFactory.ts"],"names":[],"mappings":";;;AAQA,2CAA6D;AAE7D,gDAAyE;AACzE,4CAAqE;AACrE,oDAA6E;AAC7E,wDAAiF;AAEjF,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAS;IAC/C,QAAQ;IACR,mBAAmB;IACnB,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,KAAK;IACL,MAAM;IACN,UAAU;IACV,SAAS;IACT,QAAQ;IACR,OAAO;CACR,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEhF,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAAS;IACpD,QAAQ;IACR,mBAAmB;IACnB,KAAK;IACL,MAAM;CACP,CAAC,CAAC;AAEH,MAAM,4BAA4B,GAA6B;IAC7D,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Y,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,aAAa,CAAC;QACvB,CAAC;QAED,IAAI,QAAQ,CAAC,6BAA6B,EAAE,CAAC;YAC3C,OAAO,QAAQ,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,QAAQ,CAAC,sBAAsB,EAAE,CAAC;YACpC,OAAO,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC;gBAC3C,CAAC,CAAC,WAAW;gBACb,CAAC,CAAC,aAAa,CAAC;QACpB,CAAC;QAED,OAAO,QAAQ,CAAC,qBAAqB,EAAE,CAAC;IAC1C,CAAC;;AAjJH,gDAkJC;AAjJC,kCAAkC;AACnB,4BAAS,GAA0C,IAAI,GAAG,EAAE,CAAC;AAkJ9E,0CAA8B,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAClD,kBAAkB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAC9C,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { ChatService } from '../ChatService';
|
|
2
2
|
import { ChatResponseLength, GPT5PresetKey } from '../../constants/chat';
|
|
3
3
|
import type { GeminiReasoningEffort } from '../../constants/gemini';
|
|
4
|
+
import type { ClaudeReasoningEffort } from '../../constants/claude';
|
|
4
5
|
import type { MistralReasoningEffort } from '../../constants/mistral';
|
|
5
6
|
import type { PlamoReasoningEffort } from '../../constants/plamo';
|
|
6
7
|
import type { XaiReasoningEffort } from '../../constants/xai';
|
|
7
8
|
import type { KimiReasoningEffort } from '../../constants/kimi';
|
|
9
|
+
import type { DeepSeekReasoningEffort } from '../../constants/deepseek';
|
|
10
|
+
import type { OpenRouterReasoningEffort } from '../../constants/openrouter';
|
|
8
11
|
import { ToolDefinition, MCPServerConfig } from '../../types';
|
|
9
12
|
/**
|
|
10
13
|
* Options for chat service providers
|
|
@@ -62,7 +65,7 @@ export type OpenAICompatibleChatServiceOptions = Omit<OpenAIChatServiceOptions,
|
|
|
62
65
|
mcpServers?: never;
|
|
63
66
|
};
|
|
64
67
|
export type OpenRouterChatServiceOptions = DisallowKeys<BaseChatServiceOptions, 'gpt5Preset' | 'gpt5EndpointPreference' | 'enableReasoningSummary' | 'verbosity' | 'baseUrl' | 'thinking' | 'responseFormat'> & {
|
|
65
|
-
reasoning_effort?:
|
|
68
|
+
reasoning_effort?: OpenRouterReasoningEffort;
|
|
66
69
|
appName?: string;
|
|
67
70
|
appUrl?: string;
|
|
68
71
|
};
|
|
@@ -71,14 +74,19 @@ export type GeminiChatServiceOptions = DisallowKeys<BaseChatServiceOptions, 'end
|
|
|
71
74
|
reasoning_effort?: GeminiReasoningEffort;
|
|
72
75
|
mcpServers?: MCPServerConfig[];
|
|
73
76
|
};
|
|
74
|
-
export type ClaudeChatServiceOptions = DisallowKeys<BaseChatServiceOptions, 'endpoint' | 'baseUrl' | 'verbosity' | '
|
|
77
|
+
export type ClaudeChatServiceOptions = Omit<DisallowKeys<BaseChatServiceOptions, 'endpoint' | 'baseUrl' | 'verbosity' | 'gpt5Preset' | 'gpt5EndpointPreference' | 'enableReasoningSummary' | 'includeReasoning' | 'reasoningMaxTokens' | 'responseFormat' | 'thinking'>, 'reasoning_effort'> & {
|
|
78
|
+
/** Claude output effort, mapped to output_config.effort. */
|
|
79
|
+
reasoning_effort?: ClaudeReasoningEffort;
|
|
75
80
|
mcpServers?: MCPServerConfig[];
|
|
76
81
|
};
|
|
77
82
|
export type KimiChatServiceOptions = Omit<DisallowKeys<BaseChatServiceOptions, 'verbosity' | 'gpt5Preset' | 'gpt5EndpointPreference' | 'enableReasoningSummary' | 'includeReasoning' | 'reasoningMaxTokens'>, 'reasoning_effort'> & {
|
|
78
|
-
/** Kimi K3 reasoning effort.
|
|
83
|
+
/** Kimi K3 reasoning effort. Defaults to max. */
|
|
79
84
|
reasoning_effort?: KimiReasoningEffort;
|
|
80
85
|
};
|
|
81
|
-
export type DeepSeekChatServiceOptions = DisallowKeys<BaseChatServiceOptions, 'verbosity' | '
|
|
86
|
+
export type DeepSeekChatServiceOptions = Omit<DisallowKeys<BaseChatServiceOptions, 'verbosity' | 'gpt5Preset' | 'gpt5EndpointPreference' | 'enableReasoningSummary' | 'includeReasoning' | 'reasoningMaxTokens' | 'thinking' | 'responseFormat'>, 'reasoning_effort'> & {
|
|
87
|
+
/** DeepSeek thinking effort. Defaults to none for responsive chat. */
|
|
88
|
+
reasoning_effort?: DeepSeekReasoningEffort;
|
|
89
|
+
};
|
|
82
90
|
export type MistralChatServiceOptions = Omit<DisallowKeys<BaseChatServiceOptions, 'verbosity' | 'gpt5Preset' | 'gpt5EndpointPreference' | 'enableReasoningSummary' | 'includeReasoning' | 'reasoningMaxTokens' | 'thinking' | 'responseFormat'>, 'reasoning_effort'> & {
|
|
83
91
|
/** Mistral adjustable reasoning: only sent for supported models. */
|
|
84
92
|
reasoning_effort?: MistralReasoningEffort;
|
|
@@ -93,6 +101,10 @@ export type XAIChatServiceOptions = DisallowKeys<BaseChatServiceOptions, 'verbos
|
|
|
93
101
|
/** xAI reasoning effort. Only sent for models that support it. */
|
|
94
102
|
reasoning_effort?: XaiReasoningEffort;
|
|
95
103
|
};
|
|
104
|
+
export type GeminiNanoInitialPrompt = {
|
|
105
|
+
role: 'system' | 'user' | 'assistant';
|
|
106
|
+
content: string;
|
|
107
|
+
};
|
|
96
108
|
export type GeminiNanoChatServiceOptions = {
|
|
97
109
|
/** API Key is not needed for Gemini Nano (browser built-in AI) */
|
|
98
110
|
apiKey?: never;
|
|
@@ -100,7 +112,12 @@ export type GeminiNanoChatServiceOptions = {
|
|
|
100
112
|
model?: string;
|
|
101
113
|
/** Response length setting */
|
|
102
114
|
responseLength?: ChatResponseLength;
|
|
103
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* Initial system instructions and few-shot examples for the Prompt API.
|
|
117
|
+
* System prompts are normalized to the first entry before session creation.
|
|
118
|
+
*/
|
|
119
|
+
initialPrompts?: GeminiNanoInitialPrompt[];
|
|
120
|
+
/** Expected input languages for the Prompt API (default: ['ja', 'en']) */
|
|
104
121
|
expectedInputLanguages?: string[];
|
|
105
122
|
/** Expected output languages for the Prompt API (default: ['ja']) */
|
|
106
123
|
expectedOutputLanguages?: string[];
|