brunhild217 commited on
Commit
a7ca5b7
Β·
1 Parent(s): 86cfbfc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -44,6 +44,21 @@ def get_conversation_history(chat_tutor):
44
  with gr.Blocks() as demo:
45
  #initialize tutor (with state)
46
  study_tutor = gr.State(EchoingTutor())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  # Chatbot interface
49
  gr.Markdown("""
 
44
  with gr.Blocks() as demo:
45
  #initialize tutor (with state)
46
  study_tutor = gr.State(EchoingTutor())
47
+
48
+ # Title
49
+ gr.Markdown("# Basic Interaction Tutor")
50
+
51
+ # API Authentication functionality
52
+ with gr.Box():
53
+ gr.Markdown("### OpenAI API Key ")
54
+ gr.HTML("""<span>Embed your OpenAI API key below; if you haven't created one already, visit
55
+ <a href="https://platform.openai.com/account/api-keys">platform.openai.com/account/api-keys</a>
56
+ to sign up for an account and get your personal API key</span>""",
57
+ elem_classes="textbox_label")
58
+ api_input = gr.Textbox(show_label=False, type="password", container=False, autofocus=True,
59
+ placeholder="●●●●●●●●●●●●●●●●●", value='')
60
+ api_input.submit(fn=embed_key, inputs=[api_input, study_tutor], outputs=study_tutor)
61
+ api_input.blur(fn=embed_key, inputs=[api_input, study_tutor], outputs=study_tutor)
62
 
63
  # Chatbot interface
64
  gr.Markdown("""