I've been trying to use the chatgpt package to learn more about chat gpt. I think I don't understand how to pass in my api key. After installing the package and library(chatgpt) I gave the command
explain_code("a <- 1;a=1")
and for told
Error in gpt_get_completions(prompt) : `OPENAI_API_KEY` not provided.
So I'm not sure how to pass in the OPENAI_API_KEY. When I tried using the function gpt_get_completions() I get told "could not find function "gpt_get_completions"
I'm sure this is user error on my end. Any guidance appreciated.
Just to follow-up. I fed a 200 line program into chatgpt through find_issues_in_code(). Some of the reports back were shockingly insightful. Others were just plain wrong, like saying a loop was missing a closing bracket when it wasn't.