This function creates a virtual environment and installs the openai
package in it.
Usage
setup_py(venv_name = "r-gpt-venv", ask = interactive())
Examples
if (FALSE) {
library(gpteasyr)
setup_py()
prompt <- compose_prompt_api(
sys_prompt = "You are the assistant of a university professor.",
usr_prompt = "Tell me about the last course you provided."
)
res <- query_gpt(
prompt = prompt,
use_py = TRUE
) |>
get_content()
cat(res)
}