Skip to content

Commit

Permalink
OpenAI-DotNet 7.6.4 (#231)
Browse files Browse the repository at this point in the history
- Removed obsolete completions and edit endpoints
  • Loading branch information
StephenHodgson authored Jan 29, 2024
1 parent a382b0a commit 81b989f
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 1,312 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Publish-Nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
echo "PACKAGE_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: OpenAI-DotNet.${{ env.PACKAGE_VERSION }}
Expand All @@ -148,7 +148,7 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand All @@ -163,4 +163,4 @@ jobs:

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4.0.3
74 changes: 0 additions & 74 deletions OpenAI-DotNet-Tests/TestFixture_02_Completions.cs

This file was deleted.

23 changes: 0 additions & 23 deletions OpenAI-DotNet-Tests/TestFixture_04_Edits.cs

This file was deleted.

34 changes: 17 additions & 17 deletions OpenAI-DotNet-Tests/TestFixture_08_Files.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,39 +62,39 @@ public async Task Test_03_DownloadFile()
}

[Test]
public async Task Test_04_DeleteFiles()
public async Task Test_04_RetrieveFileStreamAsync()
{
Assert.IsNotNull(OpenAIClient.FilesEndpoint);
var fileList = await OpenAIClient.FilesEndpoint.ListFilesAsync();

Assert.IsNotNull(fileList);
Assert.IsNotEmpty(fileList);

foreach (var file in fileList)
{
var isDeleted = await OpenAIClient.FilesEndpoint.DeleteFileAsync(file);
Assert.IsTrue(isDeleted);
Console.WriteLine($"{file.Id} -> deleted");
}
var testFileData = fileList[0];
var result = await OpenAIClient.FilesEndpoint.RetrieveFileStreamAsync(testFileData);

fileList = await OpenAIClient.FilesEndpoint.ListFilesAsync();
Assert.IsNotNull(fileList);
Assert.IsEmpty(fileList);
Assert.IsNotNull(result);
Assert.IsTrue(result.CanRead);
}

[Test]
public async Task Test_05_RetrieveFileStreamAsync()
public async Task Test_05_DeleteFiles()
{
Assert.IsNotNull(OpenAIClient.FilesEndpoint);
var fileList = await OpenAIClient.FilesEndpoint.ListFilesAsync();

Assert.IsNotNull(fileList);
Assert.IsNotEmpty(fileList);

var testFileData = fileList[0];
var result = await OpenAIClient.FilesEndpoint.RetrieveFileStreamAsync(testFileData);
foreach (var file in fileList)
{
var isDeleted = await OpenAIClient.FilesEndpoint.DeleteFileAsync(file);
Assert.IsTrue(isDeleted);
Console.WriteLine($"{file.Id} -> deleted");
}

Assert.IsNotNull(result);
Assert.IsTrue(result.CanRead);
fileList = await OpenAIClient.FilesEndpoint.ListFilesAsync();
Assert.IsNotNull(fileList);
Assert.IsEmpty(fileList);
}
}
}
1 change: 1 addition & 0 deletions OpenAI-DotNet-Tests/TestFixture_12_Threads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public async Task Test_04_02_ListMessages()
public async Task Test_04_03_ModifyMessage()
{
Assert.IsNotNull(testThread);
Assert.IsNotNull(testMessage);
Assert.IsNotNull(OpenAIClient.ThreadsEndpoint);
var metadata = new Dictionary<string, string>
{
Expand Down
47 changes: 0 additions & 47 deletions OpenAI-DotNet/Completions/Choice.cs

This file was deleted.

Loading

0 comments on commit 81b989f

Please sign in to comment.