essentially the program is supposed to generate a question upon the user inputting certain information. The user should be able to get a new question when the next button is pressed. this is working fine. The issue is that I want the screen to only have the new question on it rather than the previous questions as well.
if st.session_state[“start”] == 0:
try:
response = get_answer(job_description, candidate_profile)
keywords = set(job_description.split() + candidate_profile.split())
keywords = [word.strip(“,.()”) for word in keywords if len(word) > 2] # Remove short words and punctuation
highlighted_response = highlight_keywords(response, keywords)
annotated_text(*highlighted_response)
st.session_state[“start”] = 1
except Exception as e:
st.error(f"Error calling OpenAI API: {e}")
# Place the "Next" button below the responses
st.write("") # Adding space between responses and the button
if st.button("Next", key="next_button_below"):
try:
st.session_state["start"] = 0
st.rerun()
except Exception as e:
st.error(f"Error calling OpenAI API: {e}")