Skip to content

Commit

Permalink
OpenAI-DotNet 6.5.2 (RageAgainstThePixel#72)
Browse files Browse the repository at this point in the history
- Updated SetResponseData to better reflect the difference between
OpenAI and Azure responses.
- Updated ProcessingTime parsing from int to double
- Updated docs
  • Loading branch information
StephenHodgson committed Mar 29, 2023
1 parent 7ac7bc5 commit 08b1094
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 5 additions & 2 deletions OpenAI-DotNet/OpenAI-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ More context [on Roger Pincombe's blog](https://rogerpincombe.com/openai-dotnet-
<RepositoryUrl>https://github.com/RageAgainstThePixel/OpenAI-DotNet</RepositoryUrl>
<PackageTags>OpenAI, AI, ML, API, gpt-4, gpt-3.5-tubo, gpt-3, chatGPT, chat-gpt, gpt-2, gpt</PackageTags>
<Title>OpenAI API</Title>
<PackageReleaseNotes>Version 6.5.1
<PackageReleaseNotes>Version 6.5.2
- Updated SetResponseData to better reflect the difference between OpenAI and Azure responses.
- Updated ProcessingTime parsing from int to double
Version 6.5.1
- Removed Obsolete from EditEndpoint as it has now been fixed by OpenAI
Version 6.5.0
- Marked EditEndpoint Obsolete as codex and edit models have been removed
Expand Down Expand Up @@ -99,7 +102,7 @@ Version 4.4.0
<AssemblyOriginatorKeyFile>OpenAI-DotNet.pfx</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<PackageId>OpenAI-DotNet</PackageId>
<Version>6.5.1</Version>
<Version>6.5.2</Version>
<Company>RageAgainstThePixel</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>Assets\OpenAI-DotNet-Icon.png</PackageIcon>
Expand Down
8 changes: 6 additions & 2 deletions OpenAI-DotNet/ResponseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ internal static class ResponseExtensions

internal static void SetResponseData(this BaseResponse response, HttpResponseHeaders headers)
{
response.Organization = headers.GetValues(Organization).FirstOrDefault();
if (headers.Contains(Organization))
{
response.Organization = headers.GetValues(Organization).FirstOrDefault();
}

response.ProcessingTime = TimeSpan.FromMilliseconds(double.Parse(headers.GetValues(ProcessingTime).First()));
response.RequestId = headers.GetValues(RequestId).FirstOrDefault();
response.ProcessingTime = TimeSpan.FromMilliseconds(int.Parse(headers.GetValues(ProcessingTime).First()));
}

internal static async Task<string> ReadAsStringAsync(this HttpResponseMessage response, CancellationToken cancellationToken = default, [CallerMemberName] string methodName = null)
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Install-Package OpenAI-DotNet
- [Chat](#chat)
- [Chat Completions](#chat-completions)
- [Streaming](#chat-streaming)
- [Edits](#edits) :warning:
- [Create Edit](#create-edit) :warning:
- [Edits](#edits)
- [Create Edit](#create-edit)
- [Embeddings](#embeddings)
- [Create Embedding](#create-embeddings)
- [Audio](#audio)
Expand Down Expand Up @@ -381,10 +381,6 @@ await foreach (var result in api.ChatEndpoint.StreamCompletionEnumerableAsync(ch

### [Edits](https://beta.openai.com/docs/api-reference/edits)

> :warning: The models for this endpoint have been removed making it no longer usable.
>
> [See forum post for more details](https://community.openai.com/t/the-model-text-davinci-edit-001-does-not-exist/116144).
Given a prompt and an instruction, the model will return an edited version of the prompt.

The Edits API is accessed via `OpenAIClient.EditsEndpoint`
Expand Down

0 comments on commit 08b1094

Please sign in to comment.