@aituber-onair/chat 0.49.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 +20 -8
- package/README.md +20 -8
- 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/openrouter.d.ts +6 -0
- package/dist/cjs/constants/openrouter.d.ts.map +1 -1
- package/dist/cjs/constants/openrouter.js +66 -2
- package/dist/cjs/constants/openrouter.js.map +1 -1
- package/dist/cjs/services/ChatServiceFactory.d.ts.map +1 -1
- package/dist/cjs/services/ChatServiceFactory.js +9 -2
- package/dist/cjs/services/ChatServiceFactory.js.map +1 -1
- package/dist/cjs/services/providers/ChatServiceProvider.d.ts +7 -2
- package/dist/cjs/services/providers/ChatServiceProvider.d.ts.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 +1 -1
- package/dist/cjs/services/providers/geminiNano/GeminiNanoChatService.js +2 -2
- package/dist/cjs/services/providers/geminiNano/GeminiNanoChatService.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 +7 -8
- 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 +3 -0
- package/dist/cjs/services/providers/openrouter/OpenRouterChatServiceProvider.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/openrouter.d.ts +6 -0
- package/dist/esm/constants/openrouter.d.ts.map +1 -1
- package/dist/esm/constants/openrouter.js +61 -0
- package/dist/esm/constants/openrouter.js.map +1 -1
- package/dist/esm/services/ChatServiceFactory.d.ts.map +1 -1
- package/dist/esm/services/ChatServiceFactory.js +9 -2
- package/dist/esm/services/ChatServiceFactory.js.map +1 -1
- package/dist/esm/services/providers/ChatServiceProvider.d.ts +7 -2
- package/dist/esm/services/providers/ChatServiceProvider.d.ts.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 +1 -1
- package/dist/esm/services/providers/geminiNano/GeminiNanoChatService.js +2 -2
- package/dist/esm/services/providers/geminiNano/GeminiNanoChatService.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 +8 -9
- 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 +4 -1
- package/dist/esm/services/providers/openrouter/OpenRouterChatServiceProvider.js.map +1 -1
- package/dist/umd/aituber-onair-chat.js +145 -14
- package/dist/umd/aituber-onair-chat.min.js +7 -7
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -628,7 +628,8 @@ Gemini 3 モデルでは `reasoning_effort` を指定できます。この値は
|
|
|
628
628
|
```typescript
|
|
629
629
|
const openRouterService = ChatServiceFactory.createChatService('openrouter', {
|
|
630
630
|
apiKey: process.env.OPENROUTER_API_KEY,
|
|
631
|
-
model: '
|
|
631
|
+
model: 'deepseek/deepseek-v4-flash-0731',
|
|
632
|
+
reasoning_effort: 'none', // チャット向けの最速設定
|
|
632
633
|
// オプション: 分析用アプリ情報を追加
|
|
633
634
|
appName: 'あなたのアプリ名',
|
|
634
635
|
appUrl: 'https://your-app-url.com'
|
|
@@ -643,6 +644,10 @@ const openRouterService = ChatServiceFactory.createChatService('openrouter', {
|
|
|
643
644
|
- `openrouter/auto-beta` はタスクを判定するBetaルーターです。リクエストごとにモデルを選択し、そのモデルの料金が適用されます。選択結果はレスポンスの `model` またはOpenRouter Activityで確認できます。
|
|
644
645
|
- `openrouter/fusion` は複数モデルのパネルとジャッジモデルを実行します。単一モデルの固定単価ではなく、内部で使われた各モデル呼び出しと web search/fetch 利用分の合算で課金されます。
|
|
645
646
|
- `z-ai/glm-5.2` は OpenRouter reasoning も `none` にします。
|
|
647
|
+
- OpenRouterのreasoning無効化には `reasoning.effort: 'none'` を送ります。`exclude: true` はreasoning内容を返すかどうかだけを制御し、reasoning自体は無効化しません。
|
|
648
|
+
- DeepSeek V4 Flashのスナップショットは、再現可能なバージョンを選べるようOpenRouterのデフォルトではなく明示的なテキスト専用選択肢にしています。どちらも応答性重視で`none`がデフォルトです:
|
|
649
|
+
- `deepseek/deepseek-v4-flash-0731`: 現行の固定0731スナップショット。`none`, `low`, `high`, `max`に対応。
|
|
650
|
+
- `deepseek/deepseek-v4-flash`: 旧無印0423スナップショット。`none`, `high`, `xhigh`に対応。
|
|
646
651
|
- コーディング特化モデルはデフォルトではなく明示的な選択肢です。`kwaipilot/kat-coder-air-v2.5` と `kwaipilot/kat-coder-pro-v2.5` はテキスト専用です。
|
|
647
652
|
- `moonshotai/kimi-k3` の可用性は上流キャパシティに依存し、混雑時はOpenRouterから429レスポンスが返る場合があります。
|
|
648
653
|
- `x-ai/grok-4.5` には現在のEU制限を含む地域別の可用性制限があります。`~x-ai/grok-latest` がGrok 4.5へ解決される場合も同じ制限を受けます。
|
|
@@ -664,6 +669,7 @@ const openRouterService = ChatServiceFactory.createChatService('openrouter', {
|
|
|
664
669
|
- `google/gemini-2.5-pro`, `google/gemini-2.5-flash`, `google/gemini-2.5-flash-lite-preview-09-2025`
|
|
665
670
|
- `z-ai/glm-5.2`, `z-ai/glm-4.7-flash`, `z-ai/glm-4.5-air`, `z-ai/glm-4.5-air:free`
|
|
666
671
|
- `~x-ai/grok-latest`, `x-ai/grok-4.5`
|
|
672
|
+
- `deepseek/deepseek-v4-flash-0731`, `deepseek/deepseek-v4-flash`
|
|
667
673
|
- `~moonshotai/kimi-latest`, `moonshotai/kimi-k3`, `moonshotai/kimi-k2.7-code`, `moonshotai/kimi-k2.5`
|
|
668
674
|
- `kwaipilot/kat-coder-air-v2.5`, `kwaipilot/kat-coder-pro-v2.5`
|
|
669
675
|
|
|
@@ -772,6 +778,7 @@ const kimiService = ChatServiceFactory.createChatService('kimi', {
|
|
|
772
778
|
const deepSeekService = ChatServiceFactory.createChatService('deepseek', {
|
|
773
779
|
apiKey: process.env.DEEPSEEK_API_KEY,
|
|
774
780
|
model: 'deepseek-v4-flash',
|
|
781
|
+
reasoning_effort: 'none', // デフォルト: 応答性重視でthinkingを無効化
|
|
775
782
|
});
|
|
776
783
|
```
|
|
777
784
|
|
|
@@ -780,7 +787,9 @@ const deepSeekService = ChatServiceFactory.createChatService('deepseek', {
|
|
|
780
787
|
- 推奨モデルは`deepseek-v4-flash`(デフォルト)と`deepseek-v4-pro`です。
|
|
781
788
|
- legacy alias の`deepseek-chat`と`deepseek-reasoner`は互換用にexportしていますが、DeepSeek側で非推奨かつ2026-07-24廃止予定です。
|
|
782
789
|
- `openai-compatible`にendpoint/modelを直接指定して使うこともできますが、`deepseek` providerならendpointとデフォルトモデル指定が簡単です。
|
|
783
|
-
- DeepSeek
|
|
790
|
+
- `deepseek-v4-flash`は`reasoning_effort: 'none' | 'low' | 'high' | 'max'`に対応します。packageのデフォルトは応答性重視の`none`で、`thinking: { type: 'disabled' }`へ変換します。それ以外はthinkingを有効化してDeepSeekの`reasoning_effort`として送信します。
|
|
791
|
+
- `deepseek-v4-pro`では`none`, `high`, `max`を公開します。DeepSeek側で`low`が`high`へ変換されるため、packageでも明示的に正規化します。
|
|
792
|
+
- ThinkingとTool Callingの併用は、DeepSeekがtool turn間での`reasoning_content`再送を要求し、thinking時に通常の`tool_choice`形式を受け付けないため、現時点では明示的に拒否します。デフォルトの`none`ではTool Callingを利用できます。
|
|
784
793
|
|
|
785
794
|
#### Mistral
|
|
786
795
|
|
|
@@ -881,12 +890,15 @@ const geminiNanoService = ChatServiceFactory.createChatService('gemini-nano', {
|
|
|
881
890
|
トークンの目安だけを残し、文数は制限しません。ただし、出力長は厳密保証
|
|
882
891
|
ではありません。
|
|
883
892
|
- 構造化された履歴として、直近20件までのuser/assistantメッセージを渡します。
|
|
884
|
-
-
|
|
885
|
-
|
|
886
|
-
|
|
893
|
+
- Webページでは、対応するデスクトップ端末上の**Chrome 148以降**が必要です。
|
|
894
|
+
Prompt APIは標準で有効なため、Chromeフラグの設定は不要です。
|
|
895
|
+
Chrome拡張ではChrome 138以降から利用できます。
|
|
887
896
|
- モデルはすべてデバイス上で実行され、推論時にネットワーク通信は発生しません。
|
|
888
897
|
- 非ストリーミングのみ — レスポンスは完全なテキストとして一括返却されます。
|
|
889
898
|
- ビジョン(画像入力)は非対応です。
|
|
899
|
+
- EN/JAの言語選択とフロントエンドだけでのモデル準備は、
|
|
900
|
+
[ブラウザ完結Gemini Nanoカスタマーサポート例](./examples/gemini-nano-customer-support-bot/)
|
|
901
|
+
を参照してください。
|
|
890
902
|
- 初回のモデルダウンロードにはユーザー操作が必要で、数分かかる場合があります。
|
|
891
903
|
|
|
892
904
|
##### Tips: 会話例で応答長の安定性を高める
|
|
@@ -1243,15 +1255,15 @@ vision、JSON mode、reasoning 設定を使うべきかを provider 固有ロジ
|
|
|
1243
1255
|
- **OpenAI-Compatible**: OpenAI互換 endpoint 経由で任意のローカル/セルフホスト model ID を利用できます。vision 対応可否は endpoint ごとに差があるため、原則 `unknown` 扱いです
|
|
1244
1256
|
- **Gemini**: Gemini 3.6 Flash、Gemini 3.5 Flash、Gemini 3.5 Flash-Lite、Gemini 3.1 Flash-Lite、Gemini 3.1 Pro Preview、Gemini 3 Flash Preview、Gemini 2.5 Pro、Gemini 2.5 Flash、Gemini 2.5 Flash Lite、Gemma 4 31B IT、Gemma 4 26B A4B IT などの推奨モデルをサポート。チャット用途向けに Gemini 3 Flash は minimal thinking、Gemini 3 Pro は low thinking を既定値にします。Gemini 3.1 Flash-Lite Preview、Gemini 3 Pro Preview、Gemini 2.5 Flash Lite Preview などの lifecycle 上 deprecated なモデルは明示指定用に export を残しています
|
|
1245
1257
|
- **Claude**: Claude Opus 5, Claude Sonnet 5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, Claude Opus 4.5, Claude Sonnet 4.6, Claude Sonnet 4.5, Claude Haiku 4.5 に加え、まだ利用可能だが非推奨の Claude 4 Opus, Claude 4 Sonnet, Claude 3 Haiku をサポート。調整可能な `reasoning_effort` は対応モデルに限り `output_config.effort` として送信します
|
|
1246
|
-
- **OpenRouter**: OpenRouterのキュレーション済みモデル一覧(OpenAI/Claude/Gemini/Z.ai/xAI/Kimi/Kwaipilot)をサポート。モデルIDはOpenRouter節を参照してください
|
|
1258
|
+
- **OpenRouter**: OpenRouterのキュレーション済みモデル一覧(OpenAI/Claude/Gemini/Z.ai/xAI/Kimi/DeepSeek/Kwaipilot)をサポート。モデルIDはOpenRouter節を参照してください
|
|
1247
1259
|
- **Z.ai**: GLM-5.2/GLM-5.1/GLM-5/GLM-5-Turbo(テキスト)、GLM-4.7/4.6(テキスト)、GLM-5V-Turbo/GLM-4.6V系(ビジョン)をサポート
|
|
1248
1260
|
- **xAI**: Grok 4.5 をチャット用途向けに `reasoning_effort: 'low'` デフォルトでサポート。加えて Grok 4.3、Grok 4.20 の Reasoning/Non-Reasoning、Grok 4-1 Fast の Reasoning/Non-Reasoning をサポートし、全モデルでビジョン対応
|
|
1249
1261
|
- **Kimi**: Kimi K3(`kimi-k3`、`low` / `high` / `max` reasoning、デフォルトは `max`)、Kimi K2.7 Code(`kimi-k2.7-code`)、Kimi K2.7 Code HighSpeed(`kimi-k2.7-code-highspeed`)、Kimi K2.6(`kimi-k2.6`、デフォルト)、Kimi K2.5(`kimi-k2.5`、いずれもビジョン対応)をサポート
|
|
1250
|
-
- **DeepSeek**: DeepSeek V4 Flash(`deepseek-v4-flash`)と DeepSeek V4 Pro(`deepseek-v4-pro`)をOpenAI互換Chat Completions
|
|
1262
|
+
- **DeepSeek**: DeepSeek V4 Flash(`deepseek-v4-flash`)と DeepSeek V4 Pro(`deepseek-v4-pro`)をOpenAI互換Chat Completions経由でサポート。低遅延チャット向けにthinkingはデフォルト無効で、モデル別の`reasoning_effort`から有効化できます。legacy alias の`deepseek-chat`と`deepseek-reasoner`はDeepSeek側で非推奨です
|
|
1251
1263
|
- **Mistral**: Ministral 3系(`ministral-3b-2512`, `ministral-8b-2512`, `ministral-14b-2512`)と現行generalist modelをサポートし、streamingとvisionにも対応。adjustable `reasoning_effort`は対応モデルにだけ送信します
|
|
1252
1264
|
- **Sakana AI**: Fugu(`fugu`)と Fugu Ultra(`fugu-ultra`, `fugu-ultra-20260615`)をOpenAI互換Chat Completions経由でサポート
|
|
1253
1265
|
- **PLaMo**: PLaMo 3.0 Prime(`plamo-3.0-prime`, デフォルト)と PLaMo 2.2 Prime(`plamo-2.2-prime`)をOpenAI互換Chat Completions経由でサポート
|
|
1254
|
-
- **Gemini Nano**: Chromeブラウザ内蔵AI(LanguageModel API)。デバイス上で動作し、APIキー不要。Chrome
|
|
1266
|
+
- **Gemini Nano**: Chromeブラウザ内蔵AI(LanguageModel API)。デバイス上で動作し、APIキー不要。Webページでは対応するデスクトップ端末上のChrome 148以降が必要で、Chromeフラグの設定は不要。非ストリーミング、ビジョン非対応
|
|
1255
1267
|
|
|
1256
1268
|
## ライセンス
|
|
1257
1269
|
|
package/README.md
CHANGED
|
@@ -646,7 +646,8 @@ those models.
|
|
|
646
646
|
```typescript
|
|
647
647
|
const openRouterService = ChatServiceFactory.createChatService('openrouter', {
|
|
648
648
|
apiKey: process.env.OPENROUTER_API_KEY,
|
|
649
|
-
model: '
|
|
649
|
+
model: 'deepseek/deepseek-v4-flash-0731',
|
|
650
|
+
reasoning_effort: 'none', // Fastest chat-oriented setting
|
|
650
651
|
// Optional: Add app information for analytics
|
|
651
652
|
appName: 'Your App Name',
|
|
652
653
|
appUrl: 'https://your-app-url.com'
|
|
@@ -661,6 +662,10 @@ const openRouterService = ChatServiceFactory.createChatService('openrouter', {
|
|
|
661
662
|
- `openrouter/auto-beta` is a Beta task-aware router. It chooses a model for each request and charges that routed model's rate; inspect the response `model` field or OpenRouter Activity to see the selection.
|
|
662
663
|
- `openrouter/fusion` runs a multi-model panel plus a judge model; OpenRouter bills the sum of the underlying model calls and any enabled web search/fetch usage, not a single fixed model rate.
|
|
663
664
|
- For `z-ai/glm-5.2`, OpenRouter reasoning also defaults to `none`.
|
|
665
|
+
- OpenRouter reasoning uses `reasoning.effort: 'none'` to disable reasoning. `exclude: true` only controls whether reasoning content is returned; it does not disable reasoning by itself.
|
|
666
|
+
- DeepSeek V4 Flash snapshots are explicit text-only options rather than the OpenRouter default so applications can choose a reproducible version. Both default to `none` for responsive chat:
|
|
667
|
+
- `deepseek/deepseek-v4-flash-0731`: current fixed 0731 snapshot; supports `none`, `low`, `high`, and `max`.
|
|
668
|
+
- `deepseek/deepseek-v4-flash`: older unversioned 0423 snapshot; supports `none`, `high`, and `xhigh`.
|
|
664
669
|
- Specialized coding models are explicit options rather than defaults. This includes `kwaipilot/kat-coder-air-v2.5` and `kwaipilot/kat-coder-pro-v2.5`, which are text-only.
|
|
665
670
|
- `moonshotai/kimi-k3` availability depends on upstream capacity; OpenRouter may return 429 responses when capacity is constrained.
|
|
666
671
|
- `x-ai/grok-4.5` has region-specific availability, including a current EU limitation. `~x-ai/grok-latest` inherits those limits when it resolves to Grok 4.5.
|
|
@@ -682,6 +687,7 @@ const openRouterService = ChatServiceFactory.createChatService('openrouter', {
|
|
|
682
687
|
- `google/gemini-2.5-pro`, `google/gemini-2.5-flash`, `google/gemini-2.5-flash-lite-preview-09-2025`
|
|
683
688
|
- `z-ai/glm-5.2`, `z-ai/glm-4.7-flash`, `z-ai/glm-4.5-air`, `z-ai/glm-4.5-air:free`
|
|
684
689
|
- `~x-ai/grok-latest`, `x-ai/grok-4.5`
|
|
690
|
+
- `deepseek/deepseek-v4-flash-0731`, `deepseek/deepseek-v4-flash`
|
|
685
691
|
- `~moonshotai/kimi-latest`, `moonshotai/kimi-k3`, `moonshotai/kimi-k2.7-code`, `moonshotai/kimi-k2.5`
|
|
686
692
|
- `kwaipilot/kat-coder-air-v2.5`, `kwaipilot/kat-coder-pro-v2.5`
|
|
687
693
|
|
|
@@ -789,6 +795,7 @@ Notes for self-hosted:
|
|
|
789
795
|
const deepSeekService = ChatServiceFactory.createChatService('deepseek', {
|
|
790
796
|
apiKey: process.env.DEEPSEEK_API_KEY,
|
|
791
797
|
model: 'deepseek-v4-flash',
|
|
798
|
+
reasoning_effort: 'none', // Default: disable thinking for responsive chat
|
|
792
799
|
});
|
|
793
800
|
```
|
|
794
801
|
|
|
@@ -797,7 +804,9 @@ Notes:
|
|
|
797
804
|
- Recommended models: `deepseek-v4-flash` (default) and `deepseek-v4-pro`.
|
|
798
805
|
- Legacy aliases `deepseek-chat` and `deepseek-reasoner` remain exported for explicit compatibility, but DeepSeek marks them deprecated and scheduled for removal on 2026-07-24.
|
|
799
806
|
- You can still use DeepSeek through `openai-compatible` by providing the full endpoint and model manually, but the first-class `deepseek` provider supplies the endpoint and default model for you.
|
|
800
|
-
-
|
|
807
|
+
- `deepseek-v4-flash` accepts `reasoning_effort: 'none' | 'low' | 'high' | 'max'`. The package defaults to `none`, mapped to `thinking: { type: 'disabled' }`, for responsive chat. Other levels enable thinking and are sent as DeepSeek `reasoning_effort`.
|
|
808
|
+
- `deepseek-v4-pro` exposes `none`, `high`, and `max`. DeepSeek currently maps a requested `low` to `high`, so the package normalizes it explicitly.
|
|
809
|
+
- Thinking with tool calling is intentionally rejected for now because DeepSeek requires `reasoning_content` replay across tool turns and does not accept the normal `tool_choice` request shape in thinking mode. Tool calling works with the default `none` setting.
|
|
801
810
|
|
|
802
811
|
#### Mistral
|
|
803
812
|
|
|
@@ -901,12 +910,15 @@ Notes:
|
|
|
901
910
|
best effort.
|
|
902
911
|
- Up to the most recent 20 user/assistant messages are included as structured
|
|
903
912
|
history.
|
|
904
|
-
-
|
|
905
|
-
|
|
906
|
-
|
|
913
|
+
- Web pages require **Chrome 148+** on a supported desktop device. The Prompt
|
|
914
|
+
API is enabled by default, so no Chrome flags are required. Chrome extensions
|
|
915
|
+
have supported the Prompt API since Chrome 138.
|
|
907
916
|
- The model runs entirely on-device; no network requests are made for inference.
|
|
908
917
|
- Non-streaming only — responses are returned as a single complete text.
|
|
909
918
|
- Vision is not supported.
|
|
919
|
+
- See the
|
|
920
|
+
[browser-only Gemini Nano customer-support example](./examples/gemini-nano-customer-support-bot/)
|
|
921
|
+
for EN/JA language selection and frontend-only model preparation.
|
|
910
922
|
- The initial model download requires a user action and may take a few minutes.
|
|
911
923
|
|
|
912
924
|
##### Tip: improve response-length consistency with examples
|
|
@@ -1268,15 +1280,15 @@ Currently, the following AI providers are built-in:
|
|
|
1268
1280
|
- **OpenAI-Compatible**: Supports arbitrary local/self-hosted model IDs via OpenAI-compatible endpoints. Vision capability is treated as `unknown` unless your app knows the endpoint-specific model catalog.
|
|
1269
1281
|
- **Gemini**: Supports recommended models like Gemini 3.6 Flash, Gemini 3.5 Flash, Gemini 3.5 Flash-Lite, Gemini 3.1 Flash-Lite, Gemini 3.1 Pro Preview, Gemini 3 Flash Preview, Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.5 Flash Lite, Gemma 4 31B IT, and Gemma 4 26B A4B IT. Gemini 3 Flash models default to minimal thinking for chat-style responses, while Gemini 3 Pro models default to low. Deprecated lifecycle models such as Gemini 3.1 Flash-Lite Preview, Gemini 3 Pro Preview, and Gemini 2.5 Flash Lite Preview remain exported for explicit use.
|
|
1270
1282
|
- **Claude**: Supports current Claude API model IDs including Claude Opus 5, Claude Sonnet 5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, Claude Opus 4.5, Claude Sonnet 4.6, Claude Sonnet 4.5, Claude Haiku 4.5, plus deprecated-but-still-available Claude 4 Opus, Claude 4 Sonnet, and Claude 3 Haiku. Adjustable `reasoning_effort` is sent as `output_config.effort` only for models that support it
|
|
1271
|
-
- **OpenRouter**: Supports a curated OpenRouter model list (OpenAI/Claude/Gemini/Z.ai/xAI/Kimi/Kwaipilot). See the OpenRouter section for model IDs.
|
|
1283
|
+
- **OpenRouter**: Supports a curated OpenRouter model list (OpenAI/Claude/Gemini/Z.ai/xAI/Kimi/DeepSeek/Kwaipilot). See the OpenRouter section for model IDs.
|
|
1272
1284
|
- **Z.ai**: Supports GLM-5.2/GLM-5.1/GLM-5/GLM-5-Turbo (text), GLM-4.7/4.6 (text), and GLM-5V-Turbo/GLM-4.6V family (vision)
|
|
1273
1285
|
- **xAI**: Supports Grok 4.5 with `reasoning_effort: 'low'` by default for chat-style responses, plus Grok 4.3, Grok 4.20 Reasoning/Non-Reasoning, and Grok 4-1 Fast Reasoning/Non-Reasoning, all with vision support.
|
|
1274
1286
|
- **Kimi**: Supports Kimi K3 (`kimi-k3`, `low` / `high` / `max` reasoning with `max` as the default), Kimi K2.7 Code (`kimi-k2.7-code`), Kimi K2.7 Code HighSpeed (`kimi-k2.7-code-highspeed`), Kimi K2.6 (`kimi-k2.6`, default), and Kimi K2.5 (`kimi-k2.5`) with vision support
|
|
1275
|
-
- **DeepSeek**: Supports DeepSeek V4 Flash (`deepseek-v4-flash`) and DeepSeek V4 Pro (`deepseek-v4-pro`) via OpenAI-compatible Chat Completions. Legacy aliases `deepseek-chat` and `deepseek-reasoner` are deprecated by DeepSeek.
|
|
1287
|
+
- **DeepSeek**: Supports DeepSeek V4 Flash (`deepseek-v4-flash`) and DeepSeek V4 Pro (`deepseek-v4-pro`) via OpenAI-compatible Chat Completions. Thinking defaults to disabled for low-latency chat and can be enabled with model-aware `reasoning_effort`. Legacy aliases `deepseek-chat` and `deepseek-reasoner` are deprecated by DeepSeek.
|
|
1276
1288
|
- **Mistral**: Supports the Ministral 3 family (`ministral-3b-2512`, `ministral-8b-2512`, `ministral-14b-2512`) and current Mistral generalist models, with streaming and vision support. Adjustable `reasoning_effort` is only sent for supported models.
|
|
1277
1289
|
- **Sakana AI**: Supports Fugu (`fugu`) and Fugu Ultra (`fugu-ultra`, `fugu-ultra-20260615`) via OpenAI-compatible Chat Completions.
|
|
1278
1290
|
- **PLaMo**: Supports PLaMo 3.0 Prime (`plamo-3.0-prime`, default) and PLaMo 2.2 Prime (`plamo-2.2-prime`) via OpenAI-compatible Chat Completions.
|
|
1279
|
-
- **Gemini Nano**: Chrome built-in AI (LanguageModel API). Runs on-device with no API key required. Chrome
|
|
1291
|
+
- **Gemini Nano**: Chrome built-in AI (LanguageModel API). Runs on-device with no API key required. Web pages require Chrome 148+ on a supported desktop device; no Chrome flags are required. Non-streaming, no vision support.
|
|
1280
1292
|
|
|
1281
1293
|
## License
|
|
1282
1294
|
|
|
@@ -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;AAED,4EAqBC;AApFY,QAAA,qBAAqB,GAAG,0BAA0B,CAAC;AACnD,QAAA,sCAAsC,GAAG,GAAG,6BAAqB,mBAAmB,CAAC;AAElG,qBAAqB;AACR,QAAA,uBAAuB,GAAG,mBAAmB,CAAC;AAC9C,QAAA,qBAAqB,GAAG,iBAAiB,CAAC;AAIvD,MAAM,mCAAmC,GAAG;IAC1C,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;CACgD,CAAC;AAExD,MAAM,iCAAiC,GAAG;IACxC,MAAM;IACN,MAAM;IACN,KAAK;CACgD,CAAC;AAExD,gCAAgC;AAChC,uDAAuD;AAC1C,QAAA,mBAAmB,GAAG,eAAe,CAAC;AACnD,gFAAgF;AACnE,QAAA,uBAAuB,GAAG,mBAAmB,CAAC;AAE9C,QAAA,yBAAyB,GAAG;IACvC,+BAAuB;IACvB,6BAAqB;CACtB,CAAC;AAEW,QAAA,0BAA0B,GAAG;IACxC,2BAAmB;IACnB,+BAAuB;CACxB,CAAC;AAEF,SAAgB,oCAAoC,CAClD,KAAa;IAEb,IAAI,KAAK,KAAK,+BAAuB,EAAE,CAAC;QACtC,OAAO,mCAAmC,CAAC;IAC7C,CAAC;IAED,IAAI,KAAK,KAAK,6BAAqB,EAAE,CAAC;QACpC,OAAO,iCAAiC,CAAC;IAC3C,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAgB,8BAA8B,CAAC,KAAa;IAC1D,OAAO,oCAAoC,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAChE,CAAC;AAED,+EAA+E;AAC/E,SAAgB,iCAAiC,CAC/C,KAAa;IAEb,OAAO,8BAA8B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACpE,CAAC;AAED,SAAgB,gCAAgC,CAC9C,KAAa,EACb,MAAgC;IAEhC,MAAM,SAAS,GAAG,oCAAoC,CAAC,KAAK,CAAC,CAAC;IAC9D,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"}
|
|
@@ -44,6 +44,9 @@ export declare const MODEL_KWAIPILOT_KAT_CODER_AIR_V2_5 = "kwaipilot/kat-coder-a
|
|
|
44
44
|
export declare const MODEL_KWAIPILOT_KAT_CODER_PRO_V2_5 = "kwaipilot/kat-coder-pro-v2.5";
|
|
45
45
|
export declare const MODEL_XAI_GROK_LATEST = "~x-ai/grok-latest";
|
|
46
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';
|
|
47
50
|
export declare const OPENROUTER_FREE_MODELS: string[];
|
|
48
51
|
export declare const OPENROUTER_VISION_SUPPORTED_MODELS: string[];
|
|
49
52
|
export declare const OPENROUTER_FREE_RATE_LIMIT_PER_MINUTE = 20;
|
|
@@ -62,4 +65,7 @@ export declare function isOpenRouterFreeModel(model: string): boolean;
|
|
|
62
65
|
* @returns True if the model supports vision
|
|
63
66
|
*/
|
|
64
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;
|
|
65
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,0BAA0B,yBAAyB,CAAC;AACjE,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAChE,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAC7D,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,wBAA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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,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.OPENROUTER_CREDITS_THRESHOLD = exports.OPENROUTER_FREE_DAILY_LIMIT_HIGH_CREDITS = void 0;
|
|
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;
|
|
5
5
|
exports.isOpenRouterFreeModel = isOpenRouterFreeModel;
|
|
6
6
|
exports.isOpenRouterVisionModel = isOpenRouterVisionModel;
|
|
7
|
+
exports.getOpenRouterSupportedReasoningEfforts = getOpenRouterSupportedReasoningEfforts;
|
|
8
|
+
exports.getDefaultOpenRouterReasoningEffort = getDefaultOpenRouterReasoningEffort;
|
|
9
|
+
exports.normalizeOpenRouterReasoningEffort = normalizeOpenRouterReasoningEffort;
|
|
7
10
|
exports.ENDPOINT_OPENROUTER_API = 'https://openrouter.ai/api/v1/chat/completions';
|
|
8
11
|
// OpenRouter models
|
|
9
12
|
exports.MODEL_OPENROUTER_AUTO = 'openrouter/auto';
|
|
@@ -51,6 +54,26 @@ exports.MODEL_KWAIPILOT_KAT_CODER_AIR_V2_5 = 'kwaipilot/kat-coder-air-v2.5';
|
|
|
51
54
|
exports.MODEL_KWAIPILOT_KAT_CODER_PRO_V2_5 = 'kwaipilot/kat-coder-pro-v2.5';
|
|
52
55
|
exports.MODEL_XAI_GROK_LATEST = '~x-ai/grok-latest';
|
|
53
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
|
+
];
|
|
54
77
|
// Free tier models
|
|
55
78
|
exports.OPENROUTER_FREE_MODELS = [
|
|
56
79
|
exports.MODEL_GPT_OSS_20B_FREE,
|
|
@@ -115,4 +138,45 @@ function isOpenRouterFreeModel(model) {
|
|
|
115
138
|
function isOpenRouterVisionModel(model) {
|
|
116
139
|
return exports.OPENROUTER_VISION_SUPPORTED_MODELS.some((visionModel) => model.includes(visionModel));
|
|
117
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
|
+
}
|
|
118
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,2BAA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GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,MAAM,IAAI,mCAAmC,CAAC,KAAK,CAAC,CAAC;IACvE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,SAAS,GAAG,sCAAsC,CAAC,KAAK,CAAC,CAAC;IAChE,IAAI,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,eAAe,KAAK,0CAAkC,EAAE,CAAC;QAC3D,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatServiceFactory.d.ts","sourceRoot":"","sources":["../../../src/services/ChatServiceFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAEL,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatServiceFactory.d.ts","sourceRoot":"","sources":["../../../src/services/ChatServiceFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAEL,4BAA4B,EAC5B,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AA0CtE;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B,kCAAkC;IAClC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAoD;IAE5E;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,GAAG,CAAC,GAAG,IAAI;IAIjE;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CAAC,SAAS,SAAS,gBAAgB,EACzD,YAAY,EAAE,SAAS,EACvB,OAAO,EAAE,4BAA4B,CAAC,SAAS,CAAC,GAC/C,WAAW;IAYd;;;OAGG;IACH,MAAM,CAAC,YAAY,IAAI,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAI5D;;;OAGG;IACH,MAAM,CAAC,qBAAqB,IAAI,MAAM,EAAE;IAIxC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE;IAKzD;;OAEG;IACH,MAAM,CAAC,uBAAuB,CAC5B,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,wBAAwB,GAAG,SAAS;IAqCvC;;OAEG;IACH,MAAM,CAAC,0BAA0B,IAAI,wBAAwB,EAAE;IAS/D;;OAEG;IACH,MAAM,CAAC,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB;IAKtE;;OAEG;IACH,MAAM,CAAC,6BAA6B,CAClC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GACZ,kBAAkB;CAkBtB"}
|
|
@@ -4,6 +4,8 @@ exports.ChatServiceFactory = void 0;
|
|
|
4
4
|
const providers_1 = require("./providers");
|
|
5
5
|
const claude_1 = require("../constants/claude");
|
|
6
6
|
const kimi_1 = require("../constants/kimi");
|
|
7
|
+
const deepseek_1 = require("../constants/deepseek");
|
|
8
|
+
const openrouter_1 = require("../constants/openrouter");
|
|
7
9
|
const TOOL_SUPPORTED_PROVIDERS = new Set([
|
|
8
10
|
'openai',
|
|
9
11
|
'openai-compatible',
|
|
@@ -29,11 +31,12 @@ const REASONING_EFFORT_BY_PROVIDER = {
|
|
|
29
31
|
openai: ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'],
|
|
30
32
|
claude: ['low', 'medium', 'high', 'xhigh', 'max'],
|
|
31
33
|
gemini: ['minimal', 'low', 'medium', 'high'],
|
|
32
|
-
openrouter: ['none', 'minimal', 'low', 'medium', 'high'],
|
|
34
|
+
openrouter: ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'],
|
|
33
35
|
kimi: ['low', 'high', 'max'],
|
|
34
36
|
mistral: ['low', 'medium', 'high'],
|
|
35
37
|
plamo: ['none', 'medium'],
|
|
36
38
|
xai: ['none', 'low', 'medium', 'high'],
|
|
39
|
+
deepseek: ['none', 'low', 'high', 'max'],
|
|
37
40
|
};
|
|
38
41
|
/**
|
|
39
42
|
* Chat service factory
|
|
@@ -105,7 +108,11 @@ class ChatServiceFactory {
|
|
|
105
108
|
? [...(0, claude_1.getClaudeSupportedReasoningEfforts)(model)]
|
|
106
109
|
: providerName === 'kimi' && model
|
|
107
110
|
? [...(0, kimi_1.getKimiSupportedReasoningEfforts)(model)]
|
|
108
|
-
:
|
|
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] ?? []),
|
|
109
116
|
};
|
|
110
117
|
}
|
|
111
118
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatServiceFactory.js","sourceRoot":"","sources":["../../../src/services/ChatServiceFactory.ts"],"names":[],"mappings":";;;AAQA,2CAA6D;AAE7D,gDAAyE;AACzE,4CAAqE;
|
|
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,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;IACpE,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;IACjD,MAAM,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC;IAC5C,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;IACxE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;IAC5B,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC;IAClC,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AAkJ9E,0CAA8B,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAClD,kBAAkB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAC9C,CAAC"}
|
|
@@ -6,6 +6,8 @@ import type { MistralReasoningEffort } from '../../constants/mistral';
|
|
|
6
6
|
import type { PlamoReasoningEffort } from '../../constants/plamo';
|
|
7
7
|
import type { XaiReasoningEffort } from '../../constants/xai';
|
|
8
8
|
import type { KimiReasoningEffort } from '../../constants/kimi';
|
|
9
|
+
import type { DeepSeekReasoningEffort } from '../../constants/deepseek';
|
|
10
|
+
import type { OpenRouterReasoningEffort } from '../../constants/openrouter';
|
|
9
11
|
import { ToolDefinition, MCPServerConfig } from '../../types';
|
|
10
12
|
/**
|
|
11
13
|
* Options for chat service providers
|
|
@@ -63,7 +65,7 @@ export type OpenAICompatibleChatServiceOptions = Omit<OpenAIChatServiceOptions,
|
|
|
63
65
|
mcpServers?: never;
|
|
64
66
|
};
|
|
65
67
|
export type OpenRouterChatServiceOptions = DisallowKeys<BaseChatServiceOptions, 'gpt5Preset' | 'gpt5EndpointPreference' | 'enableReasoningSummary' | 'verbosity' | 'baseUrl' | 'thinking' | 'responseFormat'> & {
|
|
66
|
-
reasoning_effort?:
|
|
68
|
+
reasoning_effort?: OpenRouterReasoningEffort;
|
|
67
69
|
appName?: string;
|
|
68
70
|
appUrl?: string;
|
|
69
71
|
};
|
|
@@ -81,7 +83,10 @@ export type KimiChatServiceOptions = Omit<DisallowKeys<BaseChatServiceOptions, '
|
|
|
81
83
|
/** Kimi K3 reasoning effort. Defaults to max. */
|
|
82
84
|
reasoning_effort?: KimiReasoningEffort;
|
|
83
85
|
};
|
|
84
|
-
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
|
+
};
|
|
85
90
|
export type MistralChatServiceOptions = Omit<DisallowKeys<BaseChatServiceOptions, 'verbosity' | 'gpt5Preset' | 'gpt5EndpointPreference' | 'enableReasoningSummary' | 'includeReasoning' | 'reasoningMaxTokens' | 'thinking' | 'responseFormat'>, 'reasoning_effort'> & {
|
|
86
91
|
/** Mistral adjustable reasoning: only sent for supported models. */
|
|
87
92
|
reasoning_effort?: MistralReasoningEffort;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatServiceProvider.d.ts","sourceRoot":"","sources":["../../../../src/services/providers/ChatServiceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,WA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B,SAAS,GAAG,UAAU,GAAG,kBAAkB,GAAG,oBAAoB,CACnE,GAAG;IACF,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,IAAI,CACnD,wBAAwB,EACxB,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,YAAY,CAC/C,GAAG;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,YAAY,CACrD,sBAAsB,EACpB,YAAY,GACZ,wBAAwB,GACxB,wBAAwB,GACxB,WAAW,GACX,SAAS,GACT,UAAU,GACV,gBAAgB,CACnB,GAAG;IACF,gBAAgB,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"ChatServiceProvider.d.ts","sourceRoot":"","sources":["../../../../src/services/providers/ChatServiceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BA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,EAAE,MAAM,GAAG,OAAO,CAAC;CACjD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type DeepSeekReasoningEffort } from '../../../constants/deepseek';
|
|
1
2
|
import { ChatResponseLength } from '../../../constants/chat';
|
|
2
3
|
import { ToolDefinition } from '../../../types/toolChat';
|
|
3
4
|
import { OpenAIChatService } from '../openai/OpenAIChatService';
|
|
4
5
|
export declare class DeepSeekChatService extends OpenAIChatService {
|
|
5
|
-
constructor(apiKey: string, model?: string, visionModel?: string, tools?: ToolDefinition[], endpoint?: string, responseLength?: ChatResponseLength);
|
|
6
|
+
constructor(apiKey: string, model?: string, visionModel?: string, tools?: ToolDefinition[], endpoint?: string, responseLength?: ChatResponseLength, reasoningEffort?: DeepSeekReasoningEffort);
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=DeepSeekChatService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeepSeekChatService.d.ts","sourceRoot":"","sources":["../../../../../src/services/providers/deepseek/DeepSeekChatService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeepSeekChatService.d.ts","sourceRoot":"","sources":["../../../../../src/services/providers/deepseek/DeepSeekChatService.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAG7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,qBAAa,mBAAoB,SAAQ,iBAAiB;gBAEtD,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAAgC,EACvC,WAAW,GAAE,MAAc,EAC3B,KAAK,CAAC,EAAE,cAAc,EAAE,EACxB,QAAQ,GAAE,MAA+C,EACzD,cAAc,CAAC,EAAE,kBAAkB,EACnC,eAAe,CAAC,EAAE,uBAAuB;CAgC5C"}
|
|
@@ -4,8 +4,15 @@ exports.DeepSeekChatService = void 0;
|
|
|
4
4
|
const deepseek_1 = require("../../../constants/deepseek");
|
|
5
5
|
const OpenAIChatService_1 = require("../openai/OpenAIChatService");
|
|
6
6
|
class DeepSeekChatService extends OpenAIChatService_1.OpenAIChatService {
|
|
7
|
-
constructor(apiKey, model = deepseek_1.MODEL_DEEPSEEK_V4_FLASH, visionModel = model, tools, endpoint = deepseek_1.ENDPOINT_DEEPSEEK_CHAT_COMPLETIONS_API, responseLength) {
|
|
8
|
-
|
|
7
|
+
constructor(apiKey, model = deepseek_1.MODEL_DEEPSEEK_V4_FLASH, visionModel = model, tools, endpoint = deepseek_1.ENDPOINT_DEEPSEEK_CHAT_COMPLETIONS_API, responseLength, reasoningEffort) {
|
|
8
|
+
const normalizedReasoningEffort = (0, deepseek_1.normalizeDeepSeekReasoningEffort)(model, reasoningEffort);
|
|
9
|
+
super(apiKey, model, visionModel, tools, endpoint, [], responseLength, undefined, normalizedReasoningEffort, false, 'deepseek', false);
|
|
10
|
+
if (tools?.length &&
|
|
11
|
+
normalizedReasoningEffort !== undefined &&
|
|
12
|
+
normalizedReasoningEffort !== 'none') {
|
|
13
|
+
throw new Error('DeepSeek thinking with tools is not supported yet. ' +
|
|
14
|
+
"Use reasoning_effort: 'none' for tool calling.");
|
|
15
|
+
}
|
|
9
16
|
}
|
|
10
17
|
}
|
|
11
18
|
exports.DeepSeekChatService = DeepSeekChatService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeepSeekChatService.js","sourceRoot":"","sources":["../../../../../src/services/providers/deepseek/DeepSeekChatService.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"DeepSeekChatService.js","sourceRoot":"","sources":["../../../../../src/services/providers/deepseek/DeepSeekChatService.ts"],"names":[],"mappings":";;;AAAA,0DAKqC;AAGrC,mEAAgE;AAEhE,MAAa,mBAAoB,SAAQ,qCAAiB;IACxD,YACE,MAAc,EACd,QAAgB,kCAAuB,EACvC,cAAsB,KAAK,EAC3B,KAAwB,EACxB,WAAmB,iDAAsC,EACzD,cAAmC,EACnC,eAAyC;QAEzC,MAAM,yBAAyB,GAAG,IAAA,2CAAgC,EAChE,KAAK,EACL,eAAe,CAChB,CAAC;QACF,KAAK,CACH,MAAM,EACN,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,EAAE,EACF,cAAc,EACd,SAAS,EACT,yBAAyB,EACzB,KAAK,EACL,UAAU,EACV,KAAK,CACN,CAAC;QAEF,IACE,KAAK,EAAE,MAAM;YACb,yBAAyB,KAAK,SAAS;YACvC,yBAAyB,KAAK,MAAM,EACpC,CAAC;YACD,MAAM,IAAI,KAAK,CACb,qDAAqD;gBACnD,gDAAgD,CACnD,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAxCD,kDAwCC"}
|