irudnyts / openai

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

A bug in create_chat_completion() #34

Open zhaohongxin0 opened 1 year ago

zhaohongxin0 commented 1 year ago

I am not sure wether it is a bug or not: When using: response <- create_chat_completion( model = "gpt-3.5-turbo", ......

we set the model to "gpt-3.5-turbo", but when we see the results:

response $id [1] "chatcmpl-6tat7xkifZsnPUi3t1C0SePRpZQ6A"

$object [1] "chat.completion"

$created [1] 1678707857

$model [1] "gpt-3.5-turbo-0301"

Here it shows the model "gpt-3.5-turbo-0301"

I am not sure if it is correct.

irudnyts commented 1 year ago

@zhaohongxin0 Thanks for that. Well, it seems the problem is on the OpenAI end. I tested this code on the official Python package, and it returns gpt-3.5-turbo-0301, even if gpt-3.5-turbo specified:

import openai

openai.api_key = "XXX"

completion = openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "user", "content": "Hello!"}
  ]
)

print(completion["model"])

If I understand correctly from this, gpt-3.5-turbo-0301 is just a particular version of gpt-3.5-turbo, and currently, they coincide.

If this is a big deal, I suggest asking around here.

irudnyts commented 1 year ago

@zhaohongxin0 Haha, well, today we have so many more models for chat endpoint.