AEUPH commited on
Commit
63bef3f
·
verified ·
1 Parent(s): d3f064d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -9,6 +9,21 @@ def filter_non_alphanumeric(text):
9
  alphanumeric_text = re.sub(r'[^a-zA-Z0-9\s]', '', text)
10
  return alphanumeric_text
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  def chatbot_api(input_text):
13
  url = "https://chat.tune.app/api/chat/completions"
14
  headers = {
 
9
  alphanumeric_text = re.sub(r'[^a-zA-Z0-9\s]', '', text)
10
  return alphanumeric_text
11
 
12
+ def send_to_corrade(filtered_response):
13
+ CORRADE_URL = "http://216.168.124.120:8080"
14
+ GROUP_UUID = "e269893f-a570-0087-930e-6ba2a0b77f9c"
15
+ PASSWORD = "nucleus"
16
+ data = {
17
+ "command": "tell",
18
+ "group": GROUP_UUID,
19
+ "password": PASSWORD,
20
+ "message": filtered_response,
21
+ "entity": "local",
22
+ "type": "Normal"
23
+ }
24
+ response = requests.post(CORRADE_URL, data=data)
25
+ return response.status_code == 200
26
+
27
  def chatbot_api(input_text):
28
  url = "https://chat.tune.app/api/chat/completions"
29
  headers = {