Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -87,26 +87,29 @@ import base64
|
|
87 |
import os
|
88 |
|
89 |
def function(Textbox,Textbox2,Textbox3):
|
90 |
-
if
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
108 |
else:
|
109 |
-
|
110 |
else:
|
111 |
target = os.environ.get("target")
|
112 |
target2 = os.environ.get("target2")
|
@@ -138,8 +141,8 @@ def function(Textbox,Textbox2,Textbox3):
|
|
138 |
return reply
|
139 |
except:
|
140 |
return "Please Wait!"
|
141 |
-
|
142 |
-
|
143 |
|
144 |
inputs = [
|
145 |
gr.inputs.Textbox(label="Textbox",type="text"),
|
|
|
87 |
import os
|
88 |
|
89 |
def function(Textbox,Textbox2,Textbox3):
|
90 |
+
if Textbox3 == target:
|
91 |
+
if "/web" in Textbox.lower() or "web" in Textbox.lower():
|
92 |
+
try:
|
93 |
+
prompt = Textbox.replace("/web","")
|
94 |
+
except:
|
95 |
+
prompt = Textbox.replace("web","")
|
96 |
+
payload = {
|
97 |
+
"Body":prompt,
|
98 |
+
"From":f"4b7cec35-d15b-422d-838f-b25583bde426{random.randint(1,100)}"
|
99 |
+
}
|
100 |
+
href = os.environ.get("href")
|
101 |
+
response = requests.post(href,data=payload)
|
102 |
+
|
103 |
+
data = response.json()
|
104 |
+
data = data["message"]
|
105 |
+
if "Lexii" in data:
|
106 |
+
trigger = os.environ.get("trigger")
|
107 |
+
data = data.replace(trigger,"John")
|
108 |
+
return data
|
109 |
+
else:
|
110 |
+
return data
|
111 |
else:
|
112 |
+
return "Failed"
|
113 |
else:
|
114 |
target = os.environ.get("target")
|
115 |
target2 = os.environ.get("target2")
|
|
|
141 |
return reply
|
142 |
except:
|
143 |
return "Please Wait!"
|
144 |
+
else:
|
145 |
+
return "Failed"
|
146 |
|
147 |
inputs = [
|
148 |
gr.inputs.Textbox(label="Textbox",type="text"),
|