Update app_template.py
Browse files- app_template.py +9 -7
app_template.py
CHANGED
@@ -27,16 +27,18 @@ def predict_beta(message, chatbot=[], system_prompt=""):
|
|
27 |
advanced,
|
28 |
fn_index=0
|
29 |
)
|
30 |
-
|
31 |
-
if result is not None
|
32 |
-
bot_message
|
33 |
-
return
|
34 |
else:
|
35 |
-
|
36 |
-
|
|
|
37 |
except Exception as e:
|
38 |
error_msg = f"An error occurred: {str(e)}"
|
39 |
-
|
|
|
40 |
|
41 |
def test_preview_chatbot(message, history):
|
42 |
response = predict_beta(message, history, SYSTEM_PROMPT)
|
|
|
27 |
advanced,
|
28 |
fn_index=0
|
29 |
)
|
30 |
+
print("Raw API Response:", result) # Debugging print
|
31 |
+
if result is not None:
|
32 |
+
print("Processed bot_message:", result) # Debugging print
|
33 |
+
return result
|
34 |
else:
|
35 |
+
print("No response or empty response from the model.") # Debugging print
|
36 |
+
return None
|
37 |
+
|
38 |
except Exception as e:
|
39 |
error_msg = f"An error occurred: {str(e)}"
|
40 |
+
print(error_msg) # Debugging print
|
41 |
+
return None
|
42 |
|
43 |
def test_preview_chatbot(message, history):
|
44 |
response = predict_beta(message, history, SYSTEM_PROMPT)
|