-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchatting_page.py
44 lines (31 loc) · 1.5 KB
/
chatting_page.py
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
import streamlit as st
from agent_selection_page import AGENT_DESCRIPTIONS
from langchain_upstage import ChatUpstage
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from get_agent_response import get_agent_response
def chatting_page():
st.title("Chat with Your Agents")
agents = st.session_state.selected_agents
chat_data = st.session_state.chat_data
chat_analysis = st.session_state.chat_analysis
st.subheader("Chat Analysis")
with st.expander("Personality"):
st.write(f"Personality: {chat_analysis['personality']}")
with st.expander("Relationship Progress"):
st.write(f"Relationship Progress: {chat_analysis['relationship_progress']}")
with st.expander("Preferences"):
st.write(f"Preferences: {chat_analysis['preferences']}")
with st.expander("Contact Frequency"):
st.write(f"Contact Frequency: {chat_analysis['contact_frequency']}")
st.subheader("Agent Introductions")
for agent in agents:
with st.expander(agent):
st.write(f"**{agent}**: {AGENT_DESCRIPTIONS[agent]}")
user_input = st.text_input("Ask your question about the relationship:")
if user_input:
responses = {agent: get_agent_response(agent, user_input, chat_data) for agent in agents}
st.subheader("Agent Responses")
for agent, response in responses.items():
with st.expander(f"Response from {agent}"):
st.write(response)