Spaces:
Running
Running
moved device_id and feedback to app.py
Browse files
app.py
CHANGED
@@ -5,10 +5,18 @@ from st_app import launch_bot
|
|
5 |
|
6 |
import nest_asyncio
|
7 |
import asyncio
|
|
|
8 |
|
9 |
import sqlite3
|
10 |
from datasets import load_dataset
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
def setup_db():
|
13 |
db_path = 'cfpb_database.db'
|
14 |
conn = sqlite3.connect(db_path)
|
|
|
5 |
|
6 |
import nest_asyncio
|
7 |
import asyncio
|
8 |
+
import uuid
|
9 |
|
10 |
import sqlite3
|
11 |
from datasets import load_dataset
|
12 |
|
13 |
+
# Setup for HTTP API Calls to Amplitude Analytics
|
14 |
+
if 'device_id' not in st.session_state:
|
15 |
+
st.session_state.device_id = str(uuid.uuid4())
|
16 |
+
|
17 |
+
if "feedback_key" not in st.session_state:
|
18 |
+
st.session_state.feedback_key = 0
|
19 |
+
|
20 |
def setup_db():
|
21 |
db_path = 'cfpb_database.db'
|
22 |
conn = sqlite3.connect(db_path)
|
st_app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
from PIL import Image
|
2 |
import sys
|
3 |
-
import uuid
|
4 |
|
5 |
import streamlit as st
|
6 |
from streamlit_pills import pills
|
@@ -13,14 +12,6 @@ from agent import initialize_agent, get_agent_config
|
|
13 |
|
14 |
initial_prompt = "How can I help you today?"
|
15 |
|
16 |
-
# Setup for HTTP API Calls to Amplitude Analytics
|
17 |
-
if 'device_id' not in st.session_state:
|
18 |
-
st.session_state.device_id = str(uuid.uuid4())
|
19 |
-
|
20 |
-
|
21 |
-
if "feedback_key" not in st.session_state:
|
22 |
-
st.session_state.feedback_key = 0
|
23 |
-
|
24 |
def toggle_logs():
|
25 |
st.session_state.show_logs = not st.session_state.show_logs
|
26 |
|
|
|
1 |
from PIL import Image
|
2 |
import sys
|
|
|
3 |
|
4 |
import streamlit as st
|
5 |
from streamlit_pills import pills
|
|
|
12 |
|
13 |
initial_prompt = "How can I help you today?"
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
def toggle_logs():
|
16 |
st.session_state.show_logs = not st.session_state.show_logs
|
17 |
|