Skip to content

Commit

Permalink
OpenAI-DotNet 7.6.5 (#234)
Browse files Browse the repository at this point in the history
- Updated api key prefix checks to only be enforced for OpenAI domain
  • Loading branch information
StephenHodgson authored Feb 6, 2024
1 parent 81b989f commit 8e99b07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion OpenAI-DotNet/OpenAI-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ More context [on Roger Pincombe's blog](https://rogerpincombe.com/openai-dotnet-
<AssemblyOriginatorKeyFile>OpenAI-DotNet.pfx</AssemblyOriginatorKeyFile>
<IncludeSymbols>True</IncludeSymbols>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<Version>7.6.4</Version>
<Version>7.6.5</Version>
<PackageReleaseNotes>
Version 7.6.5
- Updated api key prefix checks to only be enforced for OpenAI domain
Version 7.6.4
- Removed obsolete completions and edit endpoints
Version 7.6.3
Expand Down
2 changes: 1 addition & 1 deletion OpenAI-DotNet/OpenAIClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private HttpClient SetupClient(HttpClient client = null)
client.DefaultRequestHeaders.Add("User-Agent", "OpenAI-DotNet");
client.DefaultRequestHeaders.Add("OpenAI-Beta", "assistants=v1");

if (!OpenAIClientSettings.BaseRequestUrlFormat.Contains(OpenAIClientSettings.AzureOpenAIDomain) &&
if (OpenAIClientSettings.BaseRequestUrlFormat.Contains(OpenAIClientSettings.OpenAIDomain) &&
(string.IsNullOrWhiteSpace(OpenAIAuthentication.ApiKey) ||
(!OpenAIAuthentication.ApiKey.Contains(AuthInfo.SecretKeyPrefix) &&
!OpenAIAuthentication.ApiKey.Contains(AuthInfo.SessionKeyPrefix))))
Expand Down

0 comments on commit 8e99b07

Please sign in to comment.