make error message more robust
Browse files
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 |
-
|
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,
|