Ankush05 commited on
Commit
26bc5a4
1 Parent(s): d640be6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
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
- uri = os.environ["BARD_API_KEY"]
8
- bard = Bard(token = uri)
9
 
 
 
10
 
11
  def Chatbot():
12
- st.title("Chatbot")
13
- if advice_input := st.chat_input("Measures for better education ecosystem in India. e.g: how we can education wiil be more accessible, affordable & promote innovation. Comments shall be specific & factful."):
14
- bardans = bard.get_answer(advice_input)['content']
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
- with st.chat_message("assistant"):
18
- st.write(f"What to be done to achieve better education:\n{bardans}\nHow we can:\n{anslist}")
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