Skip to content

JsonSerializationException: Could not find member 'id' on object of type 'CreateChatCompletionResponse' v0.1.12 #53

@ChrisKlingler

Description

@ChrisKlingler

Hey @srcnalt , I'm seeing this issue in v0.1.12 with Unity 2022.2.16 running WebGL builds. Here is the JSON returned by OpenAI Chat Completion:

{"id":"chatcmpl-7Blu4ha7YR834teg22T0XYBdBk77D","object":"chat.completion","created":1683040104,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":70,"completion_tokens":58,"total_tokens":128},"choices":[{"message":{"role":"assistant","content":"Hello, it is a pleasure to be chatting with you today.\n\nI am feeling quite content at the moment, thank you for asking. How about yourself?\n\nDo you have any questions for me? I am happy to share my thoughts and insights on science, philosophy, and life in general."},"finish_reason":"stop","index":0}]}

But the library is throwing this error via Newtonsoft:

app.framework.js.br:10 JsonSerializationException: Could not find member 'id' on object of type 'CreateChatCompletionResponse'. Path 'id', line 1, position 6.
at 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) [0x00000] in <00000000000000000000000000000000>:0
--- End of stack trace from previous location where exception was thrown ---

Anything else I should adjust to get this to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions