Open csterbenz1 opened 7 months ago
Hi @csterbenz1, I totally agree! @openai should start contributing to this package and keep "everything up to date and ported over" 😂
Jokes aside, here is the feature you were looking for in the development version (do not forget to install it first):
remotes::install_github("irudnyts/openai", ref = "r6")
library(openai)
client <- OpenAI()
completion <- client$chat$completions$create(
model = "gpt-3.5-turbo",
messages = list(list("role" = "user", "content" = "What's up?")),
logprobs = TRUE,
top_logprobs = 2
)
completion$choices[[1]]$logprobs
API was recently updated to return logprobs for chat completions but the change appears to be only present in the python version and not the R version. Would really appreciate everything up to date and ported over!