Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -29,7 +29,7 @@ def get_response(user_input): | |
| 29 | 
             
                return response.json()
         | 
| 30 |  | 
| 31 | 
             
            # Streamlit chat UI
         | 
| 32 | 
            -
            st.title(" | 
| 33 |  | 
| 34 | 
             
            # Display the chat history
         | 
| 35 | 
             
            for message in st.session_state.messages:
         | 
| @@ -49,4 +49,4 @@ if user_input: | |
| 49 | 
             
                # Assuming the response is in the 'choices' field of the API response
         | 
| 50 | 
             
                bot_response = response.get('choices', [{}])[0].get('message', {}).get('content', 'Sorry, I did not understand that.')
         | 
| 51 | 
             
                st.session_state.messages.append({"role": "assistant", "content": bot_response})
         | 
| 52 | 
            -
                st. | 
|  | |
| 29 | 
             
                return response.json()
         | 
| 30 |  | 
| 31 | 
             
            # Streamlit chat UI
         | 
| 32 | 
            +
            st.title("Kursus AI chatbot")
         | 
| 33 |  | 
| 34 | 
             
            # Display the chat history
         | 
| 35 | 
             
            for message in st.session_state.messages:
         | 
|  | |
| 49 | 
             
                # Assuming the response is in the 'choices' field of the API response
         | 
| 50 | 
             
                bot_response = response.get('choices', [{}])[0].get('message', {}).get('content', 'Sorry, I did not understand that.')
         | 
| 51 | 
             
                st.session_state.messages.append({"role": "assistant", "content": bot_response})
         | 
| 52 | 
            +
                st.rerun()  # Corrected line to rerun the app after the response is added
         | 
