View source: R/api_completions.R
completions_fetch_text | R Documentation |
Fetch completions text from response content (completions_request) as dialog data.frame
completions_fetch_text(res_content, role = "ai", ltrim = TRUE)
res_content |
response object returned by completions_request |
role |
string, dialog role (phrase owner) |
ltrim |
flag, trim left white space character(s) from text |
dialog data.frame
## Not run:
prompt <- "x=1, y=2, z=x*y, z=?"
res_content <- completions_request(
model = "text-davinci-003",
prompt = prompt
)
if (!is_error(res_content)) {
answer <- completions_fetch_text(res_content)
print(answer)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.