irudnyts / openai

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

[RStudio] Got an error message each time I try to use code autocomplete on openai library #53

Closed tokumotion closed 8 months ago

tokumotion commented 8 months ago

This is the error I get

Error in fetch(key) : lazy-load database '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/openai/help/openai.rdb' is corrupt

You can see the screenshot also. I removed and reinstalled the library a couple of time, but this keeps happening.

Screenshot 2023-12-13 at 19 11 40

Thanks

irudnyts commented 8 months ago

@tokumotion thanks for that. Hmm, what I would suggest is to give it a try and installing the dev version of the package:

remotes::install_github("irudnyts/openai", ref = "r6")

And then, you can use it as:

library(openai)
client <- OpenAI()
completion <- client$chat$completions$create(
    model = "gpt-3.5-turbo",
    messages = list(list("role" = "user", "content" = "What's up?"))
)

For the image, I will try (no commitments) do it this weekend :)

irudnyts commented 8 months ago

Please, let me know if it worked with the dev version.

tokumotion commented 8 months ago

@tokumotion thanks for that. Hmm, what I would suggest is to give it a try and installing the dev version of the package:

remotes::install_github("irudnyts/openai", ref = "r6")

And then, you can use it as:

library(openai)
client <- OpenAI()
completion <- client$chat$completions$create(
    model = "gpt-3.5-turbo",
    messages = list(list("role" = "user", "content" = "What's up?"))
)

For the image, I will try (no commitments) do it this weekend :)

Hi @irudnyts, just removed the last version of the library (which was working fine, only had that annoying error message) and reinstalled it as per your suggestion and I'm not seeing that error again, thanks!

I'll close this :)