import streamlit as st from utils import generate_text_embeddings st.title("Echo Bot") if "messages" not in st.session_state: st.session_state.messages = [] with st.sidebar : st.markdown("# Inference Analytics") st.markdown("---") st.markdown("Tokens used :") st.markdown("Average Querying Time :") st.markdown("Average Inference Time :") st.markdown("Cost Incurred :") for message in st.session_state.messages: with st.chat_message(message["role"]): st.markdown(message["content"]) if prompt := st.chat_input("What is up?"): query_embeddings = generate_text_embeddings(prompt) st.chat_message("user").markdown(prompt) st.session_state.messages.append({"role": "user", "content": prompt}) response = f"Echo: {prompt}" with st.chat_message("assistant"): st.markdown(response) st.session_state.messages.append({"role": "assistant", "content": response})