Closed 8veStory closed 8 months ago
how exactly did you do it? i tried to set the env variable the third option but it turns out it didn't work can you show me where did you write it?
I'm running into the same issue.
Had the same issue but noticed the docs mentioned:
Note that the api_key_cmd arguments are split by whitespace. If you need whitespace inside an argument (for example to reference a path with spaces), you can wrap it in a separate script.
So I changed the name of my stored credentials in 1password to remove spaces and this worked:
require("chatgpt").setup {
api_key_cmd = "op read op://Private/OpenAI_API_Key/password --no-newline",
}
Thanks @densefog, that worked for me too. I initially kept escaped double-quotes around that URI and it was still failing. People, make sure you remove double quotes and spaces.
please reopen if issue still exists in newest version
Ran into the same issue, removed spaces and everything worked!
Hi!
I'm on Windows 11 attempting to use the
api_key_cmd
with the Onepassword CLI like so:I have confirmed that running the command by itself gets the desired secret in both CMD and pwsh, however it appears I run into the following error anytime I try to use the plugin to contact OPENAI:
error.webm
Thing I have tried:
api_key_cmd = "cat secret.txt"
wheresecret.txt
contained my secret -> does not workIt appears that anything I try to do with
api_key_cmd
does not work, but directly setting theOPENAI_API_KEY
env does indeed work.