Skip to content

Commit dcff55a

Browse files
stream(dry_run)
1 parent 45c460e commit dcff55a

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

R/stream.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#' stream
22
#'
33
#' @inheritParams chat
4+
#'
45
#' @export
5-
stream <- function(text, model = "mistral-tiny", ..., error_call = current_env()) {
6+
stream <- function(text, model = "mistral-tiny", dry_run = FALSE, ..., error_call = current_env()) {
67
check_model(model, error_call = error_call)
78

8-
req <- req_chat(text, model, stream = TRUE, error_call = error_call)
9+
req <- req_chat(text, model, stream = TRUE, error_call = error_call, dry_run = dry_run)
10+
if (is_true(dry_run)) {
11+
return(req)
12+
}
13+
914
resp <- req_perform_stream(req,
1015
callback = stream_callback,
1116
round = "line",

man/stream.Rd

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

0 commit comments

Comments
 (0)