Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI-DotNet 6.5.2 #72

Merged
merged 1 commit into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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