MichelNivard / gptstudio

GPT RStudio addins that enable GPT assisted coding, writing & analysis
https://michelnivard.github.io/gptstudio/
Other
906 stars 109 forks source link

Error in map: ℹ In index: 1. #199

Closed urban-m closed 6 months ago

urban-m commented 7 months ago

Confirm setup

What happened?

entering any text into the prompt throws the below error ... ("Argument hat Länge 0" is "argument has length 0 in English").

"comment your code" and "spelling and grammar" functions bring up a pop up window saying "error in req_perform(.)".

sorry. newbie to this, help greatly appreciated

Relevant log output

Warnung: Error in map: ℹ In index: 1.
Caused by error in `if (parsed_event$data == "[DONE]") ...`:
! Argument hat Länge 0
  99: <Anonymous>
  98: signalCondition
  97: signal_abort
  96: rlang::abort
  95: cli::cli_abort
  94: h
  93: .handleSimpleError
  92: .f
  88: map_
  87: map
  86: purrr::walk
  78: gptstudio_response_process
  76: observe
  75: <observer>
   4: shiny::runApp
   3: eval
   2: eval
   1: .rs.sourceWithProgress

Session info

gptstudio::gptstudio_sitrep()
#> 
#> ── Configuration for gptstudio ─────────────────────────────────────────────────
#> No user configuration file found at
#> 'C:\Users\matth\AppData\Roaming/R/config/R/gptstudio/config.yml'. Using default
#> configuration. Change configuration settings in the chat app. Lauch the chat
#> app with addins or `gptstudio_chat()`.
#> 
#> ── Current Settings ──
#> 
#> - Model: gpt-4-turbo-preview
#> - Task: coding
#> - Language: en
#> - Service: openai
#> - Custom prompt:
#> - Stream: TRUE
#> - Code style: no preference
#> - Skill: beginner
#> 
#> ── Checking API connections ──
#> 
#> ── Checking OpenAI API connection
#> ✔ Successfully connected to the OpenAI API service.
#> 
#> ── Checking HuggingFace API connection
#> ✖ API key is not set or invalid for HuggingFace service.
#> 
#> ── Checking Anthropic API connection
#> ✖ API key is not set or invalid for Anthropic service.
#> 
#> ── Checking Google AI Studio API connection
#> ✖ API key is not set or invalid for Google AI Studio service.
#> 
#> ── Checking Azure OpenAI API connection
#> ✖ API key is not set or invalid for Azure OpenAI service.
#> 
#> ── Checking Perplexity API connection
#> ✖ API key is not set or invalid for Perplexity service.
#> 
#> ── Checking Cohere API connection
#> ✖ API key is not set or invalid for Cohere service.
#> 
#> ── Check Ollama for Local API connection
#> ✖ Couldn't connect to Ollama in <http://localhost:11434>. Is it running there?
#> 
#> ── Getting help ──
#> 
#> See the gptstudio homepage (<https://michelnivard.github.io/gptstudio/>) for
#> getting started guides and package documentation. File an issue or contribute
#> to the package at the GitHub repo
#> (<https://github.com/MichelNivard/gptstudio>).
#> ── End of gptstudio configuration ──────────────────────────────────────────────

Code of Conduct

calderonsamuel commented 7 months ago

Thank you for your report. Please provide the following info:

Which addin is giving the problem?

If possible, share the input you give and how you interacted with the addin

Paste the output of: reprex::reprex(sessioninfo::session_info("gptstudio")). This will tell us the version you are running

urban-m commented 7 months ago

Thank you Samuel for your reply.

The issue arises when starting a chat using the gptstudio addin. The interface appears, but upon entering any prompt it disappears and the above error message is thrown. When klicking the "spelling and grammar" and "comment your code" the below error message appears

Screenshot 2024-04-18 114412

this is the session info sessioninfo::session_info("gptstudio")

> ─ Session info ───────────────────────────────────────────────────────────────

> setting value

> version R version 4.3.2 (2023-10-31 ucrt)

> os Windows 11 x64 (build 22631)

> system x86_64, mingw32

> ui RTerm

> language (EN)

> collate German_Germany.utf8

> ctype German_Germany.utf8

> tz Europe/Berlin

> date 2024-04-18

> pandoc 3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)

>

> ─ Packages ───────────────────────────────────────────────────────────────────

> package * version date (UTC) lib source

> askpass 1.2.0 2023-09-03 [1] CRAN (R 4.3.2)

> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.3.2)

> base64enc 0.1-3 2015-07-28 [1] CRAN (R 4.3.1)

> bslib 0.7.0 2024-03-29 [1] CRAN (R 4.3.3)

> cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.2)

> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.2)

> colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.2)

> commonmark 1.9.1 2024-01-30 [1] CRAN (R 4.3.3)

> crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.2)

> curl 5.2.0 2023-12-08 [1] CRAN (R 4.3.2)

> digest 0.6.33 2023-07-07 [1] CRAN (R 4.3.2)

> evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.2)

> fansi 1.0.6 2023-12-08 [1] CRAN (R 4.3.2)

> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.2)

> fontawesome 0.5.2 2023-08-19 [1] CRAN (R 4.3.2)

> fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.2)

> glue 1.6.2 2022-02-24 [1] CRAN (R 4.3.2)

> gptstudio 0.3.1.9009 2024-04-17 [1] Github (MichelNivard/gptstudio@55dea07)

> highr 0.10 2022-12-22 [1] CRAN (R 4.3.2)

> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.3.3)

> htmlwidgets 1.6.4 2023-12-06 [1] CRAN (R 4.3.2)

> httpuv 1.6.14 2024-01-26 [1] CRAN (R 4.3.3)

> httr 1.4.7 2023-08-15 [1] CRAN (R 4.3.2)

> httr2 1.0.1 2024-04-01 [1] CRAN (R 4.3.3)

> ids 1.0.1 2017-05-31 [1] CRAN (R 4.3.2)

> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.3.2)

> jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.3.2)

> knitr 1.46 2024-04-06 [1] CRAN (R 4.3.3)

> later 1.3.2 2023-12-06 [1] CRAN (R 4.3.2)

> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.2)

> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.2)

> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.2)

> mime 0.12 2021-09-28 [1] CRAN (R 4.3.1)

> openssl 2.1.1 2023-09-25 [1] CRAN (R 4.3.2)

> pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.2)

> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.2)

> promises 1.2.1 2023-08-10 [1] CRAN (R 4.3.2)

> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.2)

> R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.2)

> rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.3.2)

> Rcpp 1.0.11 2023-07-06 [1] CRAN (R 4.3.2)

> rlang 1.1.2 2023-11-04 [1] CRAN (R 4.3.2)

> rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.2)

> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.2)

> rvest 1.0.3 2022-08-19 [1] CRAN (R 4.3.2)

> sass 0.4.9 2024-03-15 [1] CRAN (R 4.3.3)

> selectr 0.4-2 2019-11-20 [1] CRAN (R 4.3.2)

> shiny 1.8.1 2024-03-26 [1] CRAN (R 4.3.3)

> shiny.i18n 0.3.0 2023-01-16 [1] CRAN (R 4.3.3)

> sourcetools 0.1.7-1 2023-02-01 [1] CRAN (R 4.3.3)

> SSEparser 0.1.0 2023-12-14 [1] CRAN (R 4.3.3)

> stringi 1.8.3 2023-12-11 [1] CRAN (R 4.3.2)

> stringr 1.5.1 2023-11-14 [1] CRAN (R 4.3.2)

> sys 3.4.2 2023-05-23 [1] CRAN (R 4.3.2)

> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.2)

> tinytex 0.49 2023-11-22 [1] CRAN (R 4.3.2)

> utf8 1.2.4 2023-10-22 [1] CRAN (R 4.3.2)

> uuid 1.1-1 2023-08-17 [1] CRAN (R 4.3.1)

> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.2)

> waiter 0.2.5 2022-01-03 [1] CRAN (R 4.3.3)

> withr 2.5.2 2023-10-30 [1] CRAN (R 4.3.2)

> xfun 0.43 2024-03-25 [1] CRAN (R 4.3.3)

> xml2 1.3.6 2023-12-04 [1] CRAN (R 4.3.2)

> xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.3)

> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.2)

>

─────────────────────────────────────────────

calderonsamuel commented 6 months ago

Hi, there are two problems here.

  1. The "! Argument hat Länge 0" is caused by the way we paste together the streaming text received from OpenAI. This happens a bit randomly, so it is a bit hard to test, but can be fixed.
  2. Your sessioninfo output makes me think that you are trying to run Rstudio addins (comment your code, spelling and grammar) without using Rstudio. As far as I know, this is not possible.
urban-m commented 6 months ago

Hi Samuel,

thanks! I'm definitely in Rstudio. :)

grafik