Skip to content

Commit

Permalink
com.openai.unity 5.0.9 (#105)
Browse files Browse the repository at this point in the history
- Fixed Model delete permission Unauthorized Access check
  • Loading branch information
StephenHodgson authored Aug 27, 2023
1 parent ddbe034 commit 75aadee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Editor/FineTuning/FineTuningWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ private static void RenderOrganizationModels()
}
catch (UnauthorizedAccessException)
{
EditorUtility.DisplayDialog("Unauthorized", "You do not have permissions to delete models for this organization.", "Ok");
EditorUtility.DisplayDialog("Unauthorized", "You have insufficient permissions for this operation. You need to be this role: Owner.", "Ok");
}
catch (Exception e)
{
Expand Down
4 changes: 2 additions & 2 deletions Runtime/Models/ModelsEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public async Task<bool> DeleteFineTuneModelAsync(string modelId, CancellationTok
catch (RestException e)
{
if (e.Response.Code == 403 ||
e.Message.Contains("api.delete"))
e.Message.Contains("You have insufficient permissions for this operation. You need to be this role: Owner."))
{
throw new UnauthorizedAccessException("You do not have permissions to delete models for this organization.");
throw new UnauthorizedAccessException("You have insufficient permissions for this operation. You need to be this role: Owner.");
}

throw;
Expand Down
2 changes: 1 addition & 1 deletion Tests/TestFixture_09_FineTuning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public async Task Test_08_DeleteFineTunedModel()
}
catch (UnauthorizedAccessException)
{
Console.WriteLine("Your account does not have permissions to delete models.");
Console.WriteLine("You have insufficient permissions for this operation. You need to be this role: Owner.");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "OpenAI",
"description": "A OpenAI package for the Unity Game Engine to use GPT-4, GPT-3.5, GPT-3 and Dall-E though their RESTful API (currently in beta).\n\nIndependently developed, this is not an official library and I am not affiliated with OpenAI.\n\nAn OpenAI API account is required.",
"keywords": [],
"version": "5.0.8",
"version": "5.0.9",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.openai.unity#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.openai.unity/releases",
Expand Down

0 comments on commit 75aadee

Please sign in to comment.