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

Buffer for OpenAI API Key is not big enough (AEGHB-969) #181

Open
3 tasks done
alikian opened this issue Jan 30, 2025 · 5 comments
Open
3 tasks done

Buffer for OpenAI API Key is not big enough (AEGHB-969) #181

alikian opened this issue Jan 30, 2025 · 5 comments

Comments

@alikian
Copy link

alikian commented Jan 30, 2025

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

The Api Key Size buffer define in ChatGPT demo is 64 bytes while OpenAI API Key is well over 160 byes
#define KEY_SIZE 64

Suggest to increase it to 256

Actual behavior (suspected bug)

When testing ChatGPT demo this message appears
"code": invalid_api_key!

Error logs or terminal output

app_main: start_openai(91): [audioTranscription]: invalid response

Steps to reproduce the behavior

  • Upload chatgpt demo to esp32 s3 box
  • put value in config.ini include wifi ssid/password and OpenAI API Key
  • reboot, you will see
    "code": invalid_api_key!

Project release version

latest

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

MacOS

Operating system version

MacOS

Shell

Bash

Additional context

No response

@github-actions github-actions bot changed the title Buffer for OpenAI API Key is not big enough Buffer for OpenAI API Key is not big enough (AEGHB-969) Jan 30, 2025
@espressif2022
Copy link
Collaborator

I calculated it, it should be 51 bytes, why you will get 160 byes?

@alikian
Copy link
Author

alikian commented Feb 9, 2025

They changed the key size, please test it your self try to get a new project API key or user API Key

  • User API Key now is 96 characters
  • Admin API Key is 134 characters
  • Project API Key is 164 characters

@espressif2022
Copy link
Collaborator

They changed the key size, please test it your self try to get a new project API key or user API Key

  • User API Key now is 96 characters
  • Admin API Key is 134 characters
  • Project API Key is 164 characters

I tried it, you are right, I will modify the corresponding component immediately, thanks.

@alikian
Copy link
Author

alikian commented Feb 23, 2025

Just, follow up did you apply changes, thanks

@espressif2022
Copy link
Collaborator

Just, follow up did you apply changes, thanks

I also increased the key length in the commit of the github workflow action. Please confirm. Thank you very much.

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

2 participants