Update app.py
Browse files
app.py
CHANGED
@@ -55,26 +55,26 @@ chat_engine = index.as_chat_engine(
|
|
55 |
),
|
56 |
)
|
57 |
|
58 |
-
def is_greeting(user_input):
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
def is_bye(user_input):
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
import gradio as gr
|
69 |
def chat_with_ai(user_input, chat_history):
|
70 |
-
if is_greeting(user_input):
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
elif is_bye(user_input):
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
response = chat_engine.chat(user_input)
|
79 |
references = response.source_nodes
|
80 |
ref,pages = [],[]
|
|
|
55 |
),
|
56 |
)
|
57 |
|
58 |
+
# def is_greeting(user_input):
|
59 |
|
60 |
+
# greetings = ["hello", "hi", "hey", "good morning", "good afternoon", "good evening", "greetings"]
|
61 |
+
# user_input_lower = user_input.lower().strip()
|
62 |
+
# return any(greet in user_input_lower for greet in greetings)
|
63 |
+
# def is_bye(user_input):
|
64 |
|
65 |
+
# greetings = ["thanks", "thanks you", "thanks a lot", "good answer", "good bye", "bye bye"]
|
66 |
+
# user_input_lower = user_input.lower().strip()
|
67 |
+
# return any(greet in user_input_lower for greet in greetings)
|
68 |
import gradio as gr
|
69 |
def chat_with_ai(user_input, chat_history):
|
70 |
+
# if is_greeting(user_input):
|
71 |
+
# response = 'hi, how can i help you?'
|
72 |
+
# chat_history.append((user_input, response))
|
73 |
+
# return chat_history, ""
|
74 |
+
# elif is_bye(user_input):
|
75 |
+
# response = "you're wlocome"
|
76 |
+
# chat_history.append((user_input, response))
|
77 |
+
# return chat_history, ""
|
78 |
response = chat_engine.chat(user_input)
|
79 |
references = response.source_nodes
|
80 |
ref,pages = [],[]
|