Skip to content

[Bug]: Warning: The api_key argument of chat_google_gemini() is deprecated as of ellmer #262

@bulbusheadgang

Description

@bulbusheadgang

Confirm setup

  • I have installed the development version of {gptstudio} (pak::pak("MichelNivard/gptstudio")) and tested if the problem remains.
  • I have installed the {reprex} and {sessioninfo} packages to be able to run this issue's code snippet pak::pak(c("reprex", "sessioninfo")).

What happened?

I use Posit Cloud

Before this bug I was experiencing what was in this bug report: #258
After troubleshooting that bug I am now experiencing this one: after I try to send a query to gemini the "Viewer: in Posit Cloud goes blank and I get "Warning: The api_key argument of chat_google_gemini() is deprecated as of ellmer"

Relevant log output

Loading required package: shiny

Listening on http://127.0.0.1:7615
ℹ Fetching models for google service...
✔ Got models!
Warning: The `api_key` argument of `chat_google_gemini()` is deprecated as of ellmer
0.4.0.
ℹ Please use the `credentials` argument instead.
ℹ The deprecated feature was likely used in the gptstudio package.
  Please report the issue at
  <https://github.com/MichelNivard/gptstudio/issues>.
Warning in process_chat$invoke(prompt = input$chat_input, service = settings$service,  :
  ERROR: An error occurred when invoking the ExtendedTask.
Caused by error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `ellmer::Turn()`:
! unused argument (role = .x$role)
Warning: Error in purrr::map: ℹ In index: 1.
Caused by error in `ellmer::Turn()`:
! unused argument (role = .x$role)
  167: base$onError
  166: base$onError
  165: base$onError
  164: base$onError
  163: base$onError
  162: base$onError
  161: base$onError
  160: base$onError
  159: base$onError
  158: domain$onError
  157: promiseDomain$onError
  156: <Anonymous>
  155: stop
  154: signalConditions
  153: value.Future
  142: check
  141: action
  134: promise
  133: as.promise.Future
  131: private$doResolve
  124: resolve
  123: work_fn
  122: private$do_work
  121: private$attempt_work
  120: queue$schedule_work
  119: action
  112: promise
  111: promises::future_promise
  110: <Anonymous>
   86: private$do_invoke
   85: process_chat$invoke
   84: observe
   83: <observer:observeEvent(input$chat)>
    4: shiny::runApp
    3: eval
    2: eval
    1: .rs.sourceWithProgress


Execution halted

Session info

r
gptstudio::gptstudio_sitrep()
#> 
#> ── Configuration for gptstudio ─────────────────────────────────────────────────
#> Using user configuration file at
#> '/cloud/home/r3312025/.config/R/gptstudio/config.yml'
#> 
#> 
#> ── Current Settings ──
#> 
#> 
#> 
#> - Model: gemini-2.5-pro
#> 
#> - Task: coding
#> 
#> - Language: en
#> 
#> - Service: google
#> 
#> - Custom prompt:
#> 
#> - Stream: TRUE
#> 
#> - Code style: tidyverse
#> 
#> - Skill: genius
#> 
#> 
#> 
#> ── Checking API connections ──
#> 
#> 
#> 
#> ── Checking OpenAI API connection 
#> 
#> ✖ API key is not set or invalid for openai 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 
#> 
#> Using model = "gemini-2.5-flash".
#> Warning: The `api_key` argument of `chat_google_gemini()` is deprecated as of ellmer
#> 0.4.0.
#> ℹ Please use the `credentials` argument instead.
#> ℹ The deprecated feature was likely used in the gptstudio package.
#>   Please report the issue at
#>   <https://github.com/MichelNivard/gptstudio/issues>.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> ✖ Failed to connect to the google API 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

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions