askgpt | R Documentation |
Ask openai's GPT models a question
askgpt(prompt, chat = TRUE, progress = TRUE, return_answer = FALSE, ...)
prompt |
What you want to ask |
chat |
whether to use the chat API (i.e., the same model as ChatGPT) or the completions API. |
progress |
Show a progress spinner while the request to the API has not been fulfilled. |
return_answer |
Should the answer be returned as an object instead of printing it to the screen? |
... |
additional options forwarded to |
either an httr2 response from one of the APIs or a character vector (if return_answer).
## Not run:
askgpt("What is an R function?")
askgpt("What is wrong with my last command?")
askgpt("Can you help me with the function aes() from ggplot2?")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.