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

AI-Story Failing Error 401 #7

Closed
dKatsuro opened this issue Jul 14, 2022 · 6 comments
Closed

AI-Story Failing Error 401 #7

dKatsuro opened this issue Jul 14, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@dKatsuro
Copy link

Have the bot deployed via Docker.
OpenAI key is valid and functioning tested by sending a request to https://api.openai.com/v1/models with my API key in the header and it did return the list of available models so that seems to be working fine.

I did slap the tokens into the docker-compose file but that hasn't been an issue for me for the required bot tokens.
Tried with and without quotation marks for the OpenAI token.

  args:  
   - DISCORD_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  
   - DISCORD_BOTID=111111111111111111  
   - OPEN_AI_TOKEN=xx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

When sending the story request I get the following error in Discord:
Could not process prompt due to internal error (Request failed with status code 401)

Of course, the Docker log also reports:
2022-07-14 06:45:05 : Generating story with headline a storm is brewing based on text-davinci-002 model
2022-07-14 06:45:06 : Request failed with status code 401

@karafra
Copy link
Owner

karafra commented Jul 14, 2022

Hi. Sorry, I was quite bussy lately with migrating to nestjs framework so I didn't notice this issue sooner.

401 should mean your token for openAI is bad. Could you check usage charts on openAi/did you copy it correctly?

If so, I will look into it. There is high likehood of something screwing with token formating. I am planning nestjs release for tonight, so I will inform you if I found same problem there.

@karafra karafra added the bug Something isn't working label Jul 14, 2022
@karafra karafra pinned this issue Jul 14, 2022
@karafra karafra self-assigned this Jul 14, 2022
@dKatsuro
Copy link
Author

My API key works I have tested it - the wrong (old key) is currently being used.

This is an error on my behalf. Maybe I had attempted to set the variable via $Env (I'm running Windows) at one point in time but I can't seem to change it as I can confirm the key in there was a key I have had at one point in time. Doesn't matter if I change the environment value via the docker-compose file it seems to use the invalid key wherever it's stored and I'm not sure how to resolve this.

@karafra
Copy link
Owner

karafra commented Jul 17, 2022

Heyy, so I was testing it right now (using linux), error is not repeating for me. Installing windows vm to take a look at it in your environment. 👍🏼

@karafra
Copy link
Owner

karafra commented Jul 17, 2022

Sorry, i cant reproduce this issue 😢

@karafra karafra closed this as completed Jul 17, 2022
@karafra karafra reopened this Jul 17, 2022
@karafra
Copy link
Owner

karafra commented Jul 18, 2022

Heyyy, so I finally managed to put together 2.0.0 release, this one includes custom configuration loader with environment variable transposition. Could you please try if it solves your problem?

@karafra
Copy link
Owner

karafra commented Jul 18, 2022

Could not reproduce, no further feedback given

@karafra karafra closed this as completed Jul 18, 2022
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