Skip to content

Commit 2fc9113

Browse files
committed
fix recall
1 parent 1d4e3b5 commit 2fc9113

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ Suggests:
6161
stringr,
6262
testthat (>= 3.0.0),
6363
tibble,
64-
jose
64+
jose,
65+
openssl
6566
VignetteBuilder:
6667
knitr
6768
Config/Needs/website: tidyverse/tidytemplate, rmarkdown

R/embed-snowflake.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)