Skip to content

get OPENAI_API_KEY from source other than os.getenv #55

Answered by Robitx
Dronakurl asked this question in Q&A
Discussion options

You must be logged in to vote

@Dronakurl hey, try to strip the white spaces like a newline from the key

	API_KEY = handle:read("*a"):match("%S+")

You might miss those using simple print =>

print("API_KEY: " .. vim.inspect(API_KEY))

Also thanks, I forgot to wrap new error/warn/info messages (which use nvim_echo) into vim.schedule (that's why you saw E5560 instead of what actually happened). Fixed in the latest version.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Robitx
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants