Spaces:
Runtime error
Runtime error
Commit
·
fa65cb6
1
Parent(s):
692155d
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,18 +63,11 @@ option = st.selectbox('What is your role?', ('Support', 'Sales'))
|
|
| 63 |
st.write('You selected', option)
|
| 64 |
|
| 65 |
prompt = st.chat_input("Say something to our #CodeWars bot...")
|
| 66 |
-
|
| 67 |
-
st.write(f"{datetime.datetime.now()} :red[{option}:] ", prompt)
|
| 68 |
-
|
| 69 |
-
response = requests.get("https://dummyjson.com/products/1").text
|
| 70 |
-
|
| 71 |
-
st.write(f"{datetime.datetime.now()} :red[Bot:] ", response)
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
context = [] # the context stores a conversation history, you can use this to make the model more context aware
|
| 75 |
while True:
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
| 80 |
prompt = st.chat_input("Say something to our #CodeWars bot...")
|
|
|
|
| 63 |
st.write('You selected', option)
|
| 64 |
|
| 65 |
prompt = st.chat_input("Say something to our #CodeWars bot...")
|
| 66 |
+
context = [] # the context stores a conversation history, you can use this to make the model more context aware
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
while True:
|
| 68 |
+
if(prompt):
|
| 69 |
+
st.write(f"{datetime.datetime.now()} :red[{option}:] ", prompt)
|
| 70 |
+
response = qachain({"query": prompt})
|
| 71 |
+
|
| 72 |
+
st.write(f"{datetime.datetime.now()} :red[Bot:] ", context['result'])
|
| 73 |
prompt = st.chat_input("Say something to our #CodeWars bot...")
|