kn404 commited on
Commit
af770c0
·
1 Parent(s): f7b79e2

make error message more robust

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -42,8 +42,11 @@ def update_run_button(url):
42
 
43
 
44
  def run_testing(user_prompt, invariant_api_key):
 
 
 
45
  agent_params = {"system_prompt": user_prompt}
46
- print(agent_params)
47
  yield 'Starting tests...', '', 'button-loading'
48
  env={
49
  "INVARIANT_API_KEY": invariant_api_key,
 
42
 
43
 
44
  def run_testing(user_prompt, invariant_api_key):
45
+ if not invariant_api_key.startswith("inv"):
46
+ return "Please enter a valid Invariant API key to get the score!", '', 'toggled-off-button'
47
+
48
  agent_params = {"system_prompt": user_prompt}
49
+
50
  yield 'Starting tests...', '', 'button-loading'
51
  env={
52
  "INVARIANT_API_KEY": invariant_api_key,