diff --git a/R/provider-databricks.R b/R/provider-databricks.R index 9730e7f4..2f4d71cf 100644 --- a/R/provider-databricks.R +++ b/R/provider-databricks.R @@ -54,7 +54,10 @@ chat_databricks <- function(workspace = databricks_workspace(), base_url = workspace, model = model, extra_args = api_args, - token = token + token = token, + # Databricks APIs use bearer tokens, not API keys, but we need to pass an + # empty string here anyway to make S7::validate() happy. + api_key = "" ) Chat$new(provider = provider, turns = turns, echo = echo) } diff --git a/tests/testthat/test-provider-databricks.R b/tests/testthat/test-provider-databricks.R index 3072a4e1..c826eba0 100644 --- a/tests/testthat/test-provider-databricks.R +++ b/tests/testthat/test-provider-databricks.R @@ -20,6 +20,9 @@ test_that("can make simple streaming request", { # Common provider interface ----------------------------------------------- test_that("defaults are reported", { + # Setting a dummy host ensures we don't skip this test, even if there are no + # Databricks credentials available. + withr::local_envvar(DATABRICKS_HOST = "https://example.cloud.databricks.com") expect_snapshot(. <- chat_databricks()) })