diff --git a/articles/caching.qmd b/articles/caching.qmd index 1682b60..5b6653c 100644 --- a/articles/caching.qmd +++ b/articles/caching.qmd @@ -80,10 +80,10 @@ combining the values in the request (`$request`). ```{r} jsonlite::read_json( - "_mall_cache/08/086214f2638f60496fd0468d7de37c59.json", - simplifyVector = TRUE, + "_mall_cache/08/086214f2638f60496fd0468d7de37c59.json", + simplifyVector = TRUE, flatten = TRUE - ) +) ``` Re-running the same `mall` call, will complete significantly faster @@ -150,7 +150,7 @@ process. To run this test, we will use the first 5 rows: tic() data_bookReviews |> - head(5) |> + head(5) |> llm_sentiment(review) toc() @@ -174,7 +174,7 @@ original time! tic() data_bookReviews |> - head(5) |> + head(5) |> llm_sentiment(review) toc() @@ -187,7 +187,7 @@ The other 5 will still be scored using their cached result tic() data_bookReviews |> - head(6) |> + head(6) |> llm_sentiment(review) toc() diff --git a/articles/databricks.qmd b/articles/databricks.qmd index 2ce62f7..d56c810 100644 --- a/articles/databricks.qmd +++ b/articles/databricks.qmd @@ -68,14 +68,14 @@ argument in the AI Summarize function: ```{r} tbl_reviews |> - llm_summarize(review, max_words = 5) |> + llm_summarize(review, max_words = 5) |> show_query() ``` `llm_classify()` for this back-end, will only accept unnamed options. ```{r} -tbl_reviews |> +tbl_reviews |> llm_classify(review, c("appliance", "computer")) ``` diff --git a/tests/testthat/test-llm-classify.R b/tests/testthat/test-llm-classify.R index e5575d5..ab48270 100644 --- a/tests/testthat/test-llm-classify.R +++ b/tests/testthat/test-llm-classify.R @@ -67,4 +67,4 @@ test_that("Classify on Ollama works", { additional_prompt = "Consider all laptops as appliances." ) ) -}) \ No newline at end of file +})