srcnalt / OpenAI-Unity

An unofficial OpenAI Unity Package that aims to help you use OpenAI API directly in Unity Game engine.
MIT License
648 stars 144 forks source link

How to solve GPT-4 turbo (gpt-4-1106-preview) error #98

Open kwan3854 opened 7 months ago

kwan3854 commented 7 months ago

edit DataTypes.cs

    public struct CreateChatCompletionResponse : IResponse
    {
        public ApiError Error { get; set; }
        public string Model { get; set; }
        public string Id { get; set; }
        public string Object { get; set; }
        public long Created { get; set; }
        public List<ChatChoice> Choices { get; set; }
        public Usage Usage { get; set; }
        // Add these fields
        public string SystemFingerprint { get; set; }
    }

now you can use gpt-4-1106-preview model.

HUIMANDY commented 7 months ago

Thank you! This is very helpful.

jhinpan commented 7 months ago

Thank you for the advice, but I got a question that since the file DataType.cs is part of the Unity Package Cache. And any changes made will be lost. Does that mean each time we open Unity, we need to make this change?

kwan3854 commented 7 months ago

Thank you for the advice, but I got a question that since the file DataType.cs is part of the Unity Package Cache. And any changes made will be lost. Does that mean each time we open Unity, we need to make this change?

Indeed, you're correct. Since DataType.cs is part of the Unity Package Cache, any modifications you make directly to the file in the cache could be overwritten. I have submitted a pull request with the necessary changes. It would be best to wait for the merge and subsequent update of the library before proceeding.

Swami39 commented 7 months ago

HOW TO EDIT DATATYPES.CS