MCPcopy
hub / github.com/alejandro-ao/ask-multiple-pdfs / handle_userinput

Function handle_userinput

app.py:54–64  ·  view source on GitHub ↗
(user_question)

Source from the content-addressed store, hash-verified

52
53
54def handle_userinput(user_question):
55 response = st.session_state.conversation({'question': user_question})
56 st.session_state.chat_history = response['chat_history']
57
58 for i, message in enumerate(st.session_state.chat_history):
59 if i % 2 == 0:
60 st.write(user_template.replace(
61 "{{MSG}}", message.content), unsafe_allow_html=True)
62 else:
63 st.write(bot_template.replace(
64 "{{MSG}}", message.content), unsafe_allow_html=True)
65
66
67def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected