From 70123d7dc473cf9c1e8300188630d07559c395f4 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Fri, 14 Nov 2025 12:23:09 -0500 Subject: [PATCH] fix: Prepare for upcoming ellmer v0.4.0 release --- tests/testthat/setup.R | 2 +- tests/testthat/test-set_llm.R | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index 6dd373b..229b0a3 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -54,7 +54,7 @@ chat_openai_mocked <- function(system_prompt = NULL, model = model, params = params, extra_args = api_args, - api_key = api_key, + credentials = function() api_key, provider_class = ellmer:::ProviderOpenAI ) } diff --git a/tests/testthat/test-set_llm.R b/tests/testthat/test-set_llm.R index 1232882..c964117 100644 --- a/tests/testthat/test-set_llm.R +++ b/tests/testthat/test-set_llm.R @@ -60,7 +60,7 @@ test_that("setting arguments for selected provider ", { my_project <- my_project |> set_llm(provider = "openai", model = "model_mocked") expect_equal( - my_project$llm$.__enclos_env__$private$provider@model, + my_project$llm$get_provider()@model, "model_mocked" ) @@ -68,7 +68,7 @@ test_that("setting arguments for selected provider ", { my_project <- my_project |> set_llm(provider = "openai", api_key = "api_key_mocked") expect_equal( - my_project$llm$.__enclos_env__$private$provider@api_key, + my_project$llm$get_provider()@credentials(), "api_key_mocked" ) @@ -76,6 +76,7 @@ test_that("setting arguments for selected provider ", { my_project <- my_project |> set_llm(provider = "openai", echo = "all") expect_equal( + # Please don't reach into the private namespace of external R6 classes my_project$llm$.__enclos_env__$private$echo, "all" )