Project Icon

ChatdollKit

智能3D虚拟助手开发框架

ChatdollKit是一个开源的3D虚拟助手开发框架,支持多种大语言模型,能将3D模型转化为具备语音交互功能的智能角色。该框架提供表情同步、动作控制等功能,兼容Windows、Mac、iOS等多个平台。开发者可利用ChatdollKit快速构建具有自然对话能力的3D虚拟角色,打造流畅的人机交互体验。

ChatdollKit

3D virtual assistant SDK that enables you to make your 3D model into a voice-enabled chatbot. 🇯🇵日本語のREADMEはこちら

  • 🍎 iOS App: OshaberiAI A Virtual Agent App made with ChatdollKit: a perfect fusion of character creation by AI prompt engineering, customizable 3D VRM models, and your favorite voices by VOICEVOX.
  • 🇬🇧 Live demo English Say "Hello" to start conversation. This demo just returns what you say (echo).
  • 🇯🇵 Live demo in Japanese OpenAI API Keyをご用意ください。「こんにちは」と話しかけると会話がスタートします。

✨ Features

  • Generative AI Native: Supports multiple LLMs like ChatGPT, Anthropic Claude, Google Gemini Pro, Dify, and others, with function calling (ChatGPT/Gemini) and multimodal capabilities.
  • 3D model expression: Synchronizes speech and motion, controls facial expressions and animations autonomously, supports blinking and lip-sync.
  • Dialog control: Integrates Speech-to-Text and Text-to-Speech (OpenAI, Azure, Google, Watson, VOICEVOX, VOICEROID, etc.), manages dialog state (context or memory), extracts intents and routes topics, supports wakeword detection.
  • Multi platforms: Compatible with Windows, Mac, Linux, iOS, Android, and other Unity-supported platforms, including VR, AR, and WebGL.

... and more! See ChatdollKit Documentation to learn details.

🚀 Quick start

You can learn how to setup ChatdollKit by watching this video that runs the demo scene(including chat with ChatGPT): https://www.youtube.com/watch?v=rRtm18QSJtc

📦 Import packages

Download the latest version of ChatdollKit.unitypackage and import it into your Unity project after import dependencies;

  • Burst from Unity Package Manager (Window > Package Manager)
  • UniTask(Tested on Ver.2.5.4)
  • uLipSync(Tested on v3.1.0)
  • For VRM model: UniVRM(v0.89.0) and VRM Extension
  • JSON.NET: If your project doesn't have JSON.NET, add it from Package Manager > [+] > Add package from git URL... > com.unity.nuget.newtonsoft-json
  • Azure Speech SDK: (Optional) Required for real-time speech recognition using a stream.

🐟 Resource preparation

Add 3D model to the scene and adjust as you like. Also install required resources for the 3D model like shaders etc. In this README, I use Cygnet-chan that we can perchase at Booth. https://booth.pm/ja/items/1870320

And, import animation clips. In this README, I use Anime Girls Idle Animations Free. I believe it is worth for you to purchase the pro edition👍

🎁 Put ChatdollKit prefab

Put ChatdollKit/Prefabs/ChatdollKit or ChatdollKit/Prefabs/ChatdollKitVRM to the scene. And, create EventSystem to use UI components.

🐈 ModelController

Select Setup ModelController in the context menu of ModelController. If NOT VRM, make sure that shapekey for blink to Blink Blend Shape Name is set after setup. If not correct or blank, set it manually.

💃 Animator

Select Setup Animator in the context menu of ModelController and select the folder that contains animation clips or their parent folder. In this case put animation clips in 01_Idles and 03_Others onto Base Layer for override blending, 02_Layers onto Additive Layer for additive blending.

Next, see the Base Layer of newly created AnimatorController in the folder you selected. Confirm the value for transition to the state you want to set it for idle animation.

Lastly, set the value to Idle Animation Value on the inspector of ModelController.

🦜 DialogController

On the inspector of DialogController, set Wake Word to start conversation (e.g. hello / こんにちは🇯🇵), Cancel Word to stop comversation (e.g. end / おしまい🇯🇵), Prompt Voice to require voice request from user (e.g. what's up? / どうしたの?🇯🇵).

🍣 ChatdollKit

Select the speech service (OpenAI/Azure/Google/Watson) you use and set API key and some properties like Region and BaseUrl on inspector of ChatdollKit.

🍳 Skill

Attach the common components to use LLM:

  • ChatdollKit/Scripts/LLM/LLMRouter
  • ChatdollKit/Scripts/LLM/LLMContentSkill

Additionally, attach the specific LLM vendor component you want to use and set the API key:

  • ChatdollKit/Scripts/LLM/ChatGPT/ChatGPTService
  • ChatdollKit/Scripts/LLM/Claude/ClaudeService
  • ChatdollKit/Scripts/LLM/Gemini/GeminiService

🤗 Face Expression (NON VRM only)

Select Setup VRC FaceExpression Proxy in the context menu of VRC FaceExpression Proxy. Neutral, Joy, Angry, Sorrow and Fun face expression with all zero value and Blink face with blend shape for blink = 100.0f are automatically created.

You can edit shape keys by editing Face Clip Configuration directly or by capturing on inspector of VRCFaceExpressionProxy.

🥳 Run

Press Play button of Unity editor. You can see the model starts with idling animation and blinking.

  • Say the word you set to Wake Word on inspector (e.g. hello / こんにちは🇯🇵)
  • Your model will reply the word you set to Prompt Voice on inspector (e.g. what's up? / どうしたの?🇯🇵)
  • Say something you want to echo like "Hello world!"
  • Your model will reply "Hello world"

🌊 Use Azure OpenAI Service

To use Azure OpenAI Service set following info on inspector of ChatGPTService component:

  1. Endpoint url with configurations to Chat Completion Url
format: https://{your-resource-name}.openai.azure.com/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}
  1. API Key to Api Key

  2. Set true to Is Azure

NOTE: Model on inspector is ignored. Engine in url is used.

👷‍♀️ Build your own app

See the MultiSkills example. That is more rich application including:

  • Dialog Routing: Router is an example of how to decide the topic user want to talk
  • Processing dialog: TranslateDialog is an example that shows how to process dialog

We are now preparing contents to create more rich virtual assistant using ChatdollKit.

🌐 Run on WebGL

Refer to the following tips for now. We are preparing demo for WebGL.

  • It takes 5-10 minutes to build. (It depends on machine spec)
  • Very hard to debug. Error message doesn't show the stacktrace: To use dlopen, you need to use Emscripten’s linking support, see https://github.com/kripken/emscripten/wiki/Linking
  • Built-in Async/Await doesn't work (app stops at await) because JavaScript doesn't support threading. Use UniTask instead.
  • CORS required for HTTP requests.
  • Microphone is not supported. Use ChatdollMicrophone that is compatible with WebGL.
  • Compressed audio formats like MP3 are not supported. Use WAV in TTS Loaders.
  • OVRLipSync is not supported. Use uLipSync and uLipSyncWebGL instead.
  • If you want to show multibyte characters in message window put the font that includes multibyte characters to your project and set it to message windows.

❤️ Thanks

项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号