Spaces:
Sleeping
Sleeping
Update utils/session_history.py
Browse files- utils/session_history.py +25 -25
utils/session_history.py
CHANGED
@@ -149,31 +149,31 @@ class ChatbotInterface:
|
|
149 |
self.reset_button = self.config["chatbot_reset_button"]
|
150 |
self.submit_button = self.config["chatbot_submit_button"]
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
|
178 |
|
179 |
@staticmethod
|
|
|
149 |
self.reset_button = self.config["chatbot_reset_button"]
|
150 |
self.submit_button = self.config["chatbot_submit_button"]
|
151 |
|
152 |
+
# Initialize ResponseManager with custom parameters
|
153 |
+
try:
|
154 |
+
self.response_manager = ResponseManager(
|
155 |
+
model=model,
|
156 |
+
temperature=temperature,
|
157 |
+
max_output_tokens=max_output_tokens,
|
158 |
+
max_num_results=max_num_results,
|
159 |
+
vector_store_id=vector_store_id,
|
160 |
+
api_key=api_key,
|
161 |
+
meta_prompt_file=meta_prompt_file
|
162 |
+
)
|
163 |
+
self.generate_response = self.response_manager.generate_response
|
164 |
+
logging.info(
|
165 |
+
"ChatbotInterface initialized with the following parameters:\n"
|
166 |
+
f" - Model: {model}\n"
|
167 |
+
f" - Temperature: {temperature}\n"
|
168 |
+
f" - Max Output Tokens: {max_output_tokens}\n"
|
169 |
+
f" - Max Number of Results: {max_num_results}\n"
|
170 |
+
f" - Vector Store ID: {vector_store_id}\n"
|
171 |
+
f" - API Key: {'Provided' if api_key else 'Not Provided'}\n"
|
172 |
+
f" - Meta Prompt File: {meta_prompt_file or 'Default'}"
|
173 |
+
)
|
174 |
+
except Exception as e:
|
175 |
+
logging.error(f"Failed to initialize ResponseManager: {e}")
|
176 |
+
raise
|
177 |
|
178 |
|
179 |
@staticmethod
|