openai
openai copied to clipboard
Support for GPT-4?
Currently it does not seem to work for GPT-4 api.
Can you please verify that you have access to GPT-4? It seems that the model is in beta and only limited access is provided (see https://platform.openai.com/docs/models/gpt-4).
Yes, I can confirm. But you do not need to have gpt-4 to try that. You can test on ChatGPT (gpt-3.5-turbo).
It seems that OpenAI has two types of models, completion models (text-davinci-003) and Chat models (gpt-3.5-turbo, gpt-4). The API URL and syntax are different between these two. Your package seems to work well with completion models. But not chat models. https://platform.openai.com/docs/models/model-endpoint-compatibility
create_chat_completion()
works perfectly well for me with model='gpt-4'
.
@gexijin Have you been able to find the solution?
I haven't tried what @RoyalTS said. But as of now, I used httr to directly talk to OpenAI.
create_chat_completion()
works perfectly well for me withmodel='gpt-4'
.
It doesn't work for me and I have a ChatGPT plus subscription.
Error in match.arg(model) :
'arg' should be one of “gpt-3.5-turbo”, “gpt-3.5-turbo-0301”
@jmouchnino Among ChatGPT plus subscribers, very few have gpt-4 API access.
@jmouchnino @gexijin well, the thing is I do not event have match.arg(model)
line in my code.
Anyways, I am developing a new version, to be in line with OpenAI. You can install it via remotes::install_github("irudnyts/openai", ref = "r6")
and play around like that:
library(openai)
client <- OpenAI()
completion <- client$chat$completions$create(
model = "gpt-4-1106-preview",
messages = list(list("role" = "user", "content" = "What's up?"))
)
completion$choices[[1]]$message$content
Please let me know if it does not work.