Skip to content

Commit 61a0f07

Browse files
authored
r/v0.3.0 (#159)
* chore: Bump version to 0.3.0 * chore: Polish NEWS * chore: `urlchecker::url_check()` * chore: Set `development.mode: auto` and remove release bullet * chore: revdepcheck * chore: update cran comments * chore: Avoid using deprecated `api_key` arg * chore(README): fix link to getting started article * Merged origin/main into r/rc-v0.3.0 * tests: Use ellmer role-specific turn classes * fix(tests): Fix typo * chore: Add release post to pkgdown site
1 parent 376cc57 commit 61a0f07

File tree

10 files changed

+31
-29
lines changed

10 files changed

+31
-29
lines changed

pkg-r/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: shinychat
22
Title: Chat UI Component for 'shiny'
3-
Version: 0.2.0.9000
3+
Version: 0.3.0
44
Authors@R: c(
55
person("Joe", "Cheng", , "[email protected]", role = "aut"),
66
person("Carson", "Sievert", , "[email protected]", role = "aut"),

pkg-r/NEWS.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# shinychat (development version)
1+
# shinychat 0.3.0
2+
3+
## Breaking changes
4+
5+
* `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)
26

37
## New features
48

@@ -10,8 +14,6 @@
1014

1115
* Added `chat_append(icon=...)` and `chat_ui(icon_assistant=...)` for customizing the icon that appears next to assistant responses. (#88)
1216

13-
* `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)
14-
1517
## Improvements
1618

1719
* `chat_app()` now correctly restores the chat client state when refreshing the app, e.g. by reloading the page. (#71)

pkg-r/R/contents_shinychat.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ opt_shinychat_tool_display <- function() {
104104
#' Note that you do **not** need to create a new class or extend
105105
#' `contents_shinychat()` to customize the tool display. Rather, you can use the
106106
#' strategies discussed in the [Tool Calling UI
107-
#' article](https://posit-dev.github.io/shinychat/r/article/tool-ui.html) to
107+
#' article](https://posit-dev.github.io/shinychat/r/articles/tool-ui.html) to
108108
#' customize the tool request and result display by providing a `display` list
109109
#' in the `extra` argument of the tool result.
110110
#'

pkg-r/R/shinychat-package.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ ignore_unused_imports <- function() {
2323

2424
release_bullets <- function() {
2525
c(
26-
"Check that shinychat js assets are up-to-date (`make js-build && make r-update-dist`)",
27-
"Set `development.mode: auto` in `pkg-r/pkgdown/_pkgdown.yml` and remove this release bullet."
26+
"Check that shinychat js assets are up-to-date (`make js-build && make r-update-dist`)"
2827
)
2928
}

pkg-r/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ shinyApp(ui, server)
6060

6161
## Next steps
6262

63-
Ready to start building a chatbot with shinychat? See [Get Started](articles/get-started.html) to learn more.
63+
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.

pkg-r/cran-comments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## revdepcheck results
22

3-
We checked 2 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
3+
We checked 3 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
44

55
* We saw 0 new problems
66
* We failed to check 0 packages

pkg-r/man/contents_shinychat.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg-r/pkgdown/_pkgdown.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ url: https://posit-dev.github.io/shinychat/r
33
destination: "../docs/r"
44

55
development:
6-
mode: release
6+
mode: auto
77

88
authors:
99
Posit Software, PBC:
@@ -62,3 +62,8 @@ reference:
6262
- title: Integration with ellmer
6363
contents:
6464
- contents_shinychat
65+
66+
news:
67+
releases:
68+
- text: "v0.3.0"
69+
href: https://shiny.posit.co/blog/posts/shinychat-tool-ui/

pkg-r/revdep/cran.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## revdepcheck results
22

3-
We checked 2 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
3+
We checked 3 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.
44

55
* We saw 0 new problems
66
* We failed to check 0 packages

pkg-r/tests/testthat/test-contents_shinychat.R

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ test_that("tool_result_display rich format", {
343343

344344
test_that("processes a Turn object", {
345345
# Create a turn with multiple content items
346-
turn <- ellmer::Turn(
347-
role = "assistant",
346+
turn <- ellmer::AssistantTurn(
348347
contents = list(
349348
ellmer::ContentText("Hello"),
350349
new_tool_request(),
@@ -361,15 +360,14 @@ test_that("processes a Turn object", {
361360
})
362361

363362
test_that("consolidates adjacent turn types in a Chat object", {
364-
chat <- ellmer::chat_openai(api_key = "boop")
363+
withr::local_options(OPENAI_API_KEY = "boop")
364+
chat <- ellmer::chat_openai()
365365

366366
chat$set_turns(list(
367-
ellmer::Turn(
368-
role = "assistant",
367+
ellmer::AssistantTurn(
369368
contents = list(ellmer::ContentText("Hello"))
370369
),
371-
ellmer::Turn(
372-
role = "assistant",
370+
ellmer::AssistantTurn(
373371
contents = list(ellmer::ContentText("World"))
374372
)
375373
))
@@ -381,15 +379,14 @@ test_that("consolidates adjacent turn types in a Chat object", {
381379
})
382380

383381
test_that("doesn't consolidate adjacent turns with different roles in a Chat object", {
384-
chat <- ellmer::chat_openai(api_key = "boop")
382+
withr::local_options(OPENAI_API_KEY = "boop")
383+
chat <- ellmer::chat_openai()
385384

386385
chat$set_turns(list(
387-
ellmer::Turn(
388-
role = "user",
386+
ellmer::UserTurn(
389387
contents = list(ellmer::ContentText("Question"))
390388
),
391-
ellmer::Turn(
392-
role = "assistant",
389+
ellmer::AssistantTurn(
393390
contents = list(ellmer::ContentText("Answer"))
394391
)
395392
))
@@ -401,18 +398,17 @@ test_that("doesn't consolidate adjacent turns with different roles in a Chat obj
401398
})
402399

403400
test_that("drops requests and moves results to assistant turn role in a Chat object", {
404-
chat <- ellmer::chat_openai(api_key = "boop")
401+
withr::local_options(OPENAI_API_KEY = "boop")
402+
chat <- ellmer::chat_openai()
405403

406404
chat$set_turns(list(
407-
ellmer::Turn(
408-
role = "assistant",
405+
ellmer::AssistantTurn(
409406
contents = list(
410407
ellmer::ContentText("Hello"),
411408
new_tool_request()
412409
)
413410
),
414-
ellmer::Turn(
415-
role = "user",
411+
ellmer::UserTurn(
416412
contents = list(
417413
new_tool_result(value = "success")
418414
)

0 commit comments

Comments
 (0)