this
Browse files
app.py
CHANGED
@@ -1,15 +1,22 @@
|
|
1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
2 |
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
src="https://tiiuae-falcon-180b-demo.hf.space"
|
7 |
-
frameborder="0"
|
8 |
-
width="1366"
|
9 |
-
height="768"
|
10 |
-
></iframe>
|
11 |
|
|
|
12 |
|
13 |
-
|
|
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
from streamlit_option_menu import option_menu
|
3 |
+
from pymongo import MongoClient
|
4 |
+
import os
|
5 |
+
import pandas as pd
|
6 |
|
7 |
|
8 |
+
# Connecting to MongoDB
|
9 |
+
uri = os.environ["MONGO_CONNECTION_STRING"]
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
client = MongoClient(uri, tlsCertificateKeyFile="database/cert.pem")
|
12 |
|
13 |
+
db = client["myapp"]
|
14 |
+
col = db["chatbot"]
|
15 |
|
16 |
+
|
17 |
+
def chatbot():
|
18 |
+
st.title("ChatBot")
|
19 |
+
message = st.text_input("Enter your query here")
|
20 |
+
if st.button ("Submit"):
|
21 |
+
col.insert_one({"message": message})
|
22 |
+
|