Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

ERROR: StatusCode: 400 - HTTP/1.1 400 Bad Request #53

Open
cynex opened this issue Dec 10, 2022 · 2 comments
Open

ERROR: StatusCode: 400 - HTTP/1.1 400 Bad Request #53

cynex opened this issue Dec 10, 2022 · 2 comments

Comments

@cynex
Copy link

cynex commented Dec 10, 2022

Hey there, Thank you for spearheading this idea, it's a great one !
Had an issue getting it up and running though, I followed the instructions on the video, but I get an error 400 when trying to process a request.
I found that importing the package into 2019.4.38f1 yielded errors, but the package did import into 2020.3.25f1 and 2021.3.1f1, going to also try 2019.4.18f1 which had the same errors as 2019.4.38f1. again, this did work in newer versions of unity, it just returned a 400 error.

I have my private key in the auth.json file in my userprofile in .openai

Here's the errors found in 2019

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(173,93): error CS1061: 'UnityWebRequest' does not contain a definition for 'result' and no accessible extension method 'result' accepting a first argument of type 'UnityWebRequest' could be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(173,119): error CS0117: 'UnityWebRequest' does not contain a definition for 'Result'

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(176,26): error CS1061: 'UnityWebRequest' does not contain a definition for 'result' and no accessible extension method 'result' accepting a first argument of type 'UnityWebRequest' could be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(176,52): error CS0117: 'UnityWebRequest' does not contain a definition for 'Result'

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(195,88): error CS1061: 'UnityWebRequest' does not contain a definition for 'result' and no accessible extension method 'result' accepting a first argument of type 'UnityWebRequest' could be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(195,114): error CS0117: 'UnityWebRequest' does not contain a definition for 'Result'

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(197,50): error CS1061: 'UnityWebRequest' does not contain a definition for 'result' and no accessible extension method 'result' accepting a first argument of type 'UnityWebRequest' could be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(197,76): error CS0117: 'UnityWebRequest' does not contain a definition for 'Result'

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(299,38): error CS1061: 'UnityWebRequest' does not contain a definition for 'result' and no accessible extension method 'result' accepting a first argument of type 'UnityWebRequest' could be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(299,64): error CS0117: 'UnityWebRequest' does not contain a definition for 'Result'

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(316,38): error CS1061: 'UnityWebRequest' does not contain a definition for 'result' and no accessible extension method 'result' accepting a first argument of type 'UnityWebRequest' could be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.openai.api.unity@6b059ee\Runtime\Scripts\Api\Base\AApiResource.cs(316,64): error CS0117: 'UnityWebRequest' does not contain a definition for 'Result'

Just noticing as well that the video was posted a year ago, so I'm hoping this project is still active
Cheers !

@hexthedev
Copy link
Owner

Hi @cynex . Sadly I don't have enough time to properly maintain this repo. It's been inactive for a while. I was hoping someone using GPT-3 in Unity more actively might be able to take the ideas in here and build something better.

I'm not sure why you're not getting a result object from UnityWebRequest. This error normally means that the object does not have a public facing property of that name. It could potentially have been changed in the release of Unity you're using. Although, I just checked the docs and it looks like the property exists still.

As for the auth issues, I can't promise I'll be able to fix it. The OpenAI API has moved quite quickly, and I haven't tried to keep up with the changes they may have made. It's possible that the way they do auth has changed since I've worked on this. I abandoned GPT-3 in my project.

If you want to try and tackle these issues, I will gladly give you a run down of how the code works though. It's rather simple under the surface.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@cynex @hexthedev and others