From dff11e39c0166b6f1f4a1565c2935449be43f814 Mon Sep 17 00:00:00 2001 From: Edgar Ruiz <77294576+edgararuiz@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:04:53 -0500 Subject: [PATCH] Addresses new dimension for ellmer tokens --- DESCRIPTION | 4 ++-- R/backend-ellmer.R | 2 +- tests/testthat/_snaps/app-ui.md | 12 ++++++------ tests/testthat/_snaps/chattr-use.md | 4 ++-- tests/testthat/test-app-server.R | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 466780c..99194a4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: chattr Title: Interact with Large Language Models in 'RStudio' -Version: 0.3.0 +Version: 0.3.0.9000 Authors@R: c( person("Edgar", "Ruiz", , "edgar@posit.co", role = c("aut", "cre")), person(given = "Posit Software, PBC", role = c("cph", "fnd")) @@ -22,7 +22,7 @@ Imports: lifecycle, processx, config, - ellmer (>= 0.2.0), + ellmer (>= 0.3.0), purrr, rlang, bslib, diff --git a/R/backend-ellmer.R b/R/backend-ellmer.R index 1c81fea..fe55d11 100644 --- a/R/backend-ellmer.R +++ b/R/backend-ellmer.R @@ -84,7 +84,7 @@ ch_ellmer_history <- function(x) { ellmer::Turn( role = .x$role, contents = list(ellmer::ContentText(.x$content)), - tokens = .x$tokens %||% c(0, 0) + tokens = .x$tokens %||% c(0, 0, 0) ) } ) diff --git a/tests/testthat/_snaps/app-ui.md b/tests/testthat/_snaps/app-ui.md index e2ba5e3..31b29ec 100644 --- a/tests/testthat/_snaps/app-ui.md +++ b/tests/testthat/_snaps/app-ui.md @@ -20,9 +20,9 @@ [4] "
" [5] "
" [6] "
" - [7] "
" + [7] "
" [8] " " - [9] " " + [9] " " [10] "
" [11] "
" [12] "
" @@ -54,19 +54,19 @@ [4] "
" [5] "

Save / Load Chat

" [6] "
" - [7] "
" + [7] "
" [8] " " - [9] " " [11] "
" [12] "
" [13] "
" [14] " " - [15] " " + [15] " " [16] "
" [17] "
" [18] " " - [19] " " + [19] " " [20] "
" [21] "
" [22] "
" diff --git a/tests/testthat/_snaps/chattr-use.md b/tests/testthat/_snaps/chattr-use.md index 676ade2..28258d9 100644 --- a/tests/testthat/_snaps/chattr-use.md +++ b/tests/testthat/_snaps/chattr-use.md @@ -36,6 +36,6 @@ -- chattr * Provider: Anthropic - * Model: claude-3-7-sonnet-latest - * Label: claude-3-7-sonnet-latest (Anthropic) + * Model: claude-sonnet-4-20250514 + * Label: claude-sonnet-4-20250514 (Anthropic) diff --git a/tests/testthat/test-app-server.R b/tests/testthat/test-app-server.R index 99eec61..40eb8f3 100644 --- a/tests/testthat/test-app-server.R +++ b/tests/testthat/test-app-server.R @@ -14,7 +14,7 @@ test_that("Testing the function directly", { ) expect_null( shiny::testServer(app_server, { - session$setInputs(open = TRUE) + #session$setInputs(open = TRUE) }) ) expect_null(