()
| 114 | |
| 115 | # Reset the chat history in session state |
| 116 | def reset_messages(): |
| 117 | # st.session_state['conversation_id'] = str(uuid.uuid4()) |
| 118 | |
| 119 | initial_question = get_initial_question(st.session_state.topic_selector) |
| 120 | st.session_state.messages = [{"role": "assistant", "content": "Welcome to DevGenius — turning ideas into reality. Together, we’ll design your architecture and solution, with each conversation shaping your vision. Let’s get started on building!"}] |
| 121 | |
| 122 | if initial_question: |
| 123 | st.session_state.messages.append({"role": "user", "content": initial_question}) |
| 124 | response = invoke_bedrock_agent(st.session_state.conversation_id, initial_question) |
| 125 | event_stream = response['completion'] |
| 126 | ask_user, agent_answer = read_agent_response(event_stream) |
| 127 | st.session_state.messages.append({"role": "assistant", "content": agent_answer}) |
| 128 | |
| 129 | |
| 130 | # Function to format assistant's response for markdown |
no test coverage detected