david-oplatka commited on
Commit
4898d56
1 Parent(s): 37a5343

Remove Debug Statements

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -27,9 +27,9 @@ headers = {
27
  amp_api_key = os.getenv('AMPLITUDE_TOKEN')
28
 
29
  def thumbs_feedback(feedback, **kwargs):
30
- print(f'Debug: Feedback Received {feedback["score"]} FROM user question {kwargs.get("prompt", "No user input")} AND chat response {kwargs.get("response", "No chat response")}')
31
-
32
- # Send feedback to Amplitude Analytics
33
  data = {
34
  "api_key": amp_api_key,
35
  "events": [{
@@ -44,9 +44,7 @@ def thumbs_feedback(feedback, **kwargs):
44
  }]
45
  }
46
  response = requests.post('https://api2.amplitude.com/2/httpapi', headers=headers, data=json.dumps(data))
47
- if response.status_code == 200:
48
- print(f"Request successfully sent: {response.json()}")
49
- else:
50
  print(f"Request failed with status code {response.status_code}. Response Text: {response.text}")
51
 
52
  st.session_state.feedback_key += 1
@@ -170,9 +168,7 @@ def launch_bot():
170
  }]
171
  }
172
  response = requests.post('https://api2.amplitude.com/2/httpapi', headers=headers, data=json.dumps(data))
173
- if response.status_code == 200:
174
- print(f"Request successfully sent: {response.json()}")
175
- else:
176
  print(f"Request failed with status code {response.status_code}. Response Text: {response.text}")
177
 
178
  st.session_state.ex_prompt = None
 
27
  amp_api_key = os.getenv('AMPLITUDE_TOKEN')
28
 
29
  def thumbs_feedback(feedback, **kwargs):
30
+ """
31
+ Sends feedback to Amplitude Analytics
32
+ """
33
  data = {
34
  "api_key": amp_api_key,
35
  "events": [{
 
44
  }]
45
  }
46
  response = requests.post('https://api2.amplitude.com/2/httpapi', headers=headers, data=json.dumps(data))
47
+ if response.status_code != 200:
 
 
48
  print(f"Request failed with status code {response.status_code}. Response Text: {response.text}")
49
 
50
  st.session_state.feedback_key += 1
 
168
  }]
169
  }
170
  response = requests.post('https://api2.amplitude.com/2/httpapi', headers=headers, data=json.dumps(data))
171
+ if response.status_code != 200:
 
 
172
  print(f"Request failed with status code {response.status_code}. Response Text: {response.text}")
173
 
174
  st.session_state.ex_prompt = None