(*args, **kwargs)
| 86 | def init_wrapper(wrapped, instance, args, kwargs): |
| 87 | # Don't want to forward requests that are to Vertex AI, debug mode, or have their own http_options specified |
| 88 | # Thus, if the client constructor contains any params other than api_key, we don't set up forwarding |
| 89 | if any(value is not None for key, value in kwargs.items() if key != 'api_key'): |
| 90 | return wrapped(*args, **kwargs) |
| 91 | |
| 92 | default_metadata = { |
| 93 | "x-kaggle-proxy-data": os.environ['KAGGLE_DATA_PROXY_TOKEN'], |
| 94 | 'x-kaggle-authorization': f"Bearer {os.environ['KAGGLE_USER_SECRETS_TOKEN']}" |
| 95 | } |
| 96 | http_options = { |
| 97 | 'base_url': os.getenv('KAGGLE_DATA_PROXY_URL') + '/palmapi/', |
| 98 | 'headers': default_metadata |
| 99 | } |
| 100 | kwargs['http_options'] = http_options |
| 101 | return wrapped(*args, **kwargs) |
nothing calls this directly
no outgoing calls
no test coverage detected