MCPcopy Create free account
hub / github.com/aws-samples/sample-devgenius-aws-solution-builder / reset_messages

Function reset_messages

chatbot/agent.py:116–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114
115# Reset the chat history in session state
116def 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

Callers 1

agent.pyFile · 0.85

Calls 3

invoke_bedrock_agentFunction · 0.90
read_agent_responseFunction · 0.90
get_initial_questionFunction · 0.85

Tested by

no test coverage detected