Skip to content

Commit

Permalink
OpenAI-DotNet 6.1.0 (RageAgainstThePixel#45)
Browse files Browse the repository at this point in the history
- Added support for gpt-4 models
  • Loading branch information
StephenHodgson committed Mar 14, 2023
1 parent cd616fe commit 39d8ea4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
3 changes: 2 additions & 1 deletion OpenAI-DotNet/Chat/ChatRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public sealed class ChatRequest
{
Model = model ?? Models.Model.GPT3_5_Turbo;

if (!Model.Contains("turbo"))
if (!Model.Contains("turbo") &&
!Model.Contains("gpt-4"))
{
throw new ArgumentException($"{Model} is not supported", nameof(model));
}
Expand Down
10 changes: 10 additions & 0 deletions OpenAI-DotNet/Models/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ public Model(string id)
[JsonPropertyName("parent")]
public string Parent { get; private set; }

/// <summary>
/// More capable than any GPT-3.5 model, able to do more complex tasks, and optimized for chat. Will be updated with our latest model iteration.
/// </summary>
public static Model GPT4 { get; } = new Model("gpt-4") { OwnedBy = "openai" };

/// <summary>
/// Same capabilities as the base gpt-4 mode but with 4x the context length. Will be updated with our latest model iteration.
/// </summary>
public static Model GPT4_32K { get; } = new Model("gpt-4-32k") { OwnedBy = "openai" };

/// <summary>
/// Because gpt-3.5-turbo performs at a similar capability to text-davinci-003 but at 10%
/// the price per token, we recommend gpt-3.5-turbo for most use cases.
Expand Down
10 changes: 6 additions & 4 deletions OpenAI-DotNet/OpenAI-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Stephen Hodgson</Authors>
<Product>OpenAI-DotNet</Product>
<Description>A simple C# .NET client library for [OpenAI](https://openai.com/) to use GPT-3 and Dall-E though their RESTful API (currently in beta). Independently developed, this is not an official library and I am not affiliated with OpenAI. An OpenAI API account is required.
<Description>A simple C# .NET client library for OpenAI to use GPT-4 and Dall-E though their RESTful API (currently in beta). Independently developed, this is not an official library and I am not affiliated with OpenAI. An OpenAI API account is required.

Forked from [OpenAI-API-dotnet](https://github.com/OkGoDoIt/OpenAI-API-dotnet).

Expand All @@ -15,9 +15,11 @@ More context [on Roger Pincombe's blog](https://rogerpincombe.com/openai-dotnet-
<PackageLicenseExpression>CC0-1.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/RageAgainstThePixel/OpenAI-DotNet</PackageProjectUrl>
<RepositoryUrl>https://github.com/RageAgainstThePixel/OpenAI-DotNet</RepositoryUrl>
<PackageTags>OpenAI, AI, ML, API, gpt, gpt-3, chatGPT</PackageTags>
<PackageTags>OpenAI, AI, ML, API, gpt, gpt-4, gpt-3.5-tubo, gpt-3, chatGPT</PackageTags>
<Title>OpenAI API</Title>
<PackageReleaseNotes>Bump version to 6.0.1
<PackageReleaseNotes>Bump version to 6.1.0
- Added support for gpt-4 models
Bump version to 6.0.1
- Updated package info
- Updated docs
Bump version to 6.0.0
Expand Down Expand Up @@ -68,7 +70,7 @@ Bump version to 4.4.0
<AssemblyOriginatorKeyFile>OpenAI-DotNet.pfx</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<PackageId>OpenAI-DotNet</PackageId>
<Version>6.0.1</Version>
<Version>6.1.0</Version>
<Company>RageAgainstThePixel</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>Assets\OpenAI-DotNet-Icon.png</PackageIcon>
Expand Down

0 comments on commit 39d8ea4

Please sign in to comment.