Spaces:
Sleeping
Sleeping
scroll_to_output=True
Browse files
app.py
CHANGED
|
@@ -2509,17 +2509,20 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
| 2509 |
btn_1.click(
|
| 2510 |
chat_with_opan_ai_assistant,
|
| 2511 |
inputs=btn_1_chat_with_opan_ai_assistant_input,
|
| 2512 |
-
outputs=[msg, chatbot, thread_id]
|
|
|
|
| 2513 |
)
|
| 2514 |
btn_2.click(
|
| 2515 |
chat_with_opan_ai_assistant,
|
| 2516 |
inputs=btn_2_chat_with_opan_ai_assistant_input,
|
| 2517 |
-
outputs=[msg, chatbot, thread_id]
|
|
|
|
| 2518 |
)
|
| 2519 |
btn_3.click(
|
| 2520 |
chat_with_opan_ai_assistant,
|
| 2521 |
inputs=btn_3_chat_with_opan_ai_assistant_input,
|
| 2522 |
-
outputs=[msg, chatbot, thread_id]
|
|
|
|
| 2523 |
)
|
| 2524 |
btn_create_question.click(
|
| 2525 |
change_questions,
|
|
@@ -2527,30 +2530,34 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
| 2527 |
outputs = [btn_1, btn_2, btn_3]
|
| 2528 |
)
|
| 2529 |
|
| 2530 |
-
# ai_chatbot 模式
|
| 2531 |
ai_send_button.click(
|
| 2532 |
chat_with_ai,
|
| 2533 |
inputs=[ai_name, password, video_id, user_data, trascript_state, key_moments, ai_msg, ai_chatbot, content_subject, content_grade, ai_chatbot_socratic_mode_btn],
|
| 2534 |
-
outputs=[ai_msg, ai_chatbot]
|
|
|
|
| 2535 |
)
|
| 2536 |
-
# ai_chatbot 连接按钮点击事件
|
| 2537 |
ai_chatbot_question_1_chat_with_ai_input =[ai_name, password, video_id, user_data, trascript_state, key_moments, ai_chatbot_question_1, ai_chatbot, content_subject, content_grade, ai_chatbot_socratic_mode_btn]
|
| 2538 |
ai_chatbot_question_2_chat_with_ai_input =[ai_name, password, video_id, user_data, trascript_state, key_moments, ai_chatbot_question_2, ai_chatbot, content_subject, content_grade, ai_chatbot_socratic_mode_btn]
|
| 2539 |
ai_chatbot_question_3_chat_with_ai_input =[ai_name, password, video_id, user_data, trascript_state, key_moments, ai_chatbot_question_3, ai_chatbot, content_subject, content_grade, ai_chatbot_socratic_mode_btn]
|
| 2540 |
ai_chatbot_question_1.click(
|
| 2541 |
chat_with_ai,
|
| 2542 |
inputs=ai_chatbot_question_1_chat_with_ai_input,
|
| 2543 |
-
outputs=[ai_msg, ai_chatbot]
|
|
|
|
| 2544 |
)
|
| 2545 |
ai_chatbot_question_2.click(
|
| 2546 |
chat_with_ai,
|
| 2547 |
inputs=ai_chatbot_question_2_chat_with_ai_input,
|
| 2548 |
-
outputs=[ai_msg, ai_chatbot]
|
|
|
|
| 2549 |
)
|
| 2550 |
ai_chatbot_question_3.click(
|
| 2551 |
chat_with_ai,
|
| 2552 |
inputs=ai_chatbot_question_3_chat_with_ai_input,
|
| 2553 |
-
outputs=[ai_msg, ai_chatbot]
|
|
|
|
| 2554 |
)
|
| 2555 |
|
| 2556 |
# file_upload.change(process_file, inputs=file_upload, outputs=df_string_output)
|
|
|
|
| 2509 |
btn_1.click(
|
| 2510 |
chat_with_opan_ai_assistant,
|
| 2511 |
inputs=btn_1_chat_with_opan_ai_assistant_input,
|
| 2512 |
+
outputs=[msg, chatbot, thread_id],
|
| 2513 |
+
scroll_to_output=True
|
| 2514 |
)
|
| 2515 |
btn_2.click(
|
| 2516 |
chat_with_opan_ai_assistant,
|
| 2517 |
inputs=btn_2_chat_with_opan_ai_assistant_input,
|
| 2518 |
+
outputs=[msg, chatbot, thread_id],
|
| 2519 |
+
scroll_to_output=True
|
| 2520 |
)
|
| 2521 |
btn_3.click(
|
| 2522 |
chat_with_opan_ai_assistant,
|
| 2523 |
inputs=btn_3_chat_with_opan_ai_assistant_input,
|
| 2524 |
+
outputs=[msg, chatbot, thread_id],
|
| 2525 |
+
scroll_to_output=True
|
| 2526 |
)
|
| 2527 |
btn_create_question.click(
|
| 2528 |
change_questions,
|
|
|
|
| 2530 |
outputs = [btn_1, btn_2, btn_3]
|
| 2531 |
)
|
| 2532 |
|
| 2533 |
+
# 其他精靈 ai_chatbot 模式
|
| 2534 |
ai_send_button.click(
|
| 2535 |
chat_with_ai,
|
| 2536 |
inputs=[ai_name, password, video_id, user_data, trascript_state, key_moments, ai_msg, ai_chatbot, content_subject, content_grade, ai_chatbot_socratic_mode_btn],
|
| 2537 |
+
outputs=[ai_msg, ai_chatbot],
|
| 2538 |
+
scroll_to_output=True
|
| 2539 |
)
|
| 2540 |
+
# 其他精靈 ai_chatbot 连接按钮点击事件
|
| 2541 |
ai_chatbot_question_1_chat_with_ai_input =[ai_name, password, video_id, user_data, trascript_state, key_moments, ai_chatbot_question_1, ai_chatbot, content_subject, content_grade, ai_chatbot_socratic_mode_btn]
|
| 2542 |
ai_chatbot_question_2_chat_with_ai_input =[ai_name, password, video_id, user_data, trascript_state, key_moments, ai_chatbot_question_2, ai_chatbot, content_subject, content_grade, ai_chatbot_socratic_mode_btn]
|
| 2543 |
ai_chatbot_question_3_chat_with_ai_input =[ai_name, password, video_id, user_data, trascript_state, key_moments, ai_chatbot_question_3, ai_chatbot, content_subject, content_grade, ai_chatbot_socratic_mode_btn]
|
| 2544 |
ai_chatbot_question_1.click(
|
| 2545 |
chat_with_ai,
|
| 2546 |
inputs=ai_chatbot_question_1_chat_with_ai_input,
|
| 2547 |
+
outputs=[ai_msg, ai_chatbot],
|
| 2548 |
+
scroll_to_output=True
|
| 2549 |
)
|
| 2550 |
ai_chatbot_question_2.click(
|
| 2551 |
chat_with_ai,
|
| 2552 |
inputs=ai_chatbot_question_2_chat_with_ai_input,
|
| 2553 |
+
outputs=[ai_msg, ai_chatbot],
|
| 2554 |
+
scroll_to_output=True
|
| 2555 |
)
|
| 2556 |
ai_chatbot_question_3.click(
|
| 2557 |
chat_with_ai,
|
| 2558 |
inputs=ai_chatbot_question_3_chat_with_ai_input,
|
| 2559 |
+
outputs=[ai_msg, ai_chatbot],
|
| 2560 |
+
scroll_to_output=True
|
| 2561 |
)
|
| 2562 |
|
| 2563 |
# file_upload.change(process_file, inputs=file_upload, outputs=df_string_output)
|