Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when submitting a prompt to chatgpt #108

Open
DeianGG opened this issue May 31, 2024 · 1 comment
Open

Error when submitting a prompt to chatgpt #108

DeianGG opened this issue May 31, 2024 · 1 comment

Comments

@DeianGG
Copy link

DeianGG commented May 31, 2024

I run the app using this code
library(chattr)
Sys.setenv("OPENAI_API_KEY" = "sk-........fV3D")
chattr_use("gpt4")
chattr_app()

and whenever I submit a prompt from the Viewer window on the right side i get this error
image

Listening on http://127.0.0.1:4438 Error: ! in callr subprocess. Caused by error in _**`abort(req_result)`: ! `message` must be a character vector, not a object.**_ --- Subprocess backtrace: 1. chattr::ch_submit(defaults = defaults, prompt = prompt, stream = stream, … 2. chattr:::ch_submit.ch_openai(defaults = defaults, prompt = prompt, stream = stream, … 3. chattr:::ch_openai_complete(prompt = prompt, defaults = defaults) 4. rlang::abort(req_result) 5. rlang:::validate_signal_args(message, class, call, .subclass, "abort") 6. rlang:::check_character(message, call = env) 7. rlang:::stop_input_type(x, "a character vector", ..., allow_na = FALSE, … 8. rlang::abort(message, ..., call = call, arg = arg) 9. \| rlang:::signal_abort(cnd, .file) 10. \| base::signalCondition(cnd) 11. global (function (e) … Warning: Error in observe: Streaming returned error 51: 50: signalCondition 49: signal_abort 48: abort 47: observe 46: 3: shiny::runApp 2: runGadget 1: chattr_app --   > | > >
@edgararuiz
Copy link
Collaborator

It looks like there could possibly be an empty message coming from OpenAI, can you try installing the dev version and trying again. There is an enhancement in the latest version that improves how it returns errors:

pak::pak("mlverse/chattr")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants