Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonSerializationException: No JSON content found and type 'OpenAI.CreateAudioResponse' is not nullable. Path '', line 0, position 0. #119

Open
Exiro001 opened this issue Mar 29, 2024 · 6 comments

Comments

@Exiro001
Copy link

Exiro001 commented Mar 29, 2024

JsonSerializationException: No JSON content found and type 'OpenAI.CreateAudioResponse' is not nullable. Path '', line 0, position 0.
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) (at <761cf2a144514d2291a678c334d49e9b>:0)
Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at <761cf2a144514d2291a678c334d49e9b>:0)
Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at <761cf2a144514d2291a678c334d49e9b>:0)
Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) (at <761cf2a144514d2291a678c334d49e9b>:0)
Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) (at <761cf2a144514d2291a678c334d49e9b>:0)
OpenAI.OpenAIApi.DispatchRequest[T] (System.String path, System.Collections.Generic.List`1[T] form) (at C:/Users/LENOVO ONE/Downloads/OpenAI-Unity-0.2.0/OpenAI-Unity-0.2.0/Runtime/OpenAIApi.cs:176)
OpenAI.OpenAIApi.CreateAudioTranscription (OpenAI.CreateAudioTranscriptionsRequest request) (at C:/Users/LENOVO ONE/Downloads/OpenAI-Unity-0.2.0/OpenAI-Unity-0.2.0/Runtime/OpenAIApi.cs:336)
Samples.Whisper.Whisper.EndRecording () (at Assets/Samples/OpenAI Unity/0.2.0/Whisper/Whisper.cs:73)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at <27124aa0e30a41659b903b822b959bc7>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0)
UnityEngine.UnitySynchronizationContext.Exec () (at :0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at :0)

this all occurred in all samples provided

@srcnalt
Copy link
Owner

srcnalt commented Mar 29, 2024

Hi @Exiro001, the received response is not a JSON, so it might me a message about quota limit or something else. You can print out the response before it gets parsed and see what the error says.

@markaeron-ns
Copy link

I've encountered the same error but I haven't reached my quota limit. I just bought 5$ worth of tokens / quota. The error I see in VR is:

JsonSerializationException: No JSON Content found and type 'OpenAI.CreateAudioResponse' is not nullable. Path '', line 0, position 0

It works in the editor but doesn't work in VR. Since the API key is being read from auth.json, I manually placed the API key inside the script instead inside the = new OpenAI("apikey", "orgkey");. To my surprise, I still receive the same error.

@JensDijkgraaf
Copy link

I have had the same issue, after adding the API/Organization key had the same issue still, what solved it for me is going to: build settings -> player settings -> publishing settings, then enable Custom Main Manifest. Go to the manifest file and add the following line:

within the manifest class. Hope this helps!

@tobivr
Copy link

tobivr commented Apr 17, 2024

@JensDijkgraaf we have the same issue... what is the line you have added to the manifest?
Its not visible in your post 😄
In our case its working on the Editor as well but on iOS we are seeing the issue from above.

@JensDijkgraaf
Copy link

@tobivr my bad, the line you need to add is:

<uses-permission android:name="android.permission.INTERNET" />

as can be seen in the line this is specifically for android, but i can imagine there would be a similar but slightly different solution for iOS, hope it helps!

@hridayc7
Copy link

hridayc7 commented Jun 25, 2024

I added in what you said @JensDijkgraaf, however, I am still receiving the same issue. Any other ideas perhaps?
EDIT/UPDATE: After having issues, I realized I needed to do something similar to what was done here #117 --> with the XR settings and force internet permissions. Thank you all for your help!

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

No branches or pull requests

6 participants