tests/testthat/test-embedding.R

test_that("embedding", {
  skip_if_not(ping_ollama(silent = TRUE))
  expect_equal(nrow(embed_text(c("Test 1", "Test 2"))), 2)
})

test_that("missing model", {
  skip_if_not(ping_ollama(silent = TRUE))
  expect_error(embed_text("test", model = "missing"),
               "not.installed")
})

Try the rollama package in your browser

Any scripts or data that you put into this service are public.

rollama documentation built on April 3, 2025, 7:48 p.m.