Making ChatGPT in Unity!

preview_player
Показать описание
AI-generated content on the internet is booming and with OpenAI API you can make ChatGPT like apps or use DallE to generate images using your OpenAI account.

This tutorial shows how to install the OpenAI-Unity package I made to use it directly inside Unity. That comes with 2 sample scenes to test with.

---

⏲️ Timestamps:
00:00​ Introduction
00:48 Create OpenAI Account
03:20 Start a new Unity project
03:30​ Import the OpenAI-Unity Package
04:15​ Import sample projects
04:55 Setting local credentials
06:30 Testing ChatGPT Example
08:13 How ChatGPT Works
12:19 Explaining the ChatGPT Example Code
17:38 Testing DallE Example
19:45 Explaining the DallE Example Code
22:55 Final words

#chatgpt #ai #openai #gamedev​ #indiedev​​ #unity​ #madewithunity
Рекомендации по теме
Комментарии
Автор


I pushed an update which helps with Android and IOS builds. You can now pass API Key as a param to OpenAIApi ctor. But again this is not recommended for production.

sgtv
Автор

For those experiencing issues with authentication due to 'auth.json' not being found, please enable the viewing of file names and extensions. Ensure that your file is named with only the 'name.json' extension and not 'name.json.txt'

lukaspellant
Автор

Amazing work! As a Unity newbie this saved me lots of time. I modified the DallE sample to use the edit method and worked like a charm. Thanks!

camilosatut
Автор

Thanks for posting this! I’ve been looking for a tutorial on Chat GPt and Inreal Engine. This is pretty close😊

debbiedeerproductions
Автор

Do you know how can i fix this error: JsonSerializationException: Could not find member 'system_fingerprint' on object of type Path 'system_fingerprint', line 21, position 23.

camilonemocon
Автор

I get an error after sending message to the box, the error is "JsonSerializationException: Could not find member 'logprobs' on object of type 'ChatChoice'. Path 'choices[0].logprobs', line 13, position 17."

Morty
Автор

I think your github project got deprecated or something. It's suddenely stopped working after OpenAI updated their API?
Not sure what the exact cause is.
JsonSerializationException: Could not find member 'system_fingerprint' on object of type Path 'system_fingerprint', line 21, position 23.
This happens on every project.

youngjepark
Автор

I have created the .openai folder in my desktop. But the unity is not referring to the folder itself. So, where should I define the path in the C# script?

kirankumar
Автор

So I did the setup correctly, but when I click the SEND button I get an error that say: "Error Message: Error type invalid_request_error"
any idea how to solve it?

Gx-Studio
Автор

Merhaba, öncelikle videolar icin tesekkür ederim. Güncel olarak ChatGPT'nin Hololens 2'ye entegresi ve AR uygulamalarinda kullanimi üzerinde calisiyorum ancak henüz pek bir asama kaydedemedim :) Böyle bir ChatGPT entegre edilmis Hololens uygulamasi gerceklestirmek teorik olarak mümkün mü? Deneme amacli Android uygulamasi seklinde kurdum ancak girdigim metne cevap alamadim. Unity ve C# bilgim henüz cok az ve scriptleri inceleyerek nasil yapabilecegimi anlamaya calisiyorum. Bu noktada belki sizden alabilecegim tavsiyeler olur diye yorum yazmak istedim. Tekrardan tesekkürler.

atakancoban
Автор

Hi Sarge, is it possible to intergrate our own assistants in the package?

I've looked (or tried to look) under the hood, but I can't seem to find a way to add our Assistant ID but I believe we need to create a thread.

The way it is currently set up is a default Assistant, and thus is restricted by OpenAI's policies. If you want to use it for roleplaying in game without breaking character, you need to set up the assistant in the OpenAI playground first, then use that ID to specifically target that assistant in your libary.

This way, your characters will be "pure" gpt based on what you have set it to be in the playground.

In your method, we create the assistant and thus OpenAI gives us the default "Moderation" version of GPT thus, will be VERY assistant-like i.e "how can I help you today?" or "is there anything else you need?" vs maintaining a character/persona.

moosesnWoop
Автор

This worked like a charm and saved me loads of time. Thank you so much, highly appreciated!

palebluewanders
Автор

Hey ! 

I've got an error saying "The Progressive CPU lightmapper is not supported on Apple silicon, switching to the Progressive GPU lightmapper.
(int, intptr, bool&)"

When I run the ChatGPT example I've got a warning "No text was generated from this prompt". Any idea on how I could fix it ?

Thank you !

paulinespinga
Автор

Thank you very much, your videos are excellent, but I have a problem. In the editor it works perfectly for me, but when building the android application it doesn't work, I think it doesn't read the api key, any recommendations.

antonolivaresjuanjose
Автор

Hi, any advice on how to connect a custom assistant to Unity? What endpoint should it be called?

gamitcrs
Автор

sorry!
I've got an error saying
JsonSerializationException: Could not find member 'logprobs' on object of type 'ChatChoice'. Path 'choices[0].logprobs', line 13, position 17.
Thanks!!!

Unknown-udog
Автор

this error is coming for me after I did organization and secret key Error Message: You exceeded your current quota, please check your plan and billing details.
Error Type: insufficient_quota and I know that is because free trail expired but I create new account and tried but still its coming like that what was the best solution that I can, do this speech recognition for free.

nashralaa
Автор

hmm, none of my buttons are working, I am unsure if my UI_EventSystem is setup properly. should I not use the input system UI input Module componenet?

tordgaming
Автор

Thank you very much for your video! I have an error when trying to run your Dall-E game on the web, the program works perfectly in Unity but on the web it doesn't do anything... Using the "Development Build" function, I get the error "ArgumentException: Could not create sprite (0, 0, 256, 256) from a 8x8 texture" in the console... I've been searching for a solution for 2 days but I can't find anything. Any ideas on how to fix this?

gonzaloemmanuelvina
Автор

Thanks for sharing this great method to communicate with GPT, just have a question. If I want to build this project with the GPT model. should I Embed API in the script? Otherwise, do I need to have the .openai and auth.json files on other computers for running?

jarryhuang