Recurrant questions based upon conditions

  1. Are you running your app locally or is it deployed? - locally
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform? - Not yet
    b. Share the link to the public deployed app. - not ready
  3. Share the link to your app’s public GitHub repository (including a requirements file). - didn’t pushed the code yet
  4. Share the full text of the error message (not a screenshot). - okay
  5. Share the Streamlit and Python versions. - latest

CODE
st.title(“Ilore property: Your dream home awaits”)
with st.chat_message(“user”):
search_query = st.text_input(“Search your property”)

if search_query:       
    # Extract entities from the search query
    extracted_entities = get_entity(search_query)
    print('json output ---')
    print(type(extracted_entities))
    st.write('extracted_entities = '+str(extracted_entities))
    # Fill JSON data with extracted entities
    # for key, value in extracted_entities.items():
    #     data[key] = value

    
    if extracted_entities["province"] and extracted_entities["city"] and extracted_entities['location'] == '':
        # and data["city"] and data['location'] 
        # st.write('Kindly share the location (city and province) where you want to have a property.')
        asking_location = st.chat_input("Kindly share the location (city and province) where you want to have a property.")
        # st.write('Kindly share the location (city and province) where you want to have a property.')
        # asking_location = st.text_input("Kindly share the location (city and province) where you want to have a property.")
        extracted_entities['location'] = str(asking_location)
        
    elif extracted_entities['bedroom'] == '':
        asking_bedroom = st.chat_input("Kindly share the prefered no of bedrooms")
        extracted_entities['bedroom'] = int(asking_bedroom)
        st.write('extracted_entities = '+str(extracted_entities))

    elif extracted_entities['washroom'] == '':
        asking_washroom = st.chat_input("Kindly share the prefered no of washrooms")
        extracted_entities['washroom'] = int(asking_washroom)
        st.write('extracted_entities = '+str(extracted_entities))

    elif extracted_entities['garage'] == '':
        asking_garage = st.chat_input("Kindly share the prefered capacity of garage")
        extracted_entities['garage'] = int(asking_garage)
        st.write('extracted_entities = '+str(extracted_entities))

    elif extracted_entities['house_type'] == '':
        asking_house_type = st.chat_input("Kindly share the prefered house type like condo, detatched, etc ?")
        extracted_entities['house_type'] = str(asking_house_type)
        st.write('extracted_entities = '+str(extracted_entities))

    elif extracted_entities['status'] == '':
        asking_status = st.chat_input("Kindly share the prefered status - buy/lease?")
        extracted_entities['status'] = str(asking_status)
        st.write('extracted_entities = '+str(extracted_entities))

    else:
        st.write('all entities filled')
else:
    st.write('now fetch the summary')

ISSUE
It is not moving to next condition once one is checked, let suppose no of washrooms were not entered, once user entered the washroom it repeatedly ask the same question even after the value is filled.

Screenshot from 2024-04-05 17-43-29

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.