Retrieve file in python client.files.retrieve

Hi, I’ve been trying to retrieve a CSV file from an assistant. However, I don’t know how to extract the content from the retrieval output object.

My code looks like this:

csv_file_response = client.files.retrieve(file_id=st.session_state.main_csv.id)
    with st.spinner("Cargando csv..."):
        while csv_file_response.status != 'processed':
            csv_file_response = client.files.content(file_id=st.session_state.main_csv.id)
            st.write(csv_file_response.status)
            time.sleep(1)
    
    st.write(csv_file_response)

I followed the documentation so I don’t know why it’s not working.
https://platform.openai.com/docs/api-reference/files/retrieve-contents

Thank you in advance!