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

My image request from openai package requests to localhost instead of file #91

Open
whynames opened this issue Jan 2, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@whynames
Copy link

whynames commented Jan 2, 2025

Bug Report

Overview

My image request from openai package requests to localhost instead of file

To Reproduce

Steps to reproduce the behavior:

  1. Go to '.Unity, open example scene of openai package'
  2. Click on '. start play, and ask for a image'
RestException: [GET:0] https://localhost/var/folders/mj/x160r3tj0mj76hhlqhmkh11r0000gn/T/DefaultCompany/PathfindingTut/download_cache/07c73bc9-7975-060f-c4d2-5227fcaeedfb Failed!
{
  "request": {
    "url": "https://localhost/var/folders/mj/x160r3tj0mj76hhlqhmkh11r0000gn/T/DefaultCompany/PathfindingTut/download_cache/07c73bc9-7975-060f-c4d2-5227fcaeedfb"
  },
  "response": {
    "code": 0,
    "headers": {
      "Invalid Headers": "Invalid Headers"
    },
    "error": "Cannot connect to destination host\n"
  }
}
Utilities.WebRequestRest.Rest.Validate (Utilities.WebRequestRest.Response response, System.Boolean debug, System.String methodName) (at ./Library/PackageCache/com.utilities.rest/Runtime/Rest.cs:1463)
Utilities.WebRequestRest.Rest.DownloadTextureAsync (System.String url, System.String fileName, Utilities.WebRequestRest.RestParameters parameters, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.utilities.rest/Runtime/Rest.cs:651)
OpenAI.Images.ImagesEndpoint+<>c__DisplayClass8_0.<DeserializeResponseAsync>g__DownloadAsync|0 (OpenAI.Images.ImageResult result) (at ./Library/PackageCache/com.openai.unity/Runtime/Images/ImagesEndpoint.cs:152)
OpenAI.Images.ImagesEndpoint.DeserializeResponseAsync (Utilities.WebRequestRest.Response response, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.openai.unity/Runtime/Images/ImagesEndpoint.cs:171)
OpenAI.Images.ImagesEndpoint.GenerateImageAsync (OpenAI.Images.ImageGenerationRequest request, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.openai.unity/Runtime/Images/ImagesEndpoint.cs:42)
OpenAI.Function.InvokeInternalAsync[T] (OpenAI.Function function, System.Object[] invokeArgs) (at ./Library/PackageCache/com.openai.unity/Runtime/Common/Function.cs:450)
OpenAI.Function.InvokeAsync[T] (System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.openai.unity/Runtime/Common/Function.cs:422)
UnityEngine.Debug:LogException(Exception)
OpenAI.<InvokeAsync>d__59`1:MoveNext() (at ./Library/PackageCache/com.openai.unity/Runtime/Common/Function.cs:426)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException(Exception)
OpenAI.<InvokeInternalAsync>d__61`1:MoveNext() (at ./Library/PackageCache/com.openai.unity/Runtime/Common/Function.cs:454)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException(Exception)
OpenAI.Images.<GenerateImageAsync>d__5:MoveNext() (at ./Library/PackageCache/com.openai.unity/Runtime/Images/ImagesEndpoint.cs:42)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException(Exception)
OpenAI.Images.<DeserializeResponseAsync>d__8:MoveNext() (at ./Library/PackageCache/com.openai.unity/Runtime/Images/ImagesEndpoint.cs:172)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetException(Exception)
OpenAI.Images.<<DeserializeResponseAsync>g__DownloadAsync|0>d:MoveNext() (at ./Library/PackageCache/com.openai.unity/Runtime/Images/ImagesEndpoint.cs:168)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException(Exception)
Utilities.WebRequestRest.<DownloadTextureAsync>d__47:MoveNext() (at ./Library/PackageCache/com.utilities.rest/Runtime/Rest.cs:671)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(Response)
Utilities.WebRequestRest.<SendAsync>d__53:MoveNext() (at ./Library/PackageCache/com.utilities.rest/Runtime/Rest.cs:1108)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(Response)
Utilities.WebRequestRest.<SendAsync>d__56:MoveNext() (at ./Library/PackageCache/com.utilities.rest/Runtime/Rest.cs:1450)
UnityEngine.Awaitable:RunContinuation() (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/Awaitable.Bindings.cs:49) 

Expected behavior

It should look for file:// as start of the url

Screenshots

Image There are many debug lines that I placed inside public bool TryGetDownloadCacheItem(string uri, out string filePath) function, as you see none of them starts with file://, maybe something related to this

Additional context

Also discussed in
RageAgainstThePixel/com.openai.unity#319

@whynames whynames added the bug Something isn't working label Jan 2, 2025
@StephenHodgson StephenHodgson self-assigned this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants