From b7455e4a29ade16b1fef179ed2454e44f9da7fa4 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 8 Nov 2023 16:11:24 -0500 Subject: [PATCH] com.openai.unity 5.1.2 (#115) - Fix Image Generation result local cache file path --- Runtime/Images/ImagesEndpoint.cs | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Runtime/Images/ImagesEndpoint.cs b/Runtime/Images/ImagesEndpoint.cs index d2d83e91..5569d7e4 100644 --- a/Runtime/Images/ImagesEndpoint.cs +++ b/Runtime/Images/ImagesEndpoint.cs @@ -319,7 +319,7 @@ async Task DownloadAsync(ImageResult result) await File.WriteAllBytesAsync(localFilePath, imageData, cancellationToken); } - resultImagePath = $"file://{localFilePath}"; + resultImagePath = localFilePath; } else { @@ -327,7 +327,7 @@ async Task DownloadAsync(ImageResult result) } 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)) { diff --git a/package.json b/package.json index ced7ccfc..2cde6a8c 100644 --- a/package.json +++ b/package.json @@ -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",