brunhild217 commited on
Commit
070335a
·
1 Parent(s): 901a36f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -42,17 +42,19 @@ with gr.Blocks() as demo:
42
  #initialize tutor (with state)
43
  study_tutor = gr.State(EchoingTutor())
44
 
45
- # API Authentication
46
  # Instead of ask students to provide key, the key is now directly provided by the instructor
47
  embed_key(os.environ.get("OPENAI_API_KEY"), study_tutor)
48
-
49
- instructor_input = gr.TextArea(label='Enter vector store URL, if given by instructor (WIP)', value=os.environ.get("SECRET_PROMPT"),
50
- lines=2, interactive=False, elem_classes="translucent")
51
-
 
 
 
52
  with gr.Row():
53
  vs_build_button = gr.Button(value = 'Start Studying with Your Tutor!', scale=1)
54
  vs_build_button.click(disable_until_done, vs_build_button, vs_build_button) \
55
- .then(create_reference_store, [study_tutor, vs_build_button, instructor_input],
56
  [study_tutor, vs_build_button])
57
 
58
  # Chatbot interface
 
42
  #initialize tutor (with state)
43
  study_tutor = gr.State(EchoingTutor())
44
 
 
45
  # Instead of ask students to provide key, the key is now directly provided by the instructor
46
  embed_key(os.environ.get("OPENAI_API_KEY"), study_tutor)
47
+ # The instructor will also provide a secret prompt to initialize the chat bot
48
+ text_input = gr.TextArea(label='Copy and paste your text below', value=os.environ.get("SECRET_PROMPT"), lines=2)
49
+ file_input = None
50
+ instructor_input = None
51
+ api_input = os.environ.get("OPENAI_API_KEY")
52
+ learning_objectives = None
53
+
54
  with gr.Row():
55
  vs_build_button = gr.Button(value = 'Start Studying with Your Tutor!', scale=1)
56
  vs_build_button.click(disable_until_done, vs_build_button, vs_build_button) \
57
+ .then(create_reference_store, [study_tutor, vs_build_button, text_input, file_input, instructor_input, api_input, learning_objectives],
58
  [study_tutor, vs_build_button])
59
 
60
  # Chatbot interface