You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
506 B
13 lines
506 B
|
3 days ago
|
# app/vertex_client.py
|
||
|
|
from google.oauth2 import service_account
|
||
|
|
import google.auth.transport.requests
|
||
|
|
|
||
|
|
SERVICE_ACCOUNT_FILE = r"C:\Users\rithv\OneDrive\Desktop\decision_engine_project\app\service-account.json"
|
||
|
|
|
||
|
|
def get_access_token():
|
||
|
|
credentials = service_account.Credentials.from_service_account_file(
|
||
|
|
SERVICE_ACCOUNT_FILE,
|
||
|
|
scopes=["https://www.googleapis.com/auth/cloud-platform"]
|
||
|
|
)
|
||
|
|
credentials.refresh(google.auth.transport.requests.Request())
|
||
|
|
return credentials.token
|