keijiro / AIShader

ChatGPT-powered shader generator for Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in console

Weimmer opened this issue · comments

Hi Keijiro,

it is a very cool test, that's why I grab as soon as I see it, but when I click the generate button on the AIShader, it has error in the console:

NullReferenceException: Object reference not set to an instance of an object
AIShader.AIShaderImporterEditor.Regenerate () (at Assets/Editor/AIShaderImporterEditor.cs:55)
_cached.stringValue = response.choices[0].message.content;

Maybe I missed some setting? I have already pasted my chatgpt api key, where it should to be.

Best regards
Weimmer

Could you check if your API key works properly for the chat completion API? You can test it with curl like the following:

curl https://api.openai.com/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
  "model": "gpt-3.5-turbo",
  "messages": [{"role": "user", "content": "Hello!"}]
}'

I'm having the same issue and i tested the curl you got here and got just got errors
where would i need to run this i would assume cmd correct?

@Da-bass-man Please copy-paste the errors.

(I also recommend your billing status if your free trial period has been expired.)

Ahh you know that might be it looks like my credits expired

curl https://api.openai.com/v1/chat/completions
-H 'Content-Type: application/json'
-H 'Authorization: Bearer YOUR_API_KEY'
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]
}'

Thanks for reply, I have tried and done some research, it seems I need a ChatGPT plus, is that true?

No. You only need ChatGPT API access.

https://openai.com/blog/introducing-chatgpt-and-whisper-apis

I think I got it, I have to add a payment method in my account, otherwise it will get the error like above. Thanks, it is really cool :)

Yes, it needs payment settings if your free trial period has been ended.

Hi Keijiro,

it is a very cool test, that's why I grab as soon as I see it, but when I click the generate button on the AIShader, it has error in the console:

NullReferenceException: Object reference not set to an instance of an object AIShader.AIShaderImporterEditor.Regenerate () (at Assets/Editor/AIShaderImporterEditor.cs:55) _cached.stringValue = response.choices[0].message.content;

Maybe I missed some setting? I have already pasted my chatgpt api key, where it should to be.

Best regards Weimmer