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

Build for Oculus Quest 3 not giving a response from OpenAI #131

Open
Nixer087 opened this issue Aug 8, 2024 · 11 comments
Open

Build for Oculus Quest 3 not giving a response from OpenAI #131

Nixer087 opened this issue Aug 8, 2024 · 11 comments

Comments

@Nixer087
Copy link

Nixer087 commented Aug 8, 2024

Hey,

I encountered an issue that only shows in my build, everything works fine in unity but in the build the messages are not getting through nothing is being displayed as a text so I am asuming that also the AWS just does not work because of this, however my animation is being triggered.

I building for Android for the Quest 2/3 as my game is in augmented reality.

normally a message should appear and the sound clip from AWS should play, which again, works fine inside of unity but not in the build.

does anybody know what the issue could be here? is it a permission issue?

issue.mp4
@srcnalt
Copy link
Owner

srcnalt commented Aug 8, 2024

Hi @Nixer087 could you check project settings to see if internet is allowed?

@Nixer087
Copy link
Author

Nixer087 commented Aug 8, 2024

it is set on auto
image (1)

@Nixer087
Copy link
Author

Nixer087 commented Aug 8, 2024

I'm also not seeing it in my xr Plug-in manager

image

@srcnalt
Copy link
Owner

srcnalt commented Aug 8, 2024

Can you make internet always and try?

@Nixer087
Copy link
Author

Nixer087 commented Aug 8, 2024

I changed the setting to internet required and built it, and still no luck I'm afraid.
image

@srcnalt
Copy link
Owner

srcnalt commented Aug 8, 2024

Can you debug it via logcat? See if there are any error messages?

@Nixer087
Copy link
Author

Nixer087 commented Aug 9, 2024

Iquickly tested it and it sais I do not have an API key 
You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.

though it is in the script but not in a separate script, I put it in the ChatGPT script

@srcnalt
Copy link
Owner

srcnalt commented Aug 9, 2024

So did it work at the end? You should put it in there like this:
var openai = new OpenAIApi("sk-Me8...6yi");

@Nixer087
Copy link
Author

Nixer087 commented Aug 9, 2024

I am unable to test it until the 20th. But I think it will probably do the trick, I also had to change the manifest for it to allow internet and read and write locally .I will let you know as soon as It is fixed.

@markkuope
Copy link

I had the same problem with Quest 3 glasses. I,m building an educational game with my students where player can practise different educational skills by talking with avatars in a friendly environment. My students found out that this is a datatype -error.

When we added one line of code to Datatypes.sc OPenAI started responding again. Here is our solution:

public string? refusal { get; set; }

This line must be in the ChatMessage function like this:

public struct ChatMessage
{
public string Role { get; set; }
public string Content { get; set; }
public string? refusal { get; set; }
}

and the Datatypes -script can be found in

Packages/OpenAI Unity/Runtime

We hope this helps :)

@Nixer087
Copy link
Author

so to conclude, I did put the OpenAIApi Keys in the code in the end as it was still in a Json file outside my build.
So adding it to the dit OpenAIApi script the trick! Here is where I put it:

    public Configuration(string apiKey = null, string organization = null)
    {
        if (apiKey == null)
        {
            Auth = new Auth()
            {
                ApiKey = "sk******gn7",
                Organization = "org-m***f"
            };

Thanks for your help!^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants