Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for GPT-4? #43

Open
gexijin opened this issue May 1, 2023 · 8 comments
Open

Support for GPT-4? #43

gexijin opened this issue May 1, 2023 · 8 comments

Comments

@gexijin
Copy link

gexijin commented May 1, 2023

Currently it does not seem to work for GPT-4 api.

@irudnyts
Copy link
Owner

irudnyts commented May 3, 2023

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).

@gexijin
Copy link
Author

gexijin commented May 3, 2023

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

@RoyalTS
Copy link

RoyalTS commented May 3, 2023

create_chat_completion() works perfectly well for me with model='gpt-4'.

@irudnyts
Copy link
Owner

@gexijin Have you been able to find the solution?

@gexijin
Copy link
Author

gexijin commented May 28, 2023

I haven't tried what @RoyalTS said. But as of now, I used httr to directly talk to OpenAI.

@jmouchnino
Copy link

jmouchnino commented Jun 5, 2023

create_chat_completion() works perfectly well for me with model='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”

@gexijin
Copy link
Author

gexijin commented Jun 6, 2023

@jmouchnino Among ChatGPT plus subscribers, very few have gpt-4 API access.

@irudnyts
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants