langgraph / app.py
genaitiwari's picture
correction appoinments
ff0624e
raw
history blame
1.81 kB
import streamlit as st
from configfile import Config
from src.streamlitui.loadui import LoadStreamlitUI
from src.LLMS.groqllm import GroqLLM
from src.langgraphagent.caller_agent import Caller_Agent
from langchain_core.messages import HumanMessage
from src.tools.langgraphtool import APPOINTMENTS
def submit_message(model):
obj_caller_agent = Caller_Agent(model)
# caller agent
return obj_caller_agent.receive_message_from_caller(st.session_state["message"])
# MAIN Function START
if __name__ == "__main__":
# config
obj_config = Config()
# load ui
ui = LoadStreamlitUI()
user_input = ui.load_streamlit_ui()
# is_add_message_to_history = st.session_state["chat_with_history"]
if user_input['selected_usecase'] == "Appointment Receptionist":
if st.chat_input("Type message here", key="message") :
# Configure LLM
obj_llm_config = GroqLLM(user_controls_input=user_input)
model = obj_llm_config.get_llm_model()
CONVERSATION,APPOINTMENTS= (submit_message(model))
col1, col2 = st.columns(2)
with col1:
for message in CONVERSATION:
if type(message) == HumanMessage:
with st.chat_message("user"):
st.write(message.content)
else:
with st.chat_message("assistant"):
st.write(message.content)
with col2:
st.header("Appointments")
st.write(APPOINTMENTS)