MichelNivard / gptstudio

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

[Bug]: Unable to run on Ubuntu 22.04 #229

Open agiardina opened 1 month ago

agiardina commented 1 month ago

Confirm setup

What happened?

When I try to run the chat adding I get the following error in the console:

Error in req_perform(): ! Failed to perform HTTP request. Caused by error in curl::curl_fetch_memory(): ! Failed to connect to 127.0.0.1 port 7636 after 0 ms: Connection refused

The rlang::last_trace() gives this output:

Backtrace: ▆

  1. └─gptstudio:::gptstudio_chat()
  2. └─gptstudio:::open_app_in_viewer(host, port)
  3. └─gptstudio:::wait_for_bg_app(translated_url)
  4. └─httr2::req_perform(...)
  5. └─base::tryCatch(...)
  6. └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  7. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8. └─value[3L]

The gptstudio::gptstudio_sitrep() command returns:

── Current Settings ──

── 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?

Thank you.

Relevant log output

No response

Session info

No response

Code of Conduct

calderonsamuel commented 1 month ago

Thank you for reporting, we will need the full output of reprex::reprex(gptstudio::gptstudio_sitrep(), session_info = TRUE). Running it should automatically copy the output to your clipboard

agiardina commented 1 month ago
gptstudio::gptstudio_sitrep()
#> 
#> ── Configuration for gptstudio ─────────────────────────────────────────────────
#> No user configuration file found at
#> '/home/agiardina/.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-4o
#> - 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 ──────────────────────────────────────────────

Created on 2024-09-28 with reprex v2.1.1

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.4.1 (2024-06-14) #> os TUXEDO OS 3 #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz Europe/Rome #> date 2024-09-28 #> pandoc 3.2 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/x86_64/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> cli 3.6.3 2024-06-21 [1] CRAN (R 4.4.1) #> crayon 1.5.3 2024-06-20 [1] CRAN (R 4.4.1) #> curl 5.2.3 2024-09-20 [1] CRAN (R 4.4.1) #> digest 0.6.37 2024-08-19 [1] CRAN (R 4.4.1) #> ellipsis 0.3.2 2021-04-29 [3] CRAN (R 4.1.1) #> evaluate 1.0.0 2024-09-17 [1] CRAN (R 4.4.1) #> fansi 1.0.2 2022-01-14 [3] CRAN (R 4.1.2) #> fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.4.1) #> fs 1.6.4 2024-04-25 [1] CRAN (R 4.4.1) #> glue 1.7.0 2024-01-09 [1] CRAN (R 4.4.1) #> gptstudio 0.4.0.9007 2024-09-27 [1] Github (MichelNivard/gptstudio@dfc8b43) #> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.4.1) #> htmlwidgets 1.6.4 2023-12-06 [1] CRAN (R 4.4.1) #> httpuv 1.6.15 2024-03-26 [1] CRAN (R 4.4.1) #> httr2 1.0.5 2024-09-26 [1] CRAN (R 4.4.1) #> jsonlite 1.8.9 2024-09-20 [1] CRAN (R 4.4.1) #> knitr 1.48 2024-07-07 [1] CRAN (R 4.4.1) #> later 1.3.2 2023-12-06 [1] CRAN (R 4.4.1) #> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.4.1) #> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.4.1) #> mime 0.12 2021-09-28 [1] CRAN (R 4.4.1) #> pillar 1.7.0 2022-02-01 [3] CRAN (R 4.1.2) #> promises 1.3.0 2024-04-05 [1] CRAN (R 4.4.1) #> R6 2.5.1 2021-08-19 [1] CRAN (R 4.4.1) #> rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.4.1) #> Rcpp 1.0.13 2024-07-17 [1] CRAN (R 4.4.1) #> reprex 2.1.1 2024-07-06 [1] CRAN (R 4.4.1) #> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.1) #> rmarkdown 2.28 2024-08-17 [1] CRAN (R 4.4.1) #> rstudioapi 0.16.0 2024-03-24 [1] CRAN (R 4.4.1) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.4.1) #> shiny 1.9.1 2024-08-01 [1] CRAN (R 4.4.1) #> utf8 1.2.2 2021-07-24 [3] CRAN (R 4.1.1) #> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.4.1) #> withr 3.0.1 2024-07-31 [1] CRAN (R 4.4.1) #> xfun 0.47 2024-08-17 [1] CRAN (R 4.4.1) #> xtable 1.8-4 2019-04-21 [1] CRAN (R 4.4.1) #> yaml 2.3.10 2024-07-26 [1] CRAN (R 4.4.1) #> #> [1] /home/agiardina/R/x86_64-pc-linux-gnu-library/4.4 #> [2] /usr/local/lib/R/site-library #> [3] /usr/lib/R/site-library #> [4] /usr/lib/R/library #> #> ────────────────────────────────────────────────────────────────────────────── ```
calderonsamuel commented 2 weeks ago

This is a hard one! I suspect this is the same as #79 or #179 . Please take a look at those issues and tell us which one is more similar 🙏 . We love linux but it has given us some headaches 🥲

agiardina commented 2 weeks ago

It seems to be the same error as #179. I was able to show the chat using rstudioapi::viewer from the console.