jcrodriguez1989 / chatgpt

Interface to ChatGPT from R
GNU General Public License v3.0
311 stars 37 forks source link

No output #14

Closed mbjohnsonmn closed 1 year ago

mbjohnsonmn commented 1 year ago

Thanks for your work on this package. I've installed the addin to RStudio per the instructions. The addin menu and functions are availble, but I'm not getting any response back from chatGPT.

chatgpt_output

Any suggestions?

jcrodriguez1989 commented 1 year ago

Hi @mbjohnsonmn ! I received the same feedback from another {chatgpt} user, but I am not being able to reproduce this bug. Sometimes, ChatGPT has high demand and stops working. However, it is interesting that it doesn't even return a message in the API saying so. Could you try running the same function at different times of the day?

Also, could you try this code, and let me know if you get any further error messages (it is the backend code of how the package works)?

library("httr")
openai_api_key <- Sys.getenv("OPENAI_API_KEY")
prompt <- paste0(
  'Create a full testthat file, with test cases for the following R code: "squared_numbers <- function(numbers) {\n  numbers ^ 2\n}"'
)
params <- list(
  model = Sys.getenv("OPENAI_MODEL", "text-davinci-003"),
  max_tokens = as.numeric(Sys.getenv("OPENAI_MAX_TOKENS", 256)),
  temperature = as.numeric(Sys.getenv("OPENAI_TEMPERATURE", 0.7)),
  top_p = as.numeric(Sys.getenv("OPENAI_TOP_P", 1)),
  frequency_penalty = as.numeric(Sys.getenv("OPENAI_FREQUENCY_PENALTY", 0)),
  presence_penalty = as.numeric(Sys.getenv("OPENAI_PRESENCE_PENALTY", 0))
)
content(POST(
  "https://api.openai.com/v1/completions",
  add_headers("Authorization" = paste("Bearer", openai_api_key)),
  content_type_json(),
  body = jsonlite::toJSON(c(params, list(prompt = prompt)), auto_unbox = TRUE)
))

Best,

mbjohnsonmn commented 1 year ago

Thanks for this. Here is the result of the code above:

$error $error$message [1] "You exceeded your current quota, please check your plan and billing details."

$error$type [1] "insufficient_quota"

$error$param NULL

$error$code NULL

jcrodriguez1989 commented 1 year ago

Thank you very much!! I will be able to output error messages when happen :) So, it seems it is not returning output, because of issues with your chatgpt account.

mbjohnsonmn commented 1 year ago

Yes, so perhaps the takeaway is that use of the chatGPT API is not included in the free trial, but requires setting up a paid account?

On Thu, Mar 9, 2023 at 11:38 AM Juan C Rodriguez @.***> wrote:

Thank you very much!! I will be able to output error messages when happen :) So, it seems it is not returning output, because of issues with your chatgpt account.

— Reply to this email directly, view it on GitHub https://github.com/jcrodriguez1989/chatgpt/issues/14#issuecomment-1462480220, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC44IJ7IX5VLCMSKRUDBK4DW3IIP5ANCNFSM6AAAAAAVVMNQ6I . You are receiving this because you were mentioned.Message ID: @.***>

-- Morris Johnson *Global Partnerships *Strategic Innovations Consultant Wycliffe Bible Translators USA Arden Hills, MN 55112 LinkedIn https://www.linkedin.com/company/wycliffe-bible-translators/?viewAsMember=true wycliffe.org https://www2.wycliffe.org/e/26032/2019-03-19/7xsk6t/943822178?h=ASRPOP5WW4rQPDXrRiIleaqu8S-w6MG5ZzQlgnhdu2s

C: +1 651 324 5243

jcrodriguez1989 commented 1 year ago

Oh no, you can use any type of ChatGPT account. But it seems that your account reached the free tokens limit. I guess you are not able to use https://chat.openai.com/ either.

mbjohnsonmn commented 1 year ago

I was actually. I should’ve mentioned that as part of my troubleshooting I tried the same question on the website, and it returned an answer as expected.

On Thu, Mar 9, 2023 at 12:29 PM Juan C Rodriguez @.***> wrote:

Oh no, you can use any type of ChatGPT account. But it seems that your account reached the free tokens limit. I guess you are not able to use https://chat.openai.com/ either.

— Reply to this email directly, view it on GitHub https://github.com/jcrodriguez1989/chatgpt/issues/14#issuecomment-1462568790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC44IJ3ITR3GHZVASZGEGZLW3IOQPANCNFSM6AAAAAAVVMNQ6I . You are receiving this because you were mentioned.Message ID: @.***>

-- Morris Johnson *Global Partnerships *Strategic Innovations Consultant Wycliffe Bible Translators USA Arden Hills, MN 55112 LinkedIn https://www.linkedin.com/company/wycliffe-bible-translators/?viewAsMember=true wycliffe.org https://www2.wycliffe.org/e/26032/2019-03-19/7xsk6t/943822178?h=ASRPOP5WW4rQPDXrRiIleaqu8S-w6MG5ZzQlgnhdu2s

C: +1 651 324 5243

mbjohnsonmn commented 1 year ago

fyi, I was able to get the add in to work after setting up my DALL-E API account payment method.

On Thu, Mar 9, 2023 at 12:33 PM Johnson, Morris @.***> wrote:

I was actually. I should’ve mentioned that as part of my troubleshooting I tried the same question on the website, and it returned an answer as expected.

On Thu, Mar 9, 2023 at 12:29 PM Juan C Rodriguez @.***> wrote:

Oh no, you can use any type of ChatGPT account. But it seems that your account reached the free tokens limit. I guess you are not able to use https://chat.openai.com/ either.

— Reply to this email directly, view it on GitHub https://github.com/jcrodriguez1989/chatgpt/issues/14#issuecomment-1462568790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC44IJ3ITR3GHZVASZGEGZLW3IOQPANCNFSM6AAAAAAVVMNQ6I . You are receiving this because you were mentioned.Message ID: @.***>

-- Morris Johnson *Global Partnerships *Strategic Innovations Consultant Wycliffe Bible Translators USA Arden Hills, MN 55112 LinkedIn https://www.linkedin.com/company/wycliffe-bible-translators/?viewAsMember=true wycliffe.org https://www2.wycliffe.org/e/26032/2019-03-19/7xsk6t/943822178?h=ASRPOP5WW4rQPDXrRiIleaqu8S-w6MG5ZzQlgnhdu2s

C: +1 651 324 5243

-- Morris Johnson *Global Partnerships *Strategic Innovations Consultant Wycliffe Bible Translators USA Arden Hills, MN 55112 LinkedIn https://www.linkedin.com/company/wycliffe-bible-translators/?viewAsMember=true wycliffe.org https://www2.wycliffe.org/e/26032/2019-03-19/7xsk6t/943822178?h=ASRPOP5WW4rQPDXrRiIleaqu8S-w6MG5ZzQlgnhdu2s

C: +1 651 324 5243