Skip to content

Commit

Permalink
pop user message
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-cnivera committed Oct 24, 2024
1 parent c3d0477 commit 6b26bd9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions journeys/iteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def process_message(_conn: SnowflakeConnection, prompt: str) -> None:
)
except ValueError as e:
st.error(e)
# Remove the user message from the chat history if the request fails.
# We should only save messages to history for successful (user, assistant) turns.
st.session_state.messages.pop()


def show_expr_for_ref(message_index: int) -> None:
Expand Down

0 comments on commit 6b26bd9

Please sign in to comment.