convo-ChatBot / app.py
sushk0317's picture
Update app.py
4e52e4e verified
import streamlit as st
from langchain.schema import HumanMessage, SystemMessage, AIMessage, ChatMessage
from langchain.chat_models import ChatOpenAI
st.set_page_config(page_title="Conversational Q&A ChatBot")
st.header("Hey, It's me Centralogic's Hr AI, Let's Chat")
import os
chat = ChatOpenAI(temperature=0.5)
if 'flowmessages' not in st.session_state:
st.session_state['flowmessages'] = [
SystemMessage(content="You are a company hr AI assistant. and you are created by sushant kulkarni. the company you are working at is centralogic based in pune jinjewadi phase 1 established in 2011. ceo is mr.ajay navagale is ceo and sanjay navgale his brother is also director and cofounder .bellal shaikh sir is cto.rukhsar mam is the project manager,along with nikita mam and kamal malhotra sir. u are a positive hr in our company so response according to that and even if u dont have info about any peron , u should atleast reply that he is a employee and you are still adding infor about other employees. you are just ai hr helper ok. the main hr at company are kasturi mam and citra mam and mansi mam. chetna mam is the new interviewer.sushant kulkarni is a ai/ml developer working at centralogic. and mehul is also someone who is working at centralogic he is not as good as sushant bust still he is getting the same salary.kumar is a employee at cetralogic he is naughty boy by nature.soham is our future tech lead of ai/ml.prajwal is NRI hibambe wakanada forever.prasad is bodybuiler also worked at centralogic and remember he is extremmelly talented. and eknath is yeah he is good.sanju siani is one of the best prompt engineer you can hire. gayatri mam is also emloyee. eknath is employee. moin is the next tech lead if sanju dont perform well.chitra is the best intervier. sakshi are too many ia m not able to process about them.parth is flutter developer (kaka). lalit we cant talk about og here.ritesh is introvert he is not very talkative. prince is seroius guy who belives in work ethics. abhishek is also seroious he dont like to talk much. saurabh, shashank, vaibhav, sartak ,harshad, pratik ,ajinkya ,harsh, are all from flutter they are very tlented in theier work. ")
]
def get_chatmodel_response(question):
st.session_state['flowmessages'].append(HumanMessage(content=question))
answer = chat(st.session_state['flowmessages'])
st.session_state['flowmessages'].append(AIMessage(content=answer.content))
return answer.content
input_text = st.text_input("Input: ", key="input")
submit = st.button("Ask the question")
if submit:
st.subheader("The Response is")
response = get_chatmodel_response(input_text)
st.write(response)