Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,6 +34,12 @@ def respond(message, history, system_prompt):
|
|
34 |
history.append((message, bot_response))
|
35 |
return '', history
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
def is_api_key_valid(api_key):
|
39 |
client.api_key = api_key
|
@@ -103,4 +109,6 @@ with gr.Blocks() as demo:
|
|
103 |
textbox1.submit(respond, [textbox1, chatbot1, system_prompt_textbox1], [textbox1, chatbot1])
|
104 |
textbox2.submit(respond, [textbox2, chatbot2, system_prompt_textbox2], [textbox2, chatbot2])
|
105 |
|
|
|
|
|
106 |
demo.launch()
|
|
|
34 |
history.append((message, bot_response))
|
35 |
return '', history
|
36 |
|
37 |
+
def copy_gatekeeper_text(history):
|
38 |
+
print('gatekeeper hsotry')
|
39 |
+
print(history)
|
40 |
+
|
41 |
+
result = 'How I should respond to the gatekeeper? The gatekeeper said '
|
42 |
+
return result
|
43 |
|
44 |
def is_api_key_valid(api_key):
|
45 |
client.api_key = api_key
|
|
|
109 |
textbox1.submit(respond, [textbox1, chatbot1, system_prompt_textbox1], [textbox1, chatbot1])
|
110 |
textbox2.submit(respond, [textbox2, chatbot2, system_prompt_textbox2], [textbox2, chatbot2])
|
111 |
|
112 |
+
copy_gatekeeper_text_button.click(copy_gatekeeper_text, inputs=[chatbot2], outputs=[textbox1])
|
113 |
+
|
114 |
demo.launch()
|