#OpenAI-Unity build to iPhone?

5 messages · Page 1 of 1 (latest)

grim canopy
#

I am using this package: https://github.com/srcnalt/OpenAI-Unity/

It works great in Unity but when I build to iOS and run it in Xcode or my iPhone I can send text but I never get any response. I'm super new to all this, any tips on how to troubleshoot?

GitHub

An unofficial OpenAI Unity Package that aims to help you use OpenAI API directly in Unity Game engine. - GitHub - srcnalt/OpenAI-Unity: An unofficial OpenAI Unity Package that aims to help you use ...

grim canopy
#

On second thought, issue is probably that the path to the json file containing the API key gets broken upon building to my phone.

grim canopy
#

Did a quick test pasting API key directly into config file, still doesn't work after building to phone. 😦

tawny harness
#

What exactly doesn't work? Are you getting an error when you try to make a request to the API?

grim canopy
# tawny harness What exactly doesn't work? Are you getting an error when you try to make a reque...

The API call goes through, I see the usage numbers go up with my iOS tests. But it just never returns any completion response. The issue seems to be with await openai.CreateCompletion since none of the debug.log stuff I put after that function call shows up in Xcode's output

There is this error but not sure how to tackle it:
ExecutionEngineException: Attempting to call method 'System.Collections.Generic.List`1[[OpenAI.Choice, OpenAI.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::.cctor' for which no ahead of time (AOT) code was generated.