Walterchamy
commited on
Commit
•
8ac6a82
1
Parent(s):
32059b5
Update app.py
Browse files
app.py
CHANGED
@@ -80,18 +80,12 @@ 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
|
84 |
-
{"role": "assistant", "content": "
|
85 |
{"role": "user", "content": user_input},
|
86 |
]
|
87 |
)
|
88 |
-
|
89 |
-
|
90 |
-
# Incorporate the content about KIITEC into the assistant's response
|
91 |
-
if "kiitec" in user_input.lower():
|
92 |
-
assistant_response += "\n\n" + "Here is some information about KIITEC:\n" + KIITEC_CONTENT
|
93 |
-
|
94 |
-
return assistant_response
|
95 |
|
96 |
def main():
|
97 |
st.title("Chatbot Assistant")
|
@@ -103,4 +97,3 @@ def main():
|
|
103 |
|
104 |
if __name__ == '__main__':
|
105 |
main()
|
106 |
-
|
|
|
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. 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},
|
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 |
]
|
87 |
)
|
88 |
+
return response['choices'][0]['message']['content']
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
def main():
|
91 |
st.title("Chatbot Assistant")
|
|
|
97 |
|
98 |
if __name__ == '__main__':
|
99 |
main()
|
|