Spaces:
Runtime error
Runtime error
beta
Browse files
app.py
CHANGED
@@ -47,8 +47,17 @@ def load_answer(question):
|
|
47 |
assistant_answer = llm.invoke(st.session_state.sessionMessages)
|
48 |
# Appending the assistance answer in conversation
|
49 |
st.session_state.sessionMessages.append(AIMessage(content = assistant_answer))
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
# User message
|
54 |
def get_text():
|
|
|
47 |
assistant_answer = llm.invoke(st.session_state.sessionMessages)
|
48 |
# Appending the assistance answer in conversation
|
49 |
st.session_state.sessionMessages.append(AIMessage(content = assistant_answer))
|
50 |
+
try:
|
51 |
+
# Your code to process the AIMessage
|
52 |
+
processed_content = assistant_answer.content
|
53 |
+
except ValidationError as e:
|
54 |
+
# Extract content from the error message or the AIMessage object itself
|
55 |
+
error_message = str(e)
|
56 |
+
# Parse the error message to extract the content
|
57 |
+
content = extract_content_from_error_message(error_message)
|
58 |
+
processed_content = content
|
59 |
+
|
60 |
+
return processed_content
|
61 |
|
62 |
# User message
|
63 |
def get_text():
|