Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
psbang committed Dec 1, 2023
1 parent 7d4f55d commit a06ec16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion patches/sitecustomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def new_configure(*args, **kwargs):
default_metadata = kwargs['default_metadata']
else:
default_metadata = []
kwargs['transport'] = 'rest' # Only support REST requests for now
default_metadata.append(("x-kaggle-proxy-data", os.environ['KAGGLE_DATA_PROXY_TOKEN']))
user_secrets_token = os.environ['KAGGLE_USER_SECRETS_TOKEN']
default_metadata.append(('x-kaggle-authorization', f'Bearer {user_secrets_token}'))
Expand All @@ -102,6 +101,7 @@ def new_configure(*args, **kwargs):
client_options['api_endpoint'] = os.environ['KAGGLE_DATA_PROXY_URL']
if os.getenv('KAGGLE_GOOGLE_GENERATIVE_AI_USE_REST_ONLY') != None:
client_options['api_endpoint'] += '/palmapi'
kwargs['transport'] = 'rest' # Only support REST requests for now
kwargs['client_options'] = client_options
old_configure(*args, **kwargs)
module.configure = new_configure
Expand Down

0 comments on commit a06ec16

Please sign in to comment.