askgpt {askgpt} | R Documentation |
Ask openai's GPT models a question
Description
Ask openai's GPT models a question
Usage
askgpt(prompt, chat = TRUE, progress = TRUE, return_answer = FALSE, ...)
Arguments
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 |
Value
either an httr2 response from one of the APIs or a character vector (if return_answer).
Examples
## 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)
[Package askgpt version 0.1.3 Index]