Carbaz commited on
Commit
64b4fcd
·
1 Parent(s): 36f9f0f

Add footer disclaimer to chatbot interface and import Markdown component

Browse files
Files changed (2) hide show
  1. src/interface.py +6 -2
  2. src/prompts.py +9 -0
src/interface.py CHANGED
@@ -6,11 +6,11 @@ from secrets import choice
6
  from string import ascii_letters, digits
7
 
8
  from dotenv import load_dotenv
9
- from gradio import Chatbot, ChatInterface
10
  from gradio import __version__ as gr_version
11
 
12
  from .assistant import Assistant
13
- from .prompts import get_welcome_message
14
 
15
 
16
  _logger = getLogger(__name__)
@@ -58,4 +58,8 @@ def get_interface(name, profile_pdf, summary_text, repo_id):
58
  # Set the secret for encrypting saved conversations.
59
  app.saved_conversations.secret = MY_CHAT_SECRET
60
 
 
 
 
 
61
  return app
 
6
  from string import ascii_letters, digits
7
 
8
  from dotenv import load_dotenv
9
+ from gradio import Chatbot, ChatInterface, Markdown
10
  from gradio import __version__ as gr_version
11
 
12
  from .assistant import Assistant
13
+ from .prompts import FOOTER_DISCLAIMER, get_welcome_message
14
 
15
 
16
  _logger = getLogger(__name__)
 
58
  # Set the secret for encrypting saved conversations.
59
  app.saved_conversations.secret = MY_CHAT_SECRET
60
 
61
+ # Footer with disclaimer.
62
+ with app:
63
+ Markdown(FOOTER_DISCLAIMER, elem_id="footer-disclaimer")
64
+
65
  return app
src/prompts.py CHANGED
@@ -182,3 +182,12 @@ def get_system_prompt(name, summary, linkedin):
182
  With this context, please chat with the user,
183
  always staying in character as {name}.
184
  """
 
 
 
 
 
 
 
 
 
 
182
  With this context, please chat with the user,
183
  always staying in character as {name}.
184
  """
185
+
186
+
187
+ FOOTER_DISCLAIMER = """
188
+ <div style='text-align: center; font-size: small;'>
189
+ This chatbot is powered by OpenAI's generative AI technology.<br>
190
+ While it strives to provide accurate information, it may occasionally make mistakes.
191
+ Additionally, conversations may be used to improve OpenAI's models.
192
+ </div>
193
+ """