Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import requests
|
| 3 |
+
import datetime
|
| 4 |
+
|
| 5 |
+
st.header("#CodeWars localGPT", divider='rainbow')
|
| 6 |
+
|
| 7 |
+
option = st.selectbox('What is your role?', ('Support', 'Sales'))
|
| 8 |
+
|
| 9 |
+
st.write('You selected', option)
|
| 10 |
+
|
| 11 |
+
prompt = st.chat_input("Say something to our #CodeWars bot...")
|
| 12 |
+
if prompt:
|
| 13 |
+
st.write(f"{datetime.datetime.now()} :red[{option}:] ", prompt)
|
| 14 |
+
|
| 15 |
+
response = requests.get("https://dummyjson.com/products/1").json
|
| 16 |
+
|
| 17 |
+
st.write(f"{datetime.datetime.now()} :red[Bot:] ", response)
|