Update main_app.py
Browse files- main_app.py +5 -2
main_app.py
CHANGED
@@ -155,22 +155,25 @@ def _(mo):
|
|
155 |
wx_region=mo.ui.dropdown(
|
156 |
regions,
|
157 |
label="Select your watsonx.ai region:",
|
158 |
-
value="
|
159 |
searchable=True,
|
160 |
),
|
161 |
wx_api_key=mo.ui.text(
|
162 |
placeholder="Add your IBM Cloud api-key...",
|
163 |
label="IBM Cloud Api-key:",
|
|
|
164 |
kind="password",
|
165 |
),
|
166 |
project_id=mo.ui.text(
|
167 |
placeholder="Add your watsonx.ai project_id...",
|
168 |
label="Project_ID:",
|
|
|
169 |
kind="text",
|
170 |
),
|
171 |
space_id=mo.ui.text(
|
172 |
placeholder="Add your watsonx.ai space_id...",
|
173 |
label="Space_ID:",
|
|
|
174 |
kind="text",
|
175 |
),
|
176 |
)
|
@@ -599,7 +602,7 @@ def _(mo, template, template_variant):
|
|
599 |
|
600 |
|
601 |
@app.cell
|
602 |
-
def _(ast, function_editor, mo, os):
|
603 |
function_name = template["function_name"] or "your_python_function"
|
604 |
if function_editor.value:
|
605 |
# Get the edited code from the function editor
|
|
|
155 |
wx_region=mo.ui.dropdown(
|
156 |
regions,
|
157 |
label="Select your watsonx.ai region:",
|
158 |
+
value=os.environ.get("WX_REGION","EU"),
|
159 |
searchable=True,
|
160 |
),
|
161 |
wx_api_key=mo.ui.text(
|
162 |
placeholder="Add your IBM Cloud api-key...",
|
163 |
label="IBM Cloud Api-key:",
|
164 |
+
value=os.environ.get("WX_APIKEY",""),
|
165 |
kind="password",
|
166 |
),
|
167 |
project_id=mo.ui.text(
|
168 |
placeholder="Add your watsonx.ai project_id...",
|
169 |
label="Project_ID:",
|
170 |
+
value=os.environ.get("WX_PROJECT_ID",""),
|
171 |
kind="text",
|
172 |
),
|
173 |
space_id=mo.ui.text(
|
174 |
placeholder="Add your watsonx.ai space_id...",
|
175 |
label="Space_ID:",
|
176 |
+
value=os.environ.get("WX_SPACE_ID",""),
|
177 |
kind="text",
|
178 |
),
|
179 |
)
|
|
|
602 |
|
603 |
|
604 |
@app.cell
|
605 |
+
def _(ast, template, function_editor, mo, os):
|
606 |
function_name = template["function_name"] or "your_python_function"
|
607 |
if function_editor.value:
|
608 |
# Get the edited code from the function editor
|