Skip to content

Commit

Permalink
stream(dry_run)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Mar 9, 2024
1 parent 45c460e commit dcff55a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 7 additions & 2 deletions R/stream.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#' stream
#'
#' @inheritParams chat
#'
#' @export
stream <- function(text, model = "mistral-tiny", ..., error_call = current_env()) {
stream <- function(text, model = "mistral-tiny", dry_run = FALSE, ..., error_call = current_env()) {
check_model(model, error_call = error_call)

req <- req_chat(text, model, stream = TRUE, error_call = error_call)
req <- req_chat(text, model, stream = TRUE, error_call = error_call, dry_run = dry_run)
if (is_true(dry_run)) {
return(req)
}

resp <- req_perform_stream(req,
callback = stream_callback,
round = "line",
Expand Down
10 changes: 9 additions & 1 deletion man/stream.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dcff55a

Please sign in to comment.