david-oplatka commited on
Commit
6723b04
·
1 Parent(s): 7fe0e48

edit app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -16,9 +16,9 @@ from vectara_agent.agent import AgentStatusType
16
  from agent import initialize_agent, get_agent_config
17
 
18
  # Setup for HTTP API Call to Amplitude Analytics
19
- if 'device_id' not in globals():
20
- globals()['device_id'] = str(uuid.uuid4())
21
- print(f"DEBUG: Created new device id: {device_id}")
22
 
23
  headers = {
24
  'Content-Type': 'application/json',
@@ -116,7 +116,7 @@ def launch_bot():
116
  data = {
117
  "api_key": amp_api_key,
118
  "events": [{
119
- "device_id": device_id,
120
  "event_type": "submitted_query",
121
  "event_properties": {
122
  "query": prompt,
 
16
  from agent import initialize_agent, get_agent_config
17
 
18
  # Setup for HTTP API Call to Amplitude Analytics
19
+ if 'device_id' not in st.session_state:
20
+ st.session_state.device_id = str(uuid.uuid4())
21
+ print(f"DEBUG: Created new device id: {st.session_state.device_id}")
22
 
23
  headers = {
24
  'Content-Type': 'application/json',
 
116
  data = {
117
  "api_key": amp_api_key,
118
  "events": [{
119
+ "device_id": st.session_state.device_id,
120
  "event_type": "submitted_query",
121
  "event_properties": {
122
  "query": prompt,