GPT AI Integration
Easily add AI to your project without writing any code using the OpenAI API. Includes tools that add ChatGPT features that can answer any question and even write code for you. Save hours of your time!
This asset integrates the OpenAI API and others into your project, allowing you to add AI functionality to your game and the Unity editor quickly and easily without requiring you to write any code!
In minutes you can have dynamically generated personalities and conversations with your NPC's in-game, or even have the AI generate and edit scripts in your project!
There are far too many use cases of the AI to list... the only limit is your imagination.
Current API Integrations:
- OpenAI's GPT-4, GPT-4-32k, GPT-3.5-turbo (ChatGPT), and previous models like davinci and codex
- OpenAI's Whisper API (speech-to-text)
- OpenAI's Dall-E 2 API (text-to-image generation)
- ElevenLabs API (generate AI voices with text-to-speech)
This asset is beginner friendly and supports Unity Visual Scripting!
To get you started, there are some AI tools included in the asset for you:
๐ ๏ธ๐ ๏ธ Unity Editor Tools ๐ ๏ธ๐ ๏ธ
- ๐ฃ๏ธCustom GPT AI Chat ๐ฃ๏ธ - This tool functions similarly to OpenAI’s own Chat by acting as your AI personal assistant that can answer any question you have. Unlike the official Chat, with this tool you can customize the settings to fine tune the responses you receive. By default, this tool is configured to act as a Unity game development expert, but you can change this in the settings to behave any way you'd like. It can even write scripts for you and save them directly into your project! It will even remember the messages you send it and keep context awareness when replying to you. Chat logs are saved to your project so you can load them later and resume past conversations, or just for your reference!
Here are some examples of requests you can make to the AI:
Examples:
โ How can I create a custom Unity Editor window that has a settings button, and when clicked it reveals 5 more settings?
โ Write me a Unity C# script that can be used as a loot table, rewarding the player with different items based on an assigned weight.
โ Help me come up with a backstory for my game. The main characters name should be John and he travels the world collecting elemental powers.
- *NEW* ๐ผ๏ธ Image Generator ๐ผ๏ธ - Generate textures, sprites, artwork, and other images directly from the Unity editor and save the ones you like into your project! Save countless hours and resources on custom artwork by having the AI generate images for you!
- ๐ Script Editor ๐ - This tool allows you to analyze any script in your project using AI, which will take into account whatever message you send it and respond back with suggestions. You can use this to debug scripts, enhance them, or make general changes. If you agree with the AI recommendations, you can choose to have it automatically update the file for you.
- ๐จ Shader Generator๐จ - With this tool you can have the AI generate shaders for you! Simply describe the kind of shader your looking for and it'll write the code for you to review and then automatically apply it for you! Create shaders for your game using normal text prompts.
- ๐ง Prompt Generator ๐ง - The key to getting great results from AI tools is to craft the perfect prompt. This tool will automatically generate a high quality prompt for you, just give it a brief description of how you want the AI to act and it’ll give you a prompt template you can edit and use in any other AI tool.
๐ฎ๐ฎ Demo Implementations ๐ฎ๐ฎ
- โ Skybox Generator โ - Change the skybox of the scene in-game using the OpenAI Dall-E 2 API! Included C# example script is well documented and commented to show you how to create AI generated images either in-editor or in-game! Create your own free-to-use skyboxes, materials, portraits, artwork, and more!
- ๐ค Voice Chat ๐ค - Have a chat in-game with an AI using your voice hands-free! Audio is recorded using your microphone and then transcribed into text with the OpenAI Whisper API and sent to the GPT AI for a response, which is then converted into an AI generated voice using the ElevenLabs API! All code is well documented so you can easily get your own implementation up and running. This demo shows you how you can talk to the AI without any user input and get unique voice responses back! Choose from 9 default voices or use your own custom voices!
- ๐ฌ Dynamic Conversation ๐ฌ - Have a chat in-game with an AI that can remember the contents of your conversation and respond with context. This demo shows how you can use AI to create NPC's and other characters in your game you can have conversations with, complete with an AI generated personality! This implementation was created without writing any code using Visual Scripting.
- ๐ Language Translation ๐ - What if you had players from all around the world who want to communicate with each other but don't speak the same language? This implementation shows how you can translate text between any languages using AI. This implementation was created without writing any code using Visual Scripting.
Create your own AI implementations with the OpenAI API
Technical details
- This asset requires you have an OpenAI API key: OpenAI API
- Some AI models have a (very small) cost. View pricing here: Pricing (openai.com)
- Voice generation requires an ElevenLabs API key: ElevenLabs
This is an unofficial OpenAI integration, I am not affiliated with OpenAI in anyway.