SethRobinson / GPTAvatar

a 3D AI Virtual Chatbot made in Unity that uses APIs for Whisper, GPT-4 & ElevenLabs speech
Other
108 stars 20 forks source link

ERROR IN VALIDATING VALID OPEN AI KEY #1

Open OculusQuestVR opened 9 months ago

OculusQuestVR commented 9 months ago

Good morning Seth, I'm Mauro from Rome. First of all, I wanted to compliment you on your projects; truly remarkable and innovative. I was trying your interesting GPT Avatar project, but even after inserting a valid key in the appropriate field (between open and closed parentheses) and saving the file as config.txt, I'm encountering the following error:

{ "error": { "message": "Incorrect API key provided: \u**-***mi\u003e. You can find your API key at https://platform.openai.com/account/api-keys.", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" } }

Would you be so kind as to suggest a solution so I can test your project? P.S: The key is valid and has access to the GPT 3.5 Chat API. Warm regards and congratulations again on your work. Mauro from Rome.

SethRobinson commented 9 months ago

Huh, I just ran it on my system and it worked (with the same key) with its config.txt file set to:

set_openai_model|gpt-3.5-turbo or set_openai_model|gpt-4 or set_openai_model|gpt-4-1106-preview

So not sure what's wrong. Try gpt-4?

If it's an older key I'd try generating a new one, there is some weirdness with legacy systems needing a different endpoint, but I think that only applies to gpt-3.5-turbo-instruct, etc.

OculusQuestVR commented 9 months ago

Thank you, Seth. The key is recent and functional, so I don't understand what the issue might be. Perhaps it's a syntax problem on my end in the config file. Would you be so kind as to send me an example of how the 'openai' key should be set in the config file, along with a piece of code? Congratulations also on your activities, including those related to sports. I'm actually involved in developing VR apps for Oculus Quest (my website is www.fitnessvr.it, you can also find them on SidequestVR and Itch, such as Boxing Trainer VR and City Run VR). I'm very interested in your application; if I manage to get it working, maybe we can collaborate on a project based on some of the functionalities you've implemented. Regards, Mauro

Il giorno mar 21 nov 2023 alle ore 00:17 Seth Robinson < @.***> ha scritto:

Huh, I just ran it on my system and it worked (with the same key) with its config.txt file set to:

set_openai_model|gpt-3.5-turbo or set_openai_model|gpt-4 or set_openai_model|gpt-4-1106-preview

So not sure what's wrong. Try gpt-4?

If it's an older key I'd try generating a new one, there is some weirdness with legacy systems needing a different endpoint, but I think that only applies to gpt-3.5-turbo-instruct, etc.

— Reply to this email directly, view it on GitHub https://github.com/SethRobinson/GPTAvatar/issues/1#issuecomment-1819957415, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2YRSIEPDYC23DDUPKEP6YLYFPQG7AVCNFSM6AAAAAA7S5M2LOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJZHE2TONBRGU . You are receiving this because you authored the thread.Message ID: @.***>

SethRobinson commented 9 months ago

Sure, here is how my (redacted) key is set in the config.txt file:

#required, set your openAI API key
set_openai_api_key|sk-jUj5ss8zbi1412896307346278034623786RhfFqavU

BTW, running it directly from Unity will cause it to write .txt files of the actual request (not just the error) to OpenAI which might be useful for debugging what's wrong, might see a weird extra space or invisible character at the end or something. I believe you can put an ending | to make sure there isn't a rogue CR or linefeed being added by your editor (windows vs linux type editing thing?)

Good luck with your VR apps!