{"id":28564776,"url":"https://github.com/dodo13114arch/unity-llm-driven-npc-package","last_synced_at":"2026-04-25T11:33:50.494Z","repository":{"id":296682317,"uuid":"994129907","full_name":"dodo13114arch/Unity-LLM-Driven-NPC-Package","owner":"dodo13114arch","description":"本專案提供一個 Unity 套件，讓開發者能輕鬆為 NPC 整合 AI 驅動的語音對話功能。支援多種主流 AI 服務，包括 Google (Gemini, TTS, STT) 和 OpenAI (GPT, TTS, STT)。此套件需搭配 Ready Player Me 使用，旨在簡化 NPC 互動的開發流程。 主要特色： 支援 Google 及 OpenAI 的大型語言模型 (LLM)、文字轉語音 (TTS) 和語音轉文字 (STT) 服務。 易於整合的 NPC Manager，方便管理互動邏輯。","archived":false,"fork":false,"pushed_at":"2025-06-01T12:47:55.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-01T18:14:20.527Z","etag":null,"topics":["ai","npc","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dodo13114arch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-01T09:20:01.000Z","updated_at":"2025-06-01T12:51:40.000Z","dependencies_parsed_at":"2025-06-01T18:14:25.191Z","dependency_job_id":"e3eb6cd8-4ca4-49e6-9976-4fab96fe6638","html_url":"https://github.com/dodo13114arch/Unity-LLM-Driven-NPC-Package","commit_stats":null,"previous_names":["dodo13114arch/unity-llm-driven-npc-package"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodo13114arch%2FUnity-LLM-Driven-NPC-Package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodo13114arch%2FUnity-LLM-Driven-NPC-Package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodo13114arch%2FUnity-LLM-Driven-NPC-Package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodo13114arch%2FUnity-LLM-Driven-NPC-Package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dodo13114arch","download_url":"https://codeload.github.com/dodo13114arch/Unity-LLM-Driven-NPC-Package/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodo13114arch%2FUnity-LLM-Driven-NPC-Package/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259088462,"owners_count":22803641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","npc","unity"],"created_at":"2025-06-10T14:00:22.136Z","updated_at":"2026-04-25T11:33:45.468Z","avatar_url":"https://github.com/dodo13114arch.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI NPC Services for Unity\n\n\u003e **Language**: [English](README_EN.md) | [繁體中文](README.md)\n\n[![Unity 2022.3+](https://img.shields.io/badge/Unity-2022.3%2B-black.svg)](https://unity3d.com/get-unity/download)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/dodo13114arch/Unity-LLM-Driven-NPC-Package)\n\n一個Unity AI對話系統，讓NPC能夠語音對話。支援Google、OpenAI、ElevenLabs、Mistral等多種AI服務，需搭配Ready Player Me使用。\n\n\u003e **致謝**：基於 [@UnityGameStudio](https://github.com/UnityGameStudio) 的 [Gemini-Unity-Google-Cloud](https://github.com/UnityGameStudio/Gemini-Unity-Google-Cloud) 改寫\n\n## 安裝\n\n\u003e 請先確認已安裝[ReadyPlayerMePackage](https://assetstore.unity.com/packages/tools/game-toolkits/ready-player-me-avatar-and-character-creator-259814)\n\n1. 開啟Unity Package Manager（`Window` → `Package Manager`）\n2. 點擊 `+` → `Add package from git URL...`\n3. 輸入：`https://github.com/dodo13114arch/Unity-LLM-Driven-NPC-Package.git`\n\n## 快速設置\n\n### 步驟1：創建NPC Manager\n1. 場景中創建空GameObject，命名為 \"NPC Manager\"\n2. 添加 `NpcInteractionManager` 組件\n\n### 步驟2：添加AI服務\n根據需要添加以下組件到同一個GameObject：\n\n**對話服務（選一個）**：\n- `OpenAILlmService` - 使用GPT\n- `GeminiLlmService` - 使用Google Gemini\n- `MistralLlmService` - 使用Mistral AI\n\n**語音合成（選一個）**：\n- `GoogleTtsService` - Google語音\n- `OpenAITtsService` - OpenAI語音\n- `ElevenLabsTtsService` - ElevenLabs高品質語音\n\n**語音識別（可選）**：\n- `GoogleSttService` - Google語音轉文字\n- `OpenAIWhisperSttService` - OpenAI Whisper高精度語音識別\n\n### 步驟3：配置API密鑰\n在Inspector中填入API密鑰：\n- **OpenAI**：到 [OpenAI](https://platform.openai.com/) 取得\n- **Google**：到 [Google Cloud](https://console.cloud.google.com/) 取得\n- **Gemini**：到 [AI Studio](https://aistudio.google.com/apikey) 取得\n- **ElevenLabs**：到 [ElevenLabs](https://elevenlabs.io/) 取得\n- **Mistral**：到 [Mistral AI](https://console.mistral.ai/) 取得\n\n### 步驟4：連接服務\n在 `NpcInteractionManager` 的Inspector中，將對應服務拖入對應欄位。\n\n## 支援的服務\n\n| 服務 | TTS | STT | LLM | 狀態 |\n|------|-----|-----|-----|------|\n| Google | ✅ | ✅ | ✅ | 完整支援 |\n| OpenAI | ✅ | ✅ | ✅ | 完整支援 |\n| ElevenLabs | ✅ | ❌ | ❌ | TTS高品質語音 |\n| Mistral | ❌ | ❌ | ✅ | 多語言LLM支援 |\n| Ollama | ❌ | ❌ | ⚠️ | 尚未測試 |\n| HuggingFace | ⚠️ | ❌ | ⚠️ | 尚未測試 |\n\n## 新增功能\n\n### ElevenLabs TTS 服務\n- **高品質語音合成**：支援ElevenLabs的先進語音技術\n- **多種聲音選項**：可配置不同的Voice ID\n- **直接MP3處理**：原生支援MP3格式，高效率音頻處理\n- **智能緩存系統**：減少重複請求，提升效能\n- **完整錯誤處理**：重試機制與詳細錯誤回饋\n\n### OpenAI Whisper STT 服務\n- **高精度語音識別**：使用最新的Whisper模型\n- **多語言支援**：支援繁體中文等多種語言\n- **智能音頻驗證**：自動過濾無效音頻\n- **WAV格式編碼**：完整的音頻處理管線\n- **可配置參數**：支援語言、模型、溫度等參數調整\n\n### Mistral LLM 服務\n- **多種模型支援**：支援mistral-small-latest、mistral-large-latest等\n- **對話歷史管理**：智能管理對話上下文\n- **動態系統提示詞**：運行時可修改系統設定\n- **安全模式**：內建內容過濾功能\n- **完整參數控制**：溫度、token限制、懲罰參數等\n\n## 系統需求\n\n- Unity 2022.3+\n- 網路連線（雲端AI服務）\n\n## 授權\n\nMIT - 詳見 [LICENSE.md](LICENSE.md)\n\n---\n\n如果有幫助請給個Star！ ⭐  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdodo13114arch%2Funity-llm-driven-npc-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdodo13114arch%2Funity-llm-driven-npc-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdodo13114arch%2Funity-llm-driven-npc-package/lists"}