Skip to content

Commit

Permalink
feat: take google SA from env path
Browse files Browse the repository at this point in the history
  • Loading branch information
GreeFine committed Dec 16, 2023
1 parent 5afd885 commit c607a5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/features/gemini.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use crate::core::commands::{CallBackParams, CallbackReturn};
static TOKEN: OnceCell<AccessToken> = OnceCell::const_new();

async fn get_token() -> AccessToken {
let creds = yup_oauth2::read_service_account_key("blackfoot-dev-bd1f97a0d61e.json")
let key_path = std::env::var("GOOGLE_APPLICATION_CREDENTIALS")
.unwrap_or_else(|_| "blackfoot-dev-bd1f97a0d61e.json".to_string());
let creds = yup_oauth2::read_service_account_key(key_path)
.await
.unwrap();
let sa = ServiceAccountAuthenticator::builder(creds)
Expand Down

0 comments on commit c607a5c

Please sign in to comment.