MilanM commited on
Commit
a4c45e2
·
verified ·
1 Parent(s): 6d21544

Create text.py

Browse files
Files changed (1) hide show
  1. text.py +23 -0
text.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ prompt = """Format:
2
+
3
+ # # Add debug information to column 1 if enabled
4
+ if genparam.INPUT_DEBUG_VIEW == 1:
5
+ with col1: # Access first column
6
+ bot_name = genparam.BOT_2_NAME if chat_history == st.session_state.chat_history_2 else genparam.BOT_3_NAME
7
+ bot_avatar = genparam.BOT_2_AVATAR if chat_history == st.session_state.chat_history_2 else genparam.BOT_3_AVATAR
8
+ st.markdown(f"**{bot_avatar} {bot_name} Prompt Data:**")
9
+ st.code(prompt_data, language="text")
10
+
11
+ To be more akin to:
12
+ st.session_state.chat_history_1.append({"role": "user", "content": user_input, "avatar": genparam.USER_AVATAR})
13
+
14
+ Append it to a new session_state called debug_view
15
+
16
+ # # Add debug information to column 1 if enabled
17
+ if genparam.INPUT_DEBUG_VIEW == 1:
18
+ for message in st.session_state.debug_view:
19
+ if message["role"] != "user":
20
+ with st.chat_message(message["role"], avatar=genparam.BOT_2_AVATAR):
21
+ st.markdown(message['content'])
22
+
23
+ So that it can be displayed in col1."""