Sandeep-int commited on
Commit
1ea9981
·
verified ·
1 Parent(s): c907c75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  import requests
3
  import datetime
 
4
 
5
  API_URL = "https://agent-shield-chbxh2hkhxgucgax.eastasia-01.azurewebsites.net/v1/check"
6
 
@@ -46,7 +47,8 @@ footer { display: none !important; }
46
 
47
  def check_prompt(prompt):
48
  try:
49
- response = requests.post(API_URL, json={"prompt": prompt})
 
50
  result = response.json()
51
 
52
  # Format the output for the UI
 
1
  import gradio as gr
2
  import requests
3
  import datetime
4
+ import os
5
 
6
  API_URL = "https://agent-shield-chbxh2hkhxgucgax.eastasia-01.azurewebsites.net/v1/check"
7
 
 
47
 
48
  def check_prompt(prompt):
49
  try:
50
+ API_KEY = os.environ.get("AGENT_SHIELD_API_KEY", "")
51
+ response = requests.post(API_URL, json={"prompt": prompt}, headers={"X-API-Key": API_KEY})
52
  result = response.json()
53
 
54
  # Format the output for the UI