MilanM commited on
Commit
231b01d
·
verified ·
1 Parent(s): b6ac9c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -182,18 +182,16 @@ def _(mo, prompt_stack):
182
 
183
  @app.cell
184
  def _(client_instantiation_form, os):
185
- if client_instantiation_form.value:
186
- client_setup = client_instantiation_form.value
187
- else:
188
- client_setup = None
189
-
190
  ### Extract Credential Variables:
191
- if client_setup is not None:
192
- wx_url = client_setup["wx_region"]
193
- wx_api_key = client_setup["wx_api_key"]
194
- os.environ["WATSONX_APIKEY"] = wx_api_key
195
- project_id = client_setup.get("project_id")
196
- space_id = client_setup.get("space_id")
 
197
  else:
198
  os.environ["WATSONX_APIKEY"] = ""
199
  project_id = space_id = wx_api_key = wx_url = None
 
182
 
183
  @app.cell
184
  def _(client_instantiation_form, os):
185
+ client_setup = client_instantiation_form.value or None
186
+
 
 
 
187
  ### Extract Credential Variables:
188
+ if client_setup:
189
+ wx_url = client_setup["wx_region"] if if client_setup["wx_region"] else "EU"
190
+ wx_api_key = client_setup["wx_api_key"].strip() if client_setup["wx_api_key"] else None
191
+ os.environ["WATSONX_APIKEY"] = wx_api_key or ""
192
+
193
+ project_id = client_setup["project_id"].strip() if client_setup["project_id"] else None
194
+ space_id = client_setup["space_id"].strip() if client_setup["space_id"] else None
195
  else:
196
  os.environ["WATSONX_APIKEY"] = ""
197
  project_id = space_id = wx_api_key = wx_url = None