Skip to content

Commit c1990bf

Browse files
committed
fix result_env and highlight ai_validate
1 parent cfc0667 commit c1990bf

File tree

3 files changed

+133
-182
lines changed

3 files changed

+133
-182
lines changed

R/ai_text.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
#' @importFrom glue glue
3333
#' @export
3434
ai_text <- function(.data, chat_fn, ..., type_object, few_shot_examples = NULL,
35-
verbose = TRUE, result_env = new.env()) {
35+
verbose = TRUE, result_env = NULL) {
36+
37+
# --- Ensure result_env is valid before anything else uses it ---
38+
if (is.null(result_env)) result_env <- new.env()
3639

3740
if (!is.character(.data))
3841
stop("Unsupported data type for ai_text")

0 commit comments

Comments
 (0)