Skip to content

Commit ca916e9

Browse files
authored
Merge pull request #127 from srcnalt/fix/minor-fixes
Minor Fixes
2 parents f7f501c + 3fd5efb commit ca916e9

5 files changed

Lines changed: 17 additions & 6 deletions

File tree

Runtime/DataTypes.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ public sealed class CreateChatCompletionRequest
9797
public Dictionary<string, string> LogitBias { get; set; }
9898
public string User { get; set; }
9999
public string SystemFingerprint { get; set; }
100+
public ResponseFormat ResponseFormat { get; set; }
101+
}
102+
103+
public class ResponseFormat
104+
{
105+
public string Type { get; set; } = ResponseType.Text;
100106
}
101107

102108
public struct CreateChatCompletionResponse : IResponse
@@ -351,6 +357,12 @@ public static class ContentType
351357
public const string MultipartFormData = "multipart/form-data";
352358
public const string ApplicationJson = "application/json";
353359
}
360+
361+
public static class ResponseType
362+
{
363+
public const string Text = "text";
364+
public const string JsonObject = "json_object";
365+
}
354366

355367
public static class ImageSize
356368
{

Samples~/ChatGPT/ChatGPT.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private async void SendReply()
5858
// Complete the instruction
5959
var completionResponse = await openai.CreateChatCompletion(new CreateChatCompletionRequest()
6060
{
61-
Model = "gpt-3.5-turbo-0613",
61+
Model = "gpt-3.5-turbo",
6262
Messages = messages
6363
});
6464

Samples~/Stream Response/StreamResponse.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using System;
21
using UnityEngine;
32
using System.Linq;
43
using UnityEngine.UI;
5-
using System.Collections.Generic;
64
using System.Threading;
5+
using System.Collections.Generic;
76

87
namespace OpenAI
98
{
@@ -35,7 +34,7 @@ private void SendMessage()
3534

3635
openai.CreateChatCompletionAsync(new CreateChatCompletionRequest()
3736
{
38-
Model = "gpt-3.5-turbo-0301",
37+
Model = "gpt-3.5-turbo",
3938
Messages = message,
4039
Stream = true
4140
}, HandleResponse, null, token);

Tests/ModelsApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public async Task List_Models()
1717
[Test]
1818
public async Task Retrieve_Models()
1919
{
20-
var id = "text-davinci-003";
20+
var id = "gpt-3.5-turbo";
2121
var models = await openai.RetrieveModel(id);
2222
Assert.AreEqual(id, models.Id);
2323
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.srcnalt.openai-unity",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"displayName": "OpenAI Unity",
55
"description": "An unofficial OpenAI Unity package that aims to help you use OpenAI API directly in Unity game engine.",
66
"unity": "2020.3",

0 commit comments

Comments
 (0)