rossiter78 commited on
Commit
b2d74f7
·
verified ·
1 Parent(s): fbae619

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -4
app.py CHANGED
@@ -4,12 +4,27 @@ import os
4
 
5
 
6
  # Configuration
7
- #LANGFLOW_API_URL = os.environ.get("LANGFLOW_API_URL", "https://rossiter78-langflowpoc.hf.space/api/v1/run/d53e1b2f-3572-40c8-84ab-725106ee858f")
8
- LANGFLOW_API_URL = os.environ.get("LANGFLOW_API_URL", "https://rossiter78-cpalangflowbackend.hf.space/api/v1/run/CPAChat")
9
- #LANGFLOW_API_URL = "https://rossiter78-langflowpoc.hf.space/api/v1/run/d53e1b2f-3572-40c8-84ab-725106ee858f"
10
- LANGFLOW_API_KEY = os.environ.get("LANGFLOW_API_KEY", "") # If needed
11
  HF_API_KEY = os.environ.get("HF_API_KEY", "")
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  def call_langflow(message, history):
14
  """
15
  Call Langflow API and return the response
 
4
 
5
 
6
  # Configuration
7
+ LANGFLOW_API_URL = os.environ.get("LANGFLOW_API_URL", "")
8
+ LANGFLOW_API_KEY = os.environ.get("LANGFLOW_API_KEY", "")
 
 
9
  HF_API_KEY = os.environ.get("HF_API_KEY", "")
10
 
11
+ if not LANGFLOW_API_URL:
12
+ print("FATAL: LANGFLOW_API_URL secret not found or is empty.")
13
+ else:
14
+ print("SUCCESS: LANGFLOW_API_URL loaded securely.")
15
+
16
+ if not LANGFLOW_API_KEY:
17
+ print("FATAL: LANGFLOW_API_KEY secret not found or is empty.")
18
+ else:
19
+ print("SUCCESS: LANGFLOW_API_KEY loaded securely.")
20
+
21
+ if not HF_API_KEY:
22
+ print("FATAL: HF_API_KEY secret not found or is empty.")
23
+ else:
24
+ print("SUCCESS: HF_API_KEY loaded securely.")
25
+
26
+
27
+ # Funcation definition
28
  def call_langflow(message, history):
29
  """
30
  Call Langflow API and return the response