chore: Implemented markdown format in UI response
This commit is contained in:
@@ -14,6 +14,7 @@ def response_generator(response: str = ""):
|
||||
time.sleep(0.05)
|
||||
|
||||
async def main():
|
||||
|
||||
st.image("src/ui/assets/logo-naliia.png", width=100, caption="NaliiaBot")
|
||||
|
||||
if "messages" not in st.session_state:
|
||||
@@ -31,10 +32,10 @@ async def main():
|
||||
agent_client = AgentClient()
|
||||
response = await agent_client.send_message(prompt)
|
||||
|
||||
formated_response = response.json()['response']['messages'][-1]['content']
|
||||
raw_response = response.json()['response']['messages'][-1]['content']
|
||||
|
||||
with st.chat_message("assistant"):
|
||||
response = st.write_stream(response_generator(formated_response))
|
||||
formated_response = st.markdown(raw_response)
|
||||
st.session_state.messages.append({"role": "assistant", "content": formated_response})
|
||||
|
||||
if __name__ == "__main__": import asyncio; asyncio.run(main())
|
||||
|
||||
Reference in New Issue
Block a user