Walterchamy commited on
Commit
dafb90b
1 Parent(s): 7fa9751

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -194,7 +194,7 @@ def generate_response(user_input):
194
  response = client.chat.completions.create(
195
  model="gpt-3.5-turbo",
196
  messages=[
197
- {"role": "system", "content": "You are a highly skilled AI assistant that can understand and answer questions in a natural and intelligent manner."},
198
  {"role": "user", "content": user_input}
199
  ]
200
  )
@@ -202,15 +202,20 @@ def generate_response(user_input):
202
 
203
 
204
  def main():
205
- st.title("Question and Answering with OpenAI")
206
- st.write("Ask a question and get an answer!")
207
 
208
- user_input = st.text_input("Enter your question:")
 
209
 
 
 
 
 
 
210
  if st.button("Answer"):
211
- with st.spinner("Generating Response..."):
212
  response_text = generate_response(user_input)
213
  st.write("Answer:", response_text)
214
-
215
  if __name__ == '__main__':
216
  main()
 
194
  response = client.chat.completions.create(
195
  model="gpt-3.5-turbo",
196
  messages=[
197
+ {"role": "system", "content": "You are a highly skilled AI assistant that can understand and answer questions in a natural and intelligent manner.so All your answers should be in Swahili or English. Consider the language that the user has asked with, and your kiitec virtual assistant your designed or created by WALTER RICHARD for more information about WALTER can call +255 624 844 661 or email [email protected] So, here we start... Your virtual assistant of DON BOSCO KIITEC. You will reply to the queries that the user might ask!\n\n" + KIITEC_CONTENT"},
198
  {"role": "user", "content": user_input}
199
  ]
200
  )
 
202
 
203
 
204
  def main():
205
+ col1, col2 = st.columns([1, 4])
 
206
 
207
+ with col1:
208
+ st.image('logo.png', caption=None, width=200, use_column_width=200)
209
 
210
+ with col2:
211
+ st.markdown("<h4 style='text-align: center; color: white;'>KILIMANJARO INTERNATIONAL INSTITUTE FOR TELECOMMUNICATION, ELECTRONICS & COMPUTERS</h4>", unsafe_allow_html=True)
212
+ st.header("KIITEC VIRTUAL ASSISTANT")
213
+ st.write("Welcome for questions concerning kiitec institution")
214
+ user_input = st.text_input("Enter your question:")
215
  if st.button("Answer"):
216
+ with st.spinner("Generating Response...."):
217
  response_text = generate_response(user_input)
218
  st.write("Answer:", response_text)
219
+ text_to_speech(response_text)
220
  if __name__ == '__main__':
221
  main()