samterfa / openai Goto Github PK
View Code? Open in Web Editor NEWThis R package provides an SDK to the Open AI API
License: Other
This R package provides an SDK to the Open AI API
License: Other
library(openai)
library(purrr)
library(magrittr)
library(dplyr)
list_models() %>% pluck('data') %>% map_dfr(compact)
Show in New Window
Error in namespaceExport(ns, exports) :
undefined exports: %has_args%, %has_attr%, %has_name%, on_failure<-, are_equal, assert_that, has_args, has_attr, has_extension, has_name, is.count, is.date, is.dir, is.error, is.flag, is.number, is.readable, is.scalar, is.string, is.time, is.writeable, noNA, not_empty, on_failure, see_if, validate_that
I get the following error, both as a dialog and on the shell.
Error in (function (prompt = rstudioapi::getConsoleEditorContext()$contents, :
list(message = "This model's maximum context length is 4097 tokens. However, you requested 4105 tokens (101 in the messages, 4004 in the completion). Please reduce the length of the messages or completion.", type = "invalid_request_error", param = "messages", code = "context_length_exceeded")
HI!
I am trying to use this very cool tool but get the following error when I try to add the addin.
Error in (function (prompt = rstudioapi::getConsoleEditorContext()$contents, :
list(message = "You exceeded your current quota, please check your plan and billing details.", type = "insufficient_quota", param = NULL, code = NULL)
When typing the prompt "Load mtcars data and create boxplot" in the console, I receive the following return:
Here's how to load the mtcars
data and create a basic boxplot of the mpg
variable using R:
Error: unexpected symbol in "load mtcars"
I am using R 4.2.3 with most recent version of R studio and Windows 11
list_models() %>%
pluck('data') %>%
map_dfr(compact)
Error in dplyr::bind_rows()
:
! Argument 1 must be a data frame or a named atomic vector.
Run rlang::last_trace()
to see where the error occurred.
Warning message:
Outer names are only allowed for unnamed scalar atomic inputs
chatgpt:::run_addin_ask_chatgpt()
Listening on http://127.0.0.1:3999
***** ChatGPT input:**
Please help:
list_models() %>%
pluck('data') %>%
map_dfr(compact)
Error in dplyr::bind_rows()
:
! Argument 1 must be a data frame or a named atomic vector.
Run rlang::last_trace()
to see where the error occurred.
Warning message:
Outer names are only allowed for unnamed scalar atomic inputs
***** ChatGPT output:**
This error is telling us that the object being passed to map_dfr()
is not a data frame or a named atomic vector. The issue could be with the compact()
function that is being used in map_dfr()
.
It's also possible that the data being passed to map_dfr()
is not in the correct format. It's hard to pinpoint the exact issue without knowing the details of list_models()
and compact()
.
You can try running rlang::last_trace()
to get more information about where the error occurred in your code. This may give you some clues as to what the issue might be.
MY SOLUTION:
DELETE " %>%
map_dfr(compact) "
Now it works.
Dear author,
Thanks a lot for your great tool!
May I have your guidance that how to make the add-in work? After library(openai), and then type # write some R code ..., no code is generated automatically, is it due to the addin content interactive: False?
Many thanks!
After following the installation and set-up steps (here), when I click on the XXX, I received this message:
Error in (function(prompt=rstudioapi::getConsoleEditorContext()$contents,:list(message = "You exceeded your current quota, please check your plan billing details", type = "insuficient_quota", param = NULL, code = NULL)
...
I was wondering if is mandatory to pay to use the API, is that the main problem?
Thanks!
Error in map_chr()
:
Caused by error in .x$text
:
! $ operator is invalid for atomic vectors
Run rlang::last_trace()
to see where the error occurred.
create_completion(
model = 'davinci',
max_tokens = 30,
temperature = .5,
top_p = 1,
n = 1,
stream = F,
prompt = 'Once upon a time') %>%
pluck('choices') %>%
map_chr(~ .x$text)
I have NO idea how to fix this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.