Skip to content

Commit

Permalink
OpenAI-DotNet 5.0.1 (RageAgainstThePixel#32)
Browse files Browse the repository at this point in the history
- fixed RageAgainstThePixel#31 chat properties
- fixed RageAgainstThePixel#30 auth tests
  • Loading branch information
StephenHodgson committed Mar 2, 2023
1 parent 9e402d4 commit b8cadb9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
1 change: 0 additions & 1 deletion OpenAI-DotNet-Tests/TestFixture_00_Authentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public void Test_01_GetAuthFromEnv()
Assert.IsNotNull(auth);
Assert.IsNotNull(auth.ApiKey);
Assert.IsNotEmpty(auth.ApiKey);
Assert.IsNull(auth.OrganizationId);

auth = OpenAIAuthentication.LoadFromEnv("org-testOrg");
Assert.IsNotNull(auth);
Expand Down
11 changes: 10 additions & 1 deletion OpenAI-DotNet/Chat/ChatRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public sealed class ChatRequest
double? topP = null,
int? number = null,
string[] stops = null,
int? maxTokens = null,
double? presencePenalty = null,
double? frequencyPenalty = null,
string user = null)
Expand All @@ -33,6 +34,7 @@ public sealed class ChatRequest
TopP = topP;
Number = number;
Stops = stops;
MaxTokens = maxTokens;
PresencePenalty = presencePenalty;
FrequencyPenalty = frequencyPenalty;
User = user;
Expand Down Expand Up @@ -74,7 +76,7 @@ public sealed class ChatRequest
/// How many chat completion choices to generate for each input message.<br/>
/// Defaults to 1
/// </summary>
[JsonPropertyName("number")]
[JsonPropertyName("n")]
public int? Number { get; }

/// <summary>
Expand All @@ -91,6 +93,13 @@ public sealed class ChatRequest
[JsonPropertyName("stop")]
public string[] Stops { get; }

/// <summary>
/// The maximum number of tokens allowed for the generated answer.
/// By default, the number of tokens the model can return will be (4096 - prompt tokens).
/// </summary>
[JsonPropertyName("max_tokens")]
public int? MaxTokens { get; }

/// <summary>
/// Number between -2.0 and 2.0.
/// Positive values penalize new tokens based on whether they appear in the text so far,
Expand Down
26 changes: 14 additions & 12 deletions OpenAI-DotNet/OpenAI-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
Independently developed, this is not an official library and I am not affiliated with OpenAI.|
An OpenAI API account is required.
Based on OpenAI-API by OKGoDoIt (Roger Pincombe)</Description>
<Copyright></Copyright>
<Copyright>2023</Copyright>
<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>
<Title>OpenAI API</Title>
<PackageReleaseNotes>Bump version to 5.0.0
<PackageReleaseNotes>Bump version to 5.0.1
- Fixed chat parameters
Bump version to 5.0.0
- Added Chat endpoint
Bump version to 4.4.4
- ImageEditRequest mask is now optional so long as texture has alpha transparency
Expand All @@ -29,24 +31,24 @@ Bump version to 4.4.2
- Removed a useless assert
- Updated docs
Bump version to 4.4.1
- hotfix to CompletionsEndpoint to use `IEnumerable&lt;string&gt;`
- hotfix to CompletionsEndpoint to use IEnumerable&lt;string&gt;
- hotfix to cleanup Images endpoints
Bump version to 4.4.0
- Renamed `Choice.Logprobs -&gt; Choice.LogProbabilities`
- Renamed `OpenAI.Completions.Logprobs -&gt; OpenAI.Completions.OpenAI.Completions`
- Renamed `CompletionRequest` parameter names:
- `max_tokens` -&gt; `maxTokens`
- `top_p` -&gt; `topP`
- Updated `CompletionRequest` to accept `IEnumerable&lt;string&gt;` values for `prompts` and `stopSequences`
- Renamed Choice.Logprobs -&gt; Choice.LogProbabilities
- Renamed OpenAI.Completions.Logprobs -&gt; OpenAI.Completions.OpenAI.Completions
- Renamed CompletionRequest parameter names:
- max_tokens -&gt; maxTokens
- top_p -&gt; topP
- Updated CompletionRequest to accept IEnumerable&lt;string&gt; values for prompts and stopSequences
- Refactored all endpoints to use new response validation extension
- Added `CancellationToken` to most endpoints that had long running operations</PackageReleaseNotes>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>OpenAI-DotNet.pfx</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<PackageId>OpenAI-DotNet</PackageId>
<Version>5.0.0</Version>
<AssemblyVersion>4.4.4.0</AssemblyVersion>
<FileVersion>4.4.4.0</FileVersion>
<Version>5.0.1</Version>
<AssemblyVersion>5.0.1.0</AssemblyVersion>
<FileVersion>5.0.1.0</FileVersion>
<Company>RageAgainstThePixel</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
Expand Down

0 comments on commit b8cadb9

Please sign in to comment.