Skip to content

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

Open

Description

@Nixer087

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

Activity

  1. srcnalt commented on Aug 8, 2024

    @srcnalt
    Owner

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

  2. Nixer087 commented on Aug 8, 2024

    @Nixer087
    Author

    it is set on auto
    image (1)

  3. Nixer087 commented on Aug 8, 2024

    @Nixer087
    Author

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

    image
  4. srcnalt commented on Aug 8, 2024

    @srcnalt
    Owner

    Can you make internet always and try?

  5. Nixer087 commented on Aug 8, 2024

    @Nixer087
    Author

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

  6. srcnalt commented on Aug 8, 2024

    @srcnalt
    Owner

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

  7. Nixer087 commented on Aug 9, 2024

    @Nixer087
    Author

    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

  8. srcnalt commented on Aug 9, 2024

    @srcnalt
    Owner

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

  9. Nixer087 commented on Aug 9, 2024

    @Nixer087
    Author

    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.

  10. markkuope commented on Aug 14, 2024

    @markkuope

    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 :)

  11. Nixer087 commented on Aug 24, 2024

    @Nixer087
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions