@aituber-onair/chat 0.24.0 → 0.24.1

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.
Files changed (3) hide show
  1. package/README.ja.md +21 -2
  2. package/README.md +21 -2
  3. package/package.json +1 -1
package/README.ja.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  ![@aituber-onair/chat ロゴ](./images/aituber-onair-chat.png)
4
4
 
5
- AITuber OnAirのチャット・LLM API統合ライブラリです。このパッケージは、OpenAI、ローカルLLM含むOpenAI互換プロバイダー、Claude、Gemini、OpenRouter、Z.ai、xAI、Kimi等の様々なAIチャットプロバイダーとやり取りするための統一されたインターフェースを提供します。
5
+ AITuber OnAirのチャット・LLM API統合ライブラリです。このパッケージは、OpenAI、ローカルLLM含むOpenAI互換プロバイダー、Claude、Gemini、Gemini Nano(Chromeブラウザ内蔵AI)、OpenRouter、Z.ai、xAI、Kimi等の様々なAIチャットプロバイダーとやり取りするための統一されたインターフェースを提供します。
6
6
 
7
7
  ## 機能
8
8
 
9
- - 🤖 **複数のAIプロバイダー対応**: OpenAI、ローカルLLM含むOpenAI互換プロバイダー、Claude (Anthropic)、Google Gemini、OpenRouter、Z.ai、xAI、Kimi
9
+ - 🤖 **複数のAIプロバイダー対応**: OpenAI、ローカルLLM含むOpenAI互換プロバイダー、Claude (Anthropic)、Google Gemini、Gemini Nano(Chromeブラウザ内蔵AI)、OpenRouter、Z.ai、xAI、Kimi
10
10
  - 🔄 **統一されたインターフェース**: 異なるプロバイダー間での一貫したAPI
11
11
  - 🛠️ **ツール・関数呼び出し**: AI関数呼び出しの自動反復処理をサポート
12
12
  - 💬 **ストリーミングレスポンス**: リアルタイムストリーミングチャット応答
@@ -382,6 +382,24 @@ const kimiService = ChatServiceFactory.createChatService('kimi', {
382
382
  注意:
383
383
  - 自前ホスティングではthinking制御に`chat_template_kwargs`を使用します。
384
384
 
385
+ #### Gemini Nano(Chromeブラウザ内蔵AI)
386
+
387
+ ```typescript
388
+ const geminiNanoService = ChatServiceFactory.createChatService('gemini-nano', {
389
+ responseLength: 'medium'
390
+ });
391
+ ```
392
+
393
+ 注意:
394
+ - APIキー不要 — ChromeのLanguageModel API(Prompt API)を使用します。
395
+ - **Chrome 138以降**で、以下のフラグを有効にする必要があります:
396
+ - `chrome://flags/#optimization-guide-on-device-model` → Enabled
397
+ - `chrome://flags/#prompt-api-for-gemini-nano` → Enabled
398
+ - モデルはすべてデバイス上で実行され、推論時にネットワーク通信は発生しません。
399
+ - 非ストリーミングのみ — レスポンスは完全なテキストとして一括返却されます。
400
+ - ビジョン(画像入力)は非対応です。
401
+ - 初回のモデルダウンロードにはユーザー操作が必要で、数分かかる場合があります。
402
+
385
403
  ### ビジョンチャット
386
404
 
387
405
  組み込み provider のうち、対応モデル一覧を持つものは vision 対応を
@@ -664,6 +682,7 @@ console.log(modelLevel); // 'unknown'
664
682
  - **Z.ai**: GLM-5/GLM-5-Turbo(テキスト)、GLM-4.7/4.6(テキスト)、GLM-4.6V系(ビジョン)をサポート
665
683
  - **xAI**: Grok 4.20 の Reasoning/Non-Reasoning と Grok 4-1 Fast の Reasoning/Non-Reasoning をサポートし、全モデルでビジョン対応
666
684
  - **Kimi**: Kimi K2.5(`kimi-k2.5`、ビジョン対応)をサポート
685
+ - **Gemini Nano**: Chromeブラウザ内蔵AI(LanguageModel API)。デバイス上で動作し、APIキー不要。Chrome 138以降でPrompt APIフラグの有効化が必要。非ストリーミング、ビジョン非対応
667
686
 
668
687
  ## ライセンス
669
688
 
package/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  ![@aituber-onair/chat logo](https://github.com/shinshin86/aituber-onair/raw/main/packages/chat/images/aituber-onair-chat.png)
4
4
 
5
- Chat and LLM API integration library for AITuber OnAir. This package provides a unified interface for interacting with various AI chat providers including OpenAI, OpenAI-compatible, Claude, Gemini, OpenRouter, Z.ai, xAI, and Kimi.
5
+ Chat and LLM API integration library for AITuber OnAir. This package provides a unified interface for interacting with various AI chat providers including OpenAI, OpenAI-compatible, Claude, Gemini, Gemini Nano (Chrome built-in AI), OpenRouter, Z.ai, xAI, and Kimi.
6
6
 
7
7
  ## Features
8
8
 
9
- - 🤖 **Multiple AI Provider Support**: OpenAI, OpenAI-compatible, Claude (Anthropic), Google Gemini, OpenRouter, Z.ai, xAI, and Kimi
9
+ - 🤖 **Multiple AI Provider Support**: OpenAI, OpenAI-compatible, Claude (Anthropic), Google Gemini, Gemini Nano (Chrome built-in AI), OpenRouter, Z.ai, xAI, and Kimi
10
10
  - 🔄 **Unified Interface**: Consistent API across different providers
11
11
  - 🛠️ **Tool/Function Calling**: Support for AI function calling with automatic iteration
12
12
  - 💬 **Streaming Responses**: Real-time streaming chat responses
@@ -378,6 +378,24 @@ const kimiService = ChatServiceFactory.createChatService('kimi', {
378
378
  Notes for self-hosted:
379
379
  - Self-hosted endpoints use `chat_template_kwargs` for thinking controls.
380
380
 
381
+ #### Gemini Nano (Chrome Built-in AI)
382
+
383
+ ```typescript
384
+ const geminiNanoService = ChatServiceFactory.createChatService('gemini-nano', {
385
+ responseLength: 'medium'
386
+ });
387
+ ```
388
+
389
+ Notes:
390
+ - No API key required — uses Chrome's built-in LanguageModel API (Prompt API).
391
+ - Requires **Chrome 138+** with the following flags enabled:
392
+ - `chrome://flags/#optimization-guide-on-device-model` → Enabled
393
+ - `chrome://flags/#prompt-api-for-gemini-nano` → Enabled
394
+ - The model runs entirely on-device; no network requests are made for inference.
395
+ - Non-streaming only — responses are returned as a single complete text.
396
+ - Vision is not supported.
397
+ - The initial model download requires a user action and may take a few minutes.
398
+
381
399
  ### Vision Chat
382
400
 
383
401
  For built-in providers with curated model lists, the library pre-validates
@@ -660,6 +678,7 @@ Currently, the following AI providers are built-in:
660
678
  - **Z.ai**: Supports GLM-5/GLM-5-Turbo (text), GLM-4.7/4.6 (text), and GLM-4.6V family (vision)
661
679
  - **xAI**: Supports Grok 4.20 Reasoning/Non-Reasoning and Grok 4-1 Fast Reasoning/Non-Reasoning, all with vision support
662
680
  - **Kimi**: Supports Kimi K2.5 (`kimi-k2.5`) with vision support
681
+ - **Gemini Nano**: Chrome built-in AI (LanguageModel API). Runs on-device with no API key required. Chrome 138+ with Prompt API flags enabled. Non-streaming, no vision support.
663
682
 
664
683
  ## License
665
684
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aituber-onair/chat",
3
- "version": "0.24.0",
3
+ "version": "0.24.1",
4
4
  "description": "Chat and LLM API integration library for AITuber OnAir",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",