Skip to content

Commit

Permalink
com.openai.unity 5.1.2 (#115)
Browse files Browse the repository at this point in the history
- Fix Image Generation result local cache file path
  • Loading branch information
StephenHodgson authored Nov 8, 2023
1 parent 278b1b1 commit 5cd0f25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,15 @@ async Task DownloadAsync(ImageResult result)
await File.WriteAllBytesAsync(localFilePath, imageData, cancellationToken);
}

resultImagePath = $"file://{localFilePath}";
resultImagePath = localFilePath;
}
else
{
resultImagePath = result.Url;
}

await Awaiters.UnityMainThread;
var texture = await Rest.DownloadTextureAsync(resultImagePath, cancellationToken: cancellationToken);
var texture = await Rest.DownloadTextureAsync($"file://{resultImagePath}", cancellationToken: cancellationToken);

if (Rest.TryGetDownloadCacheItem(resultImagePath, out localFilePath))
{
Expand Down
2 changes: 1 addition & 1 deletion OpenAI/Packages/com.openai.unity/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.1.1",
"version": "5.1.2",
"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 5cd0f25

Please sign in to comment.