Update app.py
Browse files
app.py
CHANGED
|
@@ -17,10 +17,12 @@ from google.api_core import exceptions
|
|
| 17 |
|
| 18 |
# 1. Initialize Client WITHOUT api_version
|
| 19 |
# This specifically fixes the 'INVALID_ARGUMENT' error you received
|
| 20 |
-
client = genai.Client(api_key=os.environ.get("GOOGLE_API_KEY"))
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# --- Data Preparation ---
|
| 26 |
df_credit = pd.DataFrame({'ID': [1111, 2222, 3333, 4444, 5555], 'Credit_Score': [455, 685, 825, 840, 350]})
|
|
|
|
| 17 |
|
| 18 |
# 1. Initialize Client WITHOUT api_version
|
| 19 |
# This specifically fixes the 'INVALID_ARGUMENT' error you received
|
|
|
|
| 20 |
|
| 21 |
+
# Initialize the client with explicit API version 'v1'
|
| 22 |
+
client = genai.Client(
|
| 23 |
+
api_key=userdata.get('GOOGLE_API_KEY'),
|
| 24 |
+
http_options=types.HttpOptions(api_version='v1')
|
| 25 |
+
)
|
| 26 |
|
| 27 |
# --- Data Preparation ---
|
| 28 |
df_credit = pd.DataFrame({'ID': [1111, 2222, 3333, 4444, 5555], 'Credit_Score': [455, 685, 825, 840, 350]})
|