irudnyts / openai

An R package-wrapper around OpenAI API
https://irudnyts.github.io/openai/
Other
164 stars 28 forks source link

Update for `gpt-3.5-turbo` #37

Closed cbail closed 1 year ago

cbail commented 1 year ago

Hi- thanks so much for the package. It seems like one of the URLs called in the create_completion() function may need to be updated for gpt-3.5-turbo. When I request it as a model option, I get the following error message:

`Error: OpenAI API request failed [404]:

This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?`

If you have the bandwidth to take this on, I'd be very grateful!

irudnyts commented 1 year ago

Hi @cbail, thanks for the question. There exists a stand-alone function for this: create_chat_completion(). Does that help?

cbail commented 1 year ago

Ah so sorry I should have found this by myself. Thanks for this great package!