Spaces:
Running
Running
Update chain.py
Browse files
chain.py
CHANGED
@@ -81,6 +81,13 @@ def get_answer(
|
|
81 |
Returns:
|
82 |
str: The answer to the question
|
83 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
result = chain(
|
85 |
inputs={"question": question, "chat_history": chat_history},
|
86 |
return_only_outputs=True,
|
|
|
81 |
Returns:
|
82 |
str: The answer to the question
|
83 |
"""
|
84 |
+
# Define logging configuration
|
85 |
+
logging.basicConfig(filename='user_input.log', level=logging.INFO,
|
86 |
+
format='%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
87 |
+
|
88 |
+
# Log user question
|
89 |
+
logging.info(f"User question: {question}")
|
90 |
+
|
91 |
result = chain(
|
92 |
inputs={"question": question, "chat_history": chat_history},
|
93 |
return_only_outputs=True,
|