diff --git a/pkg-r/DESCRIPTION b/pkg-r/DESCRIPTION index 83d3e1bd..3efd13a6 100644 --- a/pkg-r/DESCRIPTION +++ b/pkg-r/DESCRIPTION @@ -1,6 +1,6 @@ Package: shinychat Title: Chat UI Component for 'shiny' -Version: 0.2.0.9000 +Version: 0.3.0 Authors@R: c( person("Joe", "Cheng", , "joe@posit.co", role = "aut"), person("Carson", "Sievert", , "carson@posit.co", role = "aut"), diff --git a/pkg-r/NEWS.md b/pkg-r/NEWS.md index 3cdeff3e..800b8e14 100644 --- a/pkg-r/NEWS.md +++ b/pkg-r/NEWS.md @@ -1,4 +1,8 @@ -# shinychat (development version) +# shinychat 0.3.0 + +## Breaking changes + +* `chat_mod_server()` now returns a list of reactives for `last_input` and `last_turn`, as well functions to `update_user_input()`, `append()` and `clear()` the chat. (#130, #143, #145) ## New features @@ -10,8 +14,6 @@ * Added `chat_append(icon=...)` and `chat_ui(icon_assistant=...)` for customizing the icon that appears next to assistant responses. (#88) -* `chat_mod_server()` now returns a list of reactives for `last_input` and `last_turn`, as well functions to `update_user_input()`, `append()` and `clear()` the chat. (#130, #143, #145) - ## Improvements * `chat_app()` now correctly restores the chat client state when refreshing the app, e.g. by reloading the page. (#71) diff --git a/pkg-r/R/contents_shinychat.R b/pkg-r/R/contents_shinychat.R index 62c28051..02e2b260 100644 --- a/pkg-r/R/contents_shinychat.R +++ b/pkg-r/R/contents_shinychat.R @@ -104,7 +104,7 @@ opt_shinychat_tool_display <- function() { #' Note that you do **not** need to create a new class or extend #' `contents_shinychat()` to customize the tool display. Rather, you can use the #' strategies discussed in the [Tool Calling UI -#' article](https://posit-dev.github.io/shinychat/r/article/tool-ui.html) to +#' article](https://posit-dev.github.io/shinychat/r/articles/tool-ui.html) to #' customize the tool request and result display by providing a `display` list #' in the `extra` argument of the tool result. #' diff --git a/pkg-r/R/shinychat-package.R b/pkg-r/R/shinychat-package.R index 85db64b6..e9611f5b 100644 --- a/pkg-r/R/shinychat-package.R +++ b/pkg-r/R/shinychat-package.R @@ -23,7 +23,6 @@ ignore_unused_imports <- function() { release_bullets <- function() { c( - "Check that shinychat js assets are up-to-date (`make js-build && make r-update-dist`)", - "Set `development.mode: auto` in `pkg-r/pkgdown/_pkgdown.yml` and remove this release bullet." + "Check that shinychat js assets are up-to-date (`make js-build && make r-update-dist`)" ) } diff --git a/pkg-r/README.md b/pkg-r/README.md index 724dfce4..3412b339 100644 --- a/pkg-r/README.md +++ b/pkg-r/README.md @@ -60,4 +60,4 @@ shinyApp(ui, server) ## Next steps -Ready to start building a chatbot with shinychat? See [Get Started](articles/get-started.html) to learn more. +Ready to start building a chatbot with shinychat? See [Get Started](https://posit-dev.github.io/shinychat/r/articles/get-started.html) to learn more. diff --git a/pkg-r/cran-comments.md b/pkg-r/cran-comments.md index 64505f52..6ce431d8 100644 --- a/pkg-r/cran-comments.md +++ b/pkg-r/cran-comments.md @@ -1,6 +1,6 @@ ## revdepcheck results -We checked 2 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 3 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/pkg-r/man/contents_shinychat.Rd b/pkg-r/man/contents_shinychat.Rd index fc52962d..724ba852 100644 --- a/pkg-r/man/contents_shinychat.Rd +++ b/pkg-r/man/contents_shinychat.Rd @@ -102,7 +102,7 @@ to suit your needs. Note that you do \strong{not} need to create a new class or extend \code{contents_shinychat()} to customize the tool display. Rather, you can use the -strategies discussed in the \href{https://posit-dev.github.io/shinychat/r/article/tool-ui.html}{Tool Calling UI article} to +strategies discussed in the \href{https://posit-dev.github.io/shinychat/r/articles/tool-ui.html}{Tool Calling UI article} to customize the tool request and result display by providing a \code{display} list in the \code{extra} argument of the tool result. } diff --git a/pkg-r/pkgdown/_pkgdown.yml b/pkg-r/pkgdown/_pkgdown.yml index f29b8951..00a3a460 100644 --- a/pkg-r/pkgdown/_pkgdown.yml +++ b/pkg-r/pkgdown/_pkgdown.yml @@ -3,7 +3,7 @@ url: https://posit-dev.github.io/shinychat/r destination: "../docs/r" development: - mode: release + mode: auto authors: Posit Software, PBC: @@ -62,3 +62,8 @@ reference: - title: Integration with ellmer contents: - contents_shinychat + +news: + releases: + - text: "v0.3.0" + href: https://shiny.posit.co/blog/posts/shinychat-tool-ui/ diff --git a/pkg-r/revdep/cran.md b/pkg-r/revdep/cran.md index d07935b8..29c19611 100644 --- a/pkg-r/revdep/cran.md +++ b/pkg-r/revdep/cran.md @@ -1,6 +1,6 @@ ## revdepcheck results -We checked 2 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 3 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/pkg-r/tests/testthat/test-contents_shinychat.R b/pkg-r/tests/testthat/test-contents_shinychat.R index 3e70467d..47b38147 100644 --- a/pkg-r/tests/testthat/test-contents_shinychat.R +++ b/pkg-r/tests/testthat/test-contents_shinychat.R @@ -343,8 +343,7 @@ test_that("tool_result_display rich format", { test_that("processes a Turn object", { # Create a turn with multiple content items - turn <- ellmer::Turn( - role = "assistant", + turn <- ellmer::AssistantTurn( contents = list( ellmer::ContentText("Hello"), new_tool_request(), @@ -361,15 +360,14 @@ test_that("processes a Turn object", { }) test_that("consolidates adjacent turn types in a Chat object", { - chat <- ellmer::chat_openai(api_key = "boop") + withr::local_options(OPENAI_API_KEY = "boop") + chat <- ellmer::chat_openai() chat$set_turns(list( - ellmer::Turn( - role = "assistant", + ellmer::AssistantTurn( contents = list(ellmer::ContentText("Hello")) ), - ellmer::Turn( - role = "assistant", + ellmer::AssistantTurn( contents = list(ellmer::ContentText("World")) ) )) @@ -381,15 +379,14 @@ test_that("consolidates adjacent turn types in a Chat object", { }) test_that("doesn't consolidate adjacent turns with different roles in a Chat object", { - chat <- ellmer::chat_openai(api_key = "boop") + withr::local_options(OPENAI_API_KEY = "boop") + chat <- ellmer::chat_openai() chat$set_turns(list( - ellmer::Turn( - role = "user", + ellmer::UserTurn( contents = list(ellmer::ContentText("Question")) ), - ellmer::Turn( - role = "assistant", + ellmer::AssistantTurn( contents = list(ellmer::ContentText("Answer")) ) )) @@ -401,18 +398,17 @@ test_that("doesn't consolidate adjacent turns with different roles in a Chat obj }) test_that("drops requests and moves results to assistant turn role in a Chat object", { - chat <- ellmer::chat_openai(api_key = "boop") + withr::local_options(OPENAI_API_KEY = "boop") + chat <- ellmer::chat_openai() chat$set_turns(list( - ellmer::Turn( - role = "assistant", + ellmer::AssistantTurn( contents = list( ellmer::ContentText("Hello"), new_tool_request() ) ), - ellmer::Turn( - role = "user", + ellmer::UserTurn( contents = list( new_tool_result(value = "success") )