Spaces:
Sleeping
Sleeping
Update utils/chatbot_interface2.py
Browse files- utils/chatbot_interface2.py +1 -24
utils/chatbot_interface2.py
CHANGED
|
@@ -47,7 +47,7 @@ class ChatbotInterface:
|
|
| 47 |
meta_prompt_file=meta_prompt_file
|
| 48 |
)
|
| 49 |
# self.generate_response = self.response_manager.generate_response
|
| 50 |
-
|
| 51 |
self.generate_response = lambda user_message, chat_history: (
|
| 52 |
self.response_manager.generate_response(user_message, chat_history),
|
| 53 |
""
|
|
@@ -143,29 +143,6 @@ class ChatbotInterface:
|
|
| 143 |
# variant="primary",
|
| 144 |
# elem_id="ask-button"
|
| 145 |
# )
|
| 146 |
-
|
| 147 |
-
# # Define a local function to process input:
|
| 148 |
-
# def process_input(self, user_message, chat_history):
|
| 149 |
-
# """
|
| 150 |
-
# Call generate_response with the user's message and chat history.
|
| 151 |
-
# Return a tuple with the updated chat history and an empty string to clear the input.
|
| 152 |
-
# """
|
| 153 |
-
# updated_history = self.generate_response(user_message, chat_history)
|
| 154 |
-
# return updated_history, ""
|
| 155 |
-
|
| 156 |
-
# # Button actions
|
| 157 |
-
# submit.click(
|
| 158 |
-
# fn=self.generate_response,
|
| 159 |
-
# inputs=[user_input, chatbot_output],
|
| 160 |
-
# outputs=chatbot_output)
|
| 161 |
-
# user_input.submit(
|
| 162 |
-
# fn=self.generate_response,
|
| 163 |
-
# inputs=[user_input, chatbot_output],
|
| 164 |
-
# outputs=chatbot_output)
|
| 165 |
-
# reset.click(
|
| 166 |
-
# fn=self.reset_output,
|
| 167 |
-
# inputs=None,
|
| 168 |
-
# outputs=chatbot_output)
|
| 169 |
|
| 170 |
# Button actions
|
| 171 |
submit.click(
|
|
|
|
| 47 |
meta_prompt_file=meta_prompt_file
|
| 48 |
)
|
| 49 |
# self.generate_response = self.response_manager.generate_response
|
| 50 |
+
# Returns a tuple with the updated chat history and an empty string to clear the input.
|
| 51 |
self.generate_response = lambda user_message, chat_history: (
|
| 52 |
self.response_manager.generate_response(user_message, chat_history),
|
| 53 |
""
|
|
|
|
| 143 |
# variant="primary",
|
| 144 |
# elem_id="ask-button"
|
| 145 |
# )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
# Button actions
|
| 148 |
submit.click(
|