youngtsai commited on
Commit
54486da
·
1 Parent(s): a5c3e6a

with gr.Tab("教學備課"):

Browse files
Files changed (1) hide show
  1. app.py +43 -0
app.py CHANGED
@@ -3074,6 +3074,18 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
3074
  questions_answers_create_button = gr.Button("重建", size="sm", variant="primary")
3075
  with gr.Row():
3076
  questions_answers_json = gr.Textbox(label="Questions Answers", lines=40, interactive=False, show_copy_button=True)
 
 
 
 
 
 
 
 
 
 
 
 
3077
  with gr.Tab("逐字稿"):
3078
  simple_html_content = gr.HTML(label="Simple Transcript")
3079
  with gr.Tab("圖文"):
@@ -3482,6 +3494,37 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
3482
  'inputs': [video_id, questions_answers_json, questions_answers_kind],
3483
  'outputs': [questions_answers_json]
3484
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3485
  ]
3486
  setup_content_buttons(content_buttons_config)
3487
 
 
3074
  questions_answers_create_button = gr.Button("重建", size="sm", variant="primary")
3075
  with gr.Row():
3076
  questions_answers_json = gr.Textbox(label="Questions Answers", lines=40, interactive=False, show_copy_button=True)
3077
+
3078
+ with gr.Tab("教學備課"):
3079
+ with gr.Row() as worksheet_admin:
3080
+ worksheet_kind = gr.Textbox(value="ai_content_list", show_label=False)
3081
+ worksheet_get_button = gr.Button("取得", size="sm", variant="primary")
3082
+ worksheet_edit_button = gr.Button("編輯(X)", size="sm", variant="primary", interactive=False)
3083
+ worksheet_update_button = gr.Button("儲存(X)", size="sm", variant="primary", interactive=False)
3084
+ worksheet_delete_button = gr.Button("刪除", size="sm", variant="primary")
3085
+ worksheet_create_button = gr.Button("重建(X)", size="sm", variant="primary", interactive=False)
3086
+ with gr.Row():
3087
+ worksheet_json = gr.Textbox(label="worksheet", lines=40, interactive=False, show_copy_button=True)
3088
+
3089
  with gr.Tab("逐字稿"):
3090
  simple_html_content = gr.HTML(label="Simple Transcript")
3091
  with gr.Tab("圖文"):
 
3494
  'inputs': [video_id, questions_answers_json, questions_answers_kind],
3495
  'outputs': [questions_answers_json]
3496
  },
3497
+ # Worksheet actions
3498
+ {
3499
+ 'button': worksheet_get_button,
3500
+ 'action': get_LLM_content,
3501
+ 'inputs': [video_id, worksheet_kind],
3502
+ 'outputs': [worksheet_json]
3503
+ },
3504
+ {
3505
+ 'button': worksheet_create_button,
3506
+ 'action': create_LLM_content,
3507
+ 'inputs': [video_id, df_string_output, worksheet_kind],
3508
+ 'outputs': [worksheet_json]
3509
+ },
3510
+ {
3511
+ 'button': worksheet_delete_button,
3512
+ 'action': delete_LLM_content,
3513
+ 'inputs': [video_id, worksheet_kind],
3514
+ 'outputs': [worksheet_json]
3515
+ },
3516
+ {
3517
+ 'button': worksheet_edit_button,
3518
+ 'action': enable_edit_mode,
3519
+ 'inputs': [],
3520
+ 'outputs': [worksheet_json]
3521
+ },
3522
+ {
3523
+ 'button': worksheet_update_button,
3524
+ 'action': update_LLM_content,
3525
+ 'inputs': [video_id, worksheet_json, worksheet_kind],
3526
+ 'outputs': [worksheet_json]
3527
+ },
3528
  ]
3529
  setup_content_buttons(content_buttons_config)
3530