Skip to content

Commit

Permalink
chat_to_pretty_markdown_simple.real_role update
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihozturkh2o committed Sep 9, 2024
1 parent 7a1a1d4 commit 0f14fdd
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions openai_server/chat_history_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,18 @@ def chat_to_pretty_markdown_simple(
if role.lower() == "user"
else "ℹ️"
)
real_role = (
assistant_name
if role.lower() == "assistant"
else user_name
if role.lower() == "user"
else dummy_name
)
if 'name' in message:
# turns 'chat_agent' to 'Chat Agent'
real_role = message['name']
real_role = ' '.join(word.capitalize() for word in real_role.split('_'))
else:
real_role = (
assistant_name
if role.lower() == "assistant"
else user_name
if role.lower() == "user"
else dummy_name
)

# Format the role
if cute:
Expand Down

0 comments on commit 0f14fdd

Please sign in to comment.