-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Meeting error with JsonSerializationException when trying the ChatCompletion #99
Comments
I met the same problem, but it didn't happen yesterday." |
Same situation for me! I haven't managed to resolve it yet, but I found a helpful starting point at https://platform.openai.com/docs/guides/text-generation. The issue seems to be related to how the API is being invoked. |
I managed to temporarily solve the issue. Not sure if its effecting anything internally, but when you double click the error, the line of code the error is being shown from, just remove this part ", jsonSerializerSettings". Again, I am not sure if this'll cause any other problems but it seems to be a temporary fix. |
I think the issue is that a system_fingerprint field is being sent in the response. I solved this by adding |
Came across this issue and found that there is a new variable added in response coming from GPT, that is "system_fingerprint". I just updated DataTypes.cs with updated string variable and it worked. |
Thank you for your guys' help!!! Yeah, I think updating DataTypes.cs will temporarily solve this problem. Hope everyone does well through it. |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It reports error:
JsonSerializationException: Could not find member 'system_fingerprint' on object of type 'CreateChatCompletionResponse'. Path 'system_fingerprint', line 21, position 23.
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject (System.Object newObject, Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty member, System.String id) (at <761cf2a144514d2291a678c334d49e9b>:0)
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) (at <761cf2a144514d2291a678c334d49e9b>:0)
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) (at <761cf2a144514d2291a678c334d49e9b>: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.String method, System.Byte[] payload) (at Library/PackageCache/com.srcnalt.openai-unity@1928201773/Runtime/OpenAIApi.cs:82)
OpenAI.OpenAIApi.CreateChatCompletion (OpenAI.CreateChatCompletionRequest request) (at Library/PackageCache/com.srcnalt.openai-unity@1928201773/Runtime/OpenAIApi.cs:259)
OpenAI.MicrophoneCapture.SendReplyToCopilot () (at Assets/Scripts/ChatGPT/MicrophoneCapture.cs:438)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at <88e4733ac7bc4ae1b496735e6b83bbd3>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0)
UnityEngine.UnitySynchronizationContext.Exec () (at :0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at :0)
Screenshots
![0c4ab95b45147e92468ce5d4796ecc3](https://private-user-images.githubusercontent.com/47354855/286814899-ce59be20-9aef-470c-a178-e007934b3a01.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5MDY0MDQsIm5iZiI6MTcxODkwNjEwNCwicGF0aCI6Ii80NzM1NDg1NS8yODY4MTQ4OTktY2U1OWJlMjAtOWFlZi00NzBjLWExNzgtZTAwNzkzNGIzYTAxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIwVDE3NTUwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY5ODFlNWZiOGVjMTdjZWZmNWRmMDJiMTQ2N2I2NzZiNDAyMGYwODgxYTQxNzY5NGZkMzdjZjRiODlmZWI4MzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.O-4XdkxsQJT2wjacpRBgDiai83sdYk3ElEPVj5aFfOM)
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: