Skip to content

Commit

Permalink
SK-1749: Added creds for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
saileshwar-skyflow committed Nov 21, 2024
1 parent c75d429 commit c593380
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1155,13 +1155,31 @@ from skyflow import Skyflow
from skyflow import LogLevel
from skyflow import Env

# To generate Bearer Token from credentials string.
skyflow_credentials = {
'clientID': '<YOUR_CLIENT_ID>',
'clientName': '<YOUR_CLIENT_NAME>',
'tokenURI': '<YOUR_TOKEN_URI>',
'keyID': '<YOUR_KEY_ID>',
'privateKey': '<YOUR_PRIVATE_KEY>',
}
credentials_string = json.dumps(skyflow_credentials)

# Pass one of api_key, token, credentials_string & path as credentials
credentials = {
'token': 'BEARER_TOKEN', # bearer token
# api_key: "API_KEY", # API_KEY
# path: "PATH", # path to credentials file
# credentials_string: credentials_string, # credentials as string
}

client = (
Skyflow.builder()
.add_vault_config({
'vault_id': 'VAULT_ID', # primary vault
'cluster_id': 'CLUSTER_ID', # ID from your vault URL Eg https://{clusterId}.vault.skyflowapis.com
'env': Env.PROD, # Env by default it is set to PROD
'credentials': "<CREDENTIALS>" # individual credentials
'credentials': credentials # individual credentials
})
.add_skyflow_credentials(credentials) # skyflow credentials will be used if no individual credentials are passed
.set_log_level(LogLevel.INFO) # set log level by default it is set to ERROR
Expand Down

0 comments on commit c593380

Please sign in to comment.