Skip to content

Commit

Permalink
chat_message update
Browse files Browse the repository at this point in the history
  • Loading branch information
jiatastic committed Jul 5, 2023
1 parent c832426 commit 4c9e2e3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 66 deletions.
27 changes: 5 additions & 22 deletions pages/Behavioral Screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,10 @@ def answer_call_back():
evaluation = st.session_state.feedback.run("please give evalution regarding the interview")
st.markdown(evaluation)
st.stop()

# keep interview
else:
with answer_placeholder:
answer = audio_recorder(pause_threshold=2.5, sample_rate=44100)

if answer:
st.session_state['answer'] = answer
audio = answer_call_back()
Expand All @@ -221,27 +219,12 @@ def answer_call_back():
for answer in st.session_state.history:
if answer:
if answer.origin == 'ai':
div = f"""<div class="chat-row">
<img class="chat-icon" src="static/images/chat.png" width=32 height=32>
<div class="chat-bubble ai-bubble">
&#8203;{answer.message}
</div>
</div>
"""
st.markdown(div, unsafe_allow_html=True)
st.write(audio)

with st.chat_message("assistant"):
st.write(answer.message)
st.write(audio)
else:
div = f"""<div class="chat-row row-reverse">
<img class="chat-icon" src="static/images/user.png" width=32 height=32>
<div class="chat-bubble human-bubble">
&#8203;{answer.message}
</div>
</div>
"""
st.markdown(div, unsafe_allow_html=True)
for _ in range(3):
st.markdown("")
with st.chat_message("user"):
st.write(answer.message)

credit_card_placeholder.caption(f"""
Used {st.session_state.token_count} tokens \n
Expand Down
26 changes: 5 additions & 21 deletions pages/Resume Screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,28 +222,12 @@ def answer_call_back():
for answer in st.session_state.resume_history:
if answer:
if answer.origin == 'ai':
div = f"""<div class="chat-row">
<img class="chat-icon" src="static/images/chat.png" width=32 height=32>
<div class="chat-bubble ai-bubble">
&#8203;{answer.message}
</div>
</div>
"""
st.markdown(div, unsafe_allow_html=True)
st.write(audio_widget)

with st.chat_message("assistant"):
st.write(answer.message)
st.write(audio_widget)
else:
div = f"""<div class="chat-row row-reverse">
<img class="chat-icon" src="static/images/user.png" width=32 height=32>
<div class="chat-bubble human-bubble">
&#8203;{answer.message}
</div>
</div>
"""
st.markdown(div, unsafe_allow_html=True)

for _ in range(3):
st.markdown("")
with st.chat_message("user"):
st.write(answer.message)

credit_card_placeholder.caption(f"""
Used {st.session_state.token_count} tokens \n
Expand Down
30 changes: 7 additions & 23 deletions pages/Technical Screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,14 @@ def answer_call_back():

with chat_placeholder:
for answer in st.session_state.jd_history:
if answer:
if answer.origin == 'ai':
div = f"""<div class="chat-row">
<img class="chat-icon" src="static/images/chat.png" width=32 height=32>
<div class="chat-bubble ai-bubble">
&#8203;{answer.message}
</div>
</div>
"""
st.markdown(div, unsafe_allow_html=True)
#if answer:
if answer.origin == 'ai':
with st.chat_message("assistant"):
st.write(answer.message)
st.write(audio_widget)

else:
div = f"""<div class="chat-row row-reverse">
<img class="chat-icon" src="static/images/user.png" width=32 height=32>
<div class="chat-bubble human-bubble">
&#8203;{answer.message}
</div>
</div>
"""
st.markdown(div, unsafe_allow_html=True)

for _ in range(3):
st.markdown("")
else:
with st.chat_message("user"):
st.write(answer.message)

credit_card_placeholder.caption(f"""
Used {st.session_state.token_count} tokens \n
Expand Down
Binary file modified temp/audio.wav
Binary file not shown.

0 comments on commit 4c9e2e3

Please sign in to comment.