Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,22 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
from bardapi import Bard
|
3 |
import os
|
|
|
|
|
4 |
|
5 |
-
st.set_page_config(layout="wide")
|
6 |
|
7 |
-
|
8 |
-
|
9 |
|
|
|
|
|
10 |
|
11 |
def Chatbot():
|
12 |
-
st.title("
|
13 |
-
if
|
14 |
-
|
15 |
-
anslist = bard.get_answer(f"Make a list of suggestions: \n{bardans} n\for the betterment education: \n{advice_input}\n\nThe list should be in three sections, section 1 for quality of education, section 2 for relevance of job oriented education & section 3 for pro & cons of linking Artifical intelligence with education system.")["content"]
|
16 |
|
17 |
-
|
18 |
-
|
19 |
|
20 |
Chatbot()
|
21 |
|
|
|
1 |
+
import streamlit as st
|
|
|
2 |
import os
|
3 |
+
from bardapi import Bard
|
4 |
+
from pymongo import Mongoclient
|
5 |
|
|
|
6 |
|
7 |
+
url = os.environ["MONGO_CONNECTION_STRING"]
|
8 |
+
client = MongoClient(url,tlsCerificateKeyFile =")
|
9 |
|
10 |
+
uri = os.environ["BARD_API_KEY"]
|
11 |
+
bard = Bard(token = uri )
|
12 |
|
13 |
def Chatbot():
|
14 |
+
st.title("chatbot")
|
15 |
+
if query:= st.chat_input("Enter your message"):
|
16 |
+
umsg = bard.get_answer(query)
|
|
|
17 |
|
18 |
+
with st.chat_message("assistant"):
|
19 |
+
st.write(umsg["content"])
|
20 |
|
21 |
Chatbot()
|
22 |
|