Walterchamy
commited on
Commit
•
b3b1714
1
Parent(s):
8ac6a82
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import streamlit as st
|
|
4 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
5 |
|
6 |
KIITEC_CONTENT = """
|
|
|
7 |
KIITEC is a technical institution registered by NACTE (REG/EOS/027) based in Moshono, Arusha next to Masai Camp.
|
8 |
|
9 |
The institute was founded in 2004 by French engineers and has thence contrived to produce the most competent technicians in the country. The institute is financed and supported by two NGOs: The Foundation for Technical Education (FTE-Swiss) and Action Development Education International (ADEI-French). In 2004, ADEI's partner FTE built the Kilimanjaro International Institute of Telecommunications, Electronics and Computers (KIITEC) introducing state-of-the-art teaching facilities to train technicians in Arusha, Tanzania.
|
@@ -80,7 +81,7 @@ def generate_response(user_input):
|
|
80 |
response = openai.ChatCompletion.create(
|
81 |
model="gpt-3.5-turbo",
|
82 |
messages=[
|
83 |
-
{"role": "system", "content": "All your answers should be in Swahili or English. Consider the language that the user has asked with
|
84 |
{"role": "assistant", "content": "Hi, is there any question concerning about DB Kiitec that I might help with?"},
|
85 |
{"role": "user", "content": user_input},
|
86 |
]
|
@@ -88,7 +89,7 @@ def generate_response(user_input):
|
|
88 |
return response['choices'][0]['message']['content']
|
89 |
|
90 |
def main():
|
91 |
-
st.title("
|
92 |
user_input = st.text_input("Enter your question:")
|
93 |
if st.button("Generate"):
|
94 |
with st.spinner("Generating Response...."):
|
|
|
4 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
5 |
|
6 |
KIITEC_CONTENT = """
|
7 |
+
|
8 |
KIITEC is a technical institution registered by NACTE (REG/EOS/027) based in Moshono, Arusha next to Masai Camp.
|
9 |
|
10 |
The institute was founded in 2004 by French engineers and has thence contrived to produce the most competent technicians in the country. The institute is financed and supported by two NGOs: The Foundation for Technical Education (FTE-Swiss) and Action Development Education International (ADEI-French). In 2004, ADEI's partner FTE built the Kilimanjaro International Institute of Telecommunications, Electronics and Computers (KIITEC) introducing state-of-the-art teaching facilities to train technicians in Arusha, Tanzania.
|
|
|
81 |
response = openai.ChatCompletion.create(
|
82 |
model="gpt-3.5-turbo",
|
83 |
messages=[
|
84 |
+
{"role": "system", "content": "All your answers should be in Swahili or English. Consider the language that the user has asked with, and your name is kiitec virtual assistant your designed or created by WALTER RICHARD 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},
|
85 |
{"role": "assistant", "content": "Hi, is there any question concerning about DB Kiitec that I might help with?"},
|
86 |
{"role": "user", "content": user_input},
|
87 |
]
|
|
|
89 |
return response['choices'][0]['message']['content']
|
90 |
|
91 |
def main():
|
92 |
+
st.title("KIITEC VIRTUAL ASSISTANT")
|
93 |
user_input = st.text_input("Enter your question:")
|
94 |
if st.button("Generate"):
|
95 |
with st.spinner("Generating Response...."):
|