@@ -27,12 +27,11 @@ embed_snowflake <- function(
2727 if (is.data.frame(x )) {
2828 x [[" embedding" ]] <- Recall(
2929 x [[" text" ]],
30- endpoint = endpoint ,
31- api_key = api_key ,
32- api_version = api_version ,
30+ account = account ,
31+ credentials = credentials ,
3332 model = model ,
34- batch_size = batch_size ,
35- api_args = api_args
33+ api_args = api_args ,
34+ batch_size = batch_size
3635 )
3736 return (x )
3837 }
@@ -151,7 +150,7 @@ default_snowflake_credentials <- function(account = snowflake_account()) {
151150 user <- Sys.getenv(" SNOWFLAKE_USER" )
152151 private_key <- Sys.getenv(" SNOWFLAKE_PRIVATE_KEY" )
153152 if (nchar(user ) != 0 && nchar(private_key ) != 0 ) {
154- check_installed(" jose" , " for key-pair authentication" )
153+ check_installed(c( " jose" , " openssl " ) , " for key-pair authentication" )
155154 key <- openssl :: read_key(private_key )
156155 return (function () {
157156 token <- snowflake_keypair_token(account , user , key )
@@ -210,7 +209,7 @@ snowflake_keypair_token <- function(
210209 # manually after jose's validation phase.
211210 claim <- jose :: jwt_claim(" dummy" , sub , exp = as.integer(expiry ))
212211 claim $ iss <- iss
213- creds <- list (expiry = expiry , token = jwt_encode_sig(claim , key ))
212+ creds <- list (expiry = expiry , token = jose :: jwt_encode_sig(claim , key ))
214213 cache $ set(creds )
215214 }
216215 creds $ token
0 commit comments