File size: 1,806 Bytes
98b8ff7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff0624e
98b8ff7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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)