Skip to content

Commit ae5a9e0

Browse files
committed
Add GPT4 models
1 parent abd5811 commit ae5a9e0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

OpenAI_API/Model/Model.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ public Model()
143143
/// </summary>
144144
public static Model ChatGPTTurbo0301 => new Model("gpt-3.5-turbo-0301") { OwnedBy = "openai" };
145145

146+
/// <summary>
147+
/// More capable than any GPT-3.5 model, able to do more complex tasks, and optimized for chat. Will be updated with the latest model iteration. Currently in limited beta so your OpenAI account needs to be whitelisted to use this.
148+
/// </summary>
149+
public static Model GPT4 => new Model("gpt-4") { OwnedBy = "openai" };
150+
151+
/// <summary>
152+
/// Same capabilities as the base gpt-4 mode but with 4x the context length. Will be updated with the latest model iteration. Currently in limited beta so your OpenAI account needs to be whitelisted to use this.
153+
/// </summary>
154+
public static Model GPT4_32k_Context => new Model("gpt-4-32k") { OwnedBy = "openai" };
155+
146156
/// <summary>
147157
/// Stable text moderation model that may provide lower accuracy compared to TextModerationLatest.
148158
/// OpenAI states they will provide advanced notice before updating this model.

OpenAI_Tests/ChatEndpointTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ public void SimpleCompletion()
8484
Assert.IsNotEmpty(results.ToString());
8585
}
8686

87-
[Test]
88-
public void ChatBackAndForth()
87+
[TestCase("gpt-3.5-turbo")]
88+
[TestCase("gpt-4")]
89+
public void ChatBackAndForth(string model)
8990
{
9091
var api = new OpenAI_API.OpenAIAPI();
9192

9293
var chat = api.Chat.CreateConversation();
94+
chat.Model = model;
9395

9496
chat.AppendSystemMessage("You are a teacher who helps children understand if things are animals or not. If the user tells you an animal, you say \"yes\". If the user tells you something that is not an animal, you say \"no\". You only ever respond with \"yes\" or \"no\". You do not say anything else.");
9597
chat.AppendUserInput("Is this an animal? Cat");

0 commit comments

Comments
 (0)