Spaces:
Sleeping
Sleeping
show
Browse files
app.py
CHANGED
@@ -2943,156 +2943,156 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
2943 |
trascript_state = gr.State() # 使用 gr.State 存储 trascript
|
2944 |
key_moments_state = gr.State() # 使用 gr.State 存储 key_moments
|
2945 |
streaming_chat_thread_id_state = gr.State() # 使用 gr.State 存储 streaming_chat_thread_id
|
2946 |
-
|
2947 |
-
|
2948 |
-
|
2949 |
-
|
2950 |
-
|
2951 |
-
|
2952 |
-
|
2953 |
-
|
2954 |
-
|
2955 |
-
|
2956 |
-
|
2957 |
-
|
2958 |
-
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
-
|
2963 |
-
|
2964 |
-
|
2965 |
-
|
2966 |
-
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
-
|
2974 |
-
|
2975 |
-
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
2980 |
-
|
2981 |
-
|
2982 |
-
|
2983 |
-
|
2984 |
-
|
2985 |
-
|
2986 |
-
|
2987 |
-
|
2988 |
-
|
2989 |
-
|
2990 |
-
|
2991 |
-
|
2992 |
-
|
2993 |
-
|
2994 |
-
|
2995 |
-
|
2996 |
-
|
2997 |
-
|
2998 |
-
|
2999 |
-
|
3000 |
-
|
3001 |
-
|
3002 |
-
|
3003 |
-
|
3004 |
-
|
3005 |
-
|
3006 |
-
|
3007 |
-
|
3008 |
-
|
3009 |
-
|
3010 |
-
|
3011 |
-
|
3012 |
-
|
3013 |
-
|
3014 |
-
|
3015 |
-
|
3016 |
-
|
3017 |
-
|
3018 |
-
|
3019 |
-
|
3020 |
-
|
3021 |
-
|
3022 |
-
|
3023 |
-
|
3024 |
-
|
3025 |
-
|
3026 |
-
|
3027 |
-
|
3028 |
-
|
3029 |
-
|
3030 |
-
|
3031 |
-
|
3032 |
-
|
3033 |
-
|
3034 |
-
|
3035 |
-
|
3036 |
-
|
3037 |
-
|
3038 |
-
|
3039 |
-
|
3040 |
-
|
3041 |
-
|
3042 |
-
|
3043 |
-
|
3044 |
-
|
3045 |
-
|
3046 |
-
|
3047 |
-
|
3048 |
-
|
3049 |
-
|
3050 |
-
|
3051 |
-
|
3052 |
-
|
3053 |
-
|
3054 |
-
|
3055 |
-
|
3056 |
-
|
3057 |
-
|
3058 |
-
|
3059 |
-
|
3060 |
-
|
3061 |
-
|
3062 |
-
|
3063 |
-
|
3064 |
-
|
3065 |
-
|
3066 |
-
|
3067 |
-
|
3068 |
-
|
3069 |
-
|
3070 |
-
|
3071 |
-
|
3072 |
-
|
3073 |
-
|
3074 |
-
|
3075 |
-
|
3076 |
-
|
3077 |
-
|
3078 |
-
|
3079 |
-
|
3080 |
-
|
3081 |
-
|
3082 |
-
|
3083 |
-
|
3084 |
-
|
3085 |
-
|
3086 |
-
|
3087 |
-
|
3088 |
-
|
3089 |
-
|
3090 |
-
|
3091 |
-
|
3092 |
-
|
3093 |
-
|
3094 |
-
|
3095 |
-
|
3096 |
with gr.Tab("文章模式"):
|
3097 |
with gr.Row():
|
3098 |
reading_passage = gr.Markdown(show_label=False, latex_delimiters = [{"left": "$", "right": "$", "display": False}])
|
@@ -3104,89 +3104,89 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
3104 |
with gr.Tab("關鍵時刻"):
|
3105 |
with gr.Row():
|
3106 |
key_moments_html = gr.HTML(value="")
|
3107 |
-
|
3108 |
-
|
3109 |
-
|
3110 |
-
|
3111 |
-
|
3112 |
-
|
3113 |
-
|
3114 |
-
|
3115 |
-
|
3116 |
-
|
3117 |
-
|
3118 |
-
|
3119 |
-
|
3120 |
-
|
3121 |
-
|
3122 |
-
|
3123 |
-
|
3124 |
-
|
3125 |
-
|
3126 |
-
|
3127 |
-
|
3128 |
-
|
3129 |
-
|
3130 |
-
|
3131 |
-
|
3132 |
-
|
3133 |
-
|
3134 |
-
|
3135 |
-
|
3136 |
-
|
3137 |
-
|
3138 |
-
|
3139 |
-
|
3140 |
-
|
3141 |
-
|
3142 |
-
|
3143 |
-
|
3144 |
-
|
3145 |
-
|
3146 |
-
|
3147 |
-
|
3148 |
-
|
3149 |
-
|
3150 |
-
|
3151 |
|
3152 |
-
|
3153 |
-
|
3154 |
-
|
3155 |
-
|
3156 |
-
|
3157 |
-
|
3158 |
-
|
3159 |
-
|
3160 |
-
|
3161 |
-
|
3162 |
-
|
3163 |
-
|
3164 |
-
|
3165 |
-
|
3166 |
-
|
3167 |
-
|
3168 |
-
|
3169 |
-
|
3170 |
-
|
3171 |
-
|
3172 |
|
3173 |
-
|
3174 |
-
|
3175 |
-
|
3176 |
-
|
3177 |
-
|
3178 |
-
|
3179 |
-
|
3180 |
-
|
3181 |
-
|
3182 |
-
|
3183 |
-
|
3184 |
-
|
3185 |
-
|
3186 |
-
|
3187 |
-
|
3188 |
-
|
3189 |
-
|
3190 |
|
3191 |
with gr.Accordion("See Details", open=False) as see_details:
|
3192 |
with gr.Row():
|
|
|
2943 |
trascript_state = gr.State() # 使用 gr.State 存储 trascript
|
2944 |
key_moments_state = gr.State() # 使用 gr.State 存储 key_moments
|
2945 |
streaming_chat_thread_id_state = gr.State() # 使用 gr.State 存储 streaming_chat_thread_id
|
2946 |
+
with gr.Tab("AI小精靈"):
|
2947 |
+
with gr.Row():
|
2948 |
+
all_chatbot_select_btn = gr.Button("選擇 AI 小精靈 👈", elem_id="all_chatbot_select_btn", visible=False, variant="secondary", size="sm")
|
2949 |
+
with gr.Row() as ai_chatbot_params:
|
2950 |
+
ai_name = gr.Dropdown(
|
2951 |
+
label="選擇 AI 助理",
|
2952 |
+
choices=[
|
2953 |
+
("飛特精靈","chatbot_open_ai"),
|
2954 |
+
("飛特音速","chatbot_open_ai_streaming"),
|
2955 |
+
("梨梨","lili"),
|
2956 |
+
("麥麥","maimai"),
|
2957 |
+
("狐狸貓","foxcat")
|
2958 |
+
],
|
2959 |
+
value="foxcat",
|
2960 |
+
visible=True
|
2961 |
+
)
|
2962 |
+
ai_chatbot_ai_type = gr.Textbox(value="chat_completions", visible=True)
|
2963 |
+
ai_chatbot_thread_id = gr.Textbox(label="thread_id", visible=True)
|
2964 |
+
ai_chatbot_socratic_mode_btn = gr.Checkbox(label="蘇格拉底家教助理模式", value=True, visible=True)
|
2965 |
+
latex_delimiters = [{"left": "$", "right": "$", "display": False}]
|
2966 |
+
with gr.Accordion("選擇 AI 小精靈", elem_id="chatbot_select_accordion") as chatbot_select_accordion:
|
2967 |
+
with gr.Row():
|
2968 |
+
user_avatar = "https://em-content.zobj.net/source/google/263/flushed-face_1f633.png"
|
2969 |
+
# 飛特精靈
|
2970 |
+
with gr.Column(scale=1, variant="panel", visible=True):
|
2971 |
+
vaitor_chatbot_avatar_url = "https://junyitopicimg.s3.amazonaws.com/s4byy--icon.jpe?v=20200513013523726"
|
2972 |
+
vaitor_chatbot_avatar_images = gr.State([user_avatar, vaitor_chatbot_avatar_url])
|
2973 |
+
vaitor_chatbot_description = """Hi,我是你的AI學伴【飛特精靈】,\n
|
2974 |
+
我可以陪你一起學習本次的內容,有什麼問題都可以問我喔!\n
|
2975 |
+
🤔 如果你不知道怎麼發問,可以點擊左下方的問題一、問題二、問題三,我會幫你生成問題!\n
|
2976 |
+
🗣️ 也可以點擊右下方用語音輸入,我會幫你轉換成文字,厲害吧!\n
|
2977 |
+
🔠 或是直接鍵盤輸入你的問題,我會盡力回答你的問題喔!\n
|
2978 |
+
💤 但我還在成長,體力有限,每一次學習只能回答十個問題,請讓我休息一下再問問題喔!\n
|
2979 |
+
🦄 如果達到上限,或是遇到精靈很累,請問問其他朋友,像是飛特音速說話的速度比較快,你是否跟得上呢?你也可以和其他精靈互動看看喔!\n
|
2980 |
+
"""
|
2981 |
+
chatbot_open_ai_name = gr.State("chatbot_open_ai")
|
2982 |
+
gr.Image(value=vaitor_chatbot_avatar_url, height=100, width=100, show_label=False, show_download_button=False)
|
2983 |
+
vaitor_chatbot_select_btn = gr.Button("👆選擇【飛特精靈】", elem_id="chatbot_btn", visible=True, variant="primary")
|
2984 |
+
with gr.Accordion("🦄 飛特精靈 敘述", open=False):
|
2985 |
+
vaitor_chatbot_description_value = gr.Markdown(value=vaitor_chatbot_description, visible=True)
|
2986 |
+
# 狐狸貓
|
2987 |
+
with gr.Column(scale=1, variant="panel"):
|
2988 |
+
foxcat_chatbot_avatar_url = "https://storage.googleapis.com/wpassets.junyiacademy.org/1/2020/06/%E7%A7%91%E5%AD%B8%E5%BE%BD%E7%AB%A0-2-150x150.png"
|
2989 |
+
foxcat_avatar_images = gr.State([user_avatar, foxcat_chatbot_avatar_url])
|
2990 |
+
foxcat_chatbot_description = """Hi,我是【狐狸貓】,可以陪你一起學習本次的內容,有什麼問題都可以問我喔!\n
|
2991 |
+
🤔 三年級學生|10 歲|男\n
|
2992 |
+
🗣️ 口頭禪:「感覺好好玩喔!」「咦?是這樣嗎?」\n
|
2993 |
+
🔠 興趣:看知識型書籍、熱血的動漫卡通、料理、爬山、騎腳踏車。因為太喜歡吃魚了,正努力和爸爸學習釣魚、料理魚及各種有關魚的知識,最討厭的食物是青椒。\n
|
2994 |
+
💤 個性:喜歡學習新知,擁有最旺盛的好奇心,家裡堆滿百科全書,例如:國家地理頻道出版的「終極魚百科」,雖都沒有看完,常常被梨梨唸是三分鐘熱度,但是也一點一點學習到不同領域的知識。雖然有時會忘東忘西,但認真起來也是很可靠,答應的事絕對使命必達。遇到挑戰時,勇於跳出舒適圈,追求自我改變,視困難為成長的機會。
|
2995 |
+
"""
|
2996 |
+
foxcat_chatbot_name = gr.State("foxcat")
|
2997 |
+
gr.Image(value=foxcat_chatbot_avatar_url, height=100, width=100, show_label=False, show_download_button=False)
|
2998 |
+
foxcat_chatbot_select_btn = gr.Button("👆選擇【狐狸貓】", visible=True, variant="primary", elem_classes="chatbot_select_btn")
|
2999 |
+
with gr.Accordion("💜 狐狸貓 敘述", open=False):
|
3000 |
+
foxcat_chatbot_description_value = gr.Markdown(value=foxcat_chatbot_description, visible=True)
|
3001 |
+
# 梨梨
|
3002 |
+
with gr.Column(scale=1, variant="panel"):
|
3003 |
+
lili_chatbot_avatar_url = "https://junyitopicimg.s3.amazonaws.com/live/v1283-new-topic-44-icon.png?v=20230529071206714"
|
3004 |
+
lili_avatar_images = gr.State([user_avatar, lili_chatbot_avatar_url])
|
3005 |
+
lili_chatbot_description = """你好,我是溫柔的【梨梨】,很高興可以在這裡陪伴你學習。如果你有任何疑問,請隨時向我提出哦! \n
|
3006 |
+
🤔 三年級學生|10 歲|女\n
|
3007 |
+
🗣️ 口頭禪:「真的假的?!」「讓我想一想喔」「你看吧!大問題拆解成小問題,就變得簡單啦!」「混混噩噩的生活不值得過」\n
|
3008 |
+
�� 興趣:烘焙餅乾(父母開糕餅店)、畫畫、聽流行音樂、收納。\n
|
3009 |
+
💤 個性:
|
3010 |
+
- 內向害羞,比起出去玩更喜歡待在家(除非是跟狐狸貓出去玩)
|
3011 |
+
- 數理邏輯很好;其實覺得麥麥連珠炮的提問有點煩,但還是會耐心地回答
|
3012 |
+
- 有驚人的眼力,總能觀察到其他人沒有察覺的細節
|
3013 |
+
- 喜歡整整齊齊的環境,所以一到麥麥家就受不了
|
3014 |
+
"""
|
3015 |
+
lili_chatbot_name = gr.State("lili")
|
3016 |
+
gr.Image(value=lili_chatbot_avatar_url, height=100, width=100, show_label=False, show_download_button=False)
|
3017 |
+
lili_chatbot_select_btn = gr.Button("👆選擇【梨梨】", visible=True, variant="primary", elem_classes="chatbot_select_btn")
|
3018 |
+
with gr.Accordion("🧡 梨梨 敘述", open=False):
|
3019 |
+
lili_chatbot_description_value = gr.Markdown(value=lili_chatbot_description, visible=True)
|
3020 |
+
# 麥麥
|
3021 |
+
with gr.Column(scale=1, variant="panel"):
|
3022 |
+
maimai_chatbot_avatar_url = "https://storage.googleapis.com/wpassets.junyiacademy.org/1/2020/07/%E6%80%9D%E8%80%83%E5%8A%9B%E8%B6%85%E4%BA%BA%E5%BE%BD%E7%AB%A0_%E5%B7%A5%E4%BD%9C%E5%8D%80%E5%9F%9F-1-%E8%A4%87%E6%9C%AC-150x150.png"
|
3023 |
+
maimai_avatar_images = gr.State([user_avatar, maimai_chatbot_avatar_url])
|
3024 |
+
maimai_chatbot_description = """Hi,我是迷人的【麥麥】,我在這裡等著和你一起探索新知,任何疑問都可以向我提出!\n
|
3025 |
+
🤔 三年級學生|10 歲|男\n
|
3026 |
+
🗣️ 口頭禪:「Oh My God!」「好奇怪喔!」「喔!原來是這樣啊!」\n
|
3027 |
+
🔠 興趣:最愛去野外玩耍(心情好時會順便捕魚送給狐狸貓),喜歡講冷笑話、惡作劇。因為太喜歡玩具,而開始自己做玩具,家裡就好像他的遊樂場。\n
|
3028 |
+
💤 個性:喜歡問問題,就算被梨梨ㄘㄟ,也還是照問|憨厚,外向好動,樂天開朗,不會被難題打敗|喜歡收集各式各樣的東西;房間只有在整理的那一天最乾淨
|
3029 |
+
"""
|
3030 |
+
maimai_chatbot_name = gr.State("maimai")
|
3031 |
+
gr.Image(value=maimai_chatbot_avatar_url, height=100, width=100, show_label=False, show_download_button=False)
|
3032 |
+
maimai_chatbot_select_btn = gr.Button("👆選擇【麥麥】", visible=True, variant="primary", elem_classes="chatbot_select_btn")
|
3033 |
+
with gr.Accordion("💙 麥麥 敘述", open=False):
|
3034 |
+
maimai_chatbot_description_value = gr.Markdown(value=maimai_chatbot_description, visible=True)
|
3035 |
+
# 飛特音速
|
3036 |
+
with gr.Column(scale=1, variant="panel", visible=True):
|
3037 |
+
streaming_chatbot_avatar_url = "https://storage.googleapis.com/wpassets.junyiacademy.org/1/2020/11/1-%E6%98%9F%E7%A9%BA%E9%A0%AD%E8%B2%BC-%E5%A4%AA%E7%A9%BA%E7%8B%90%E7%8B%B8%E8%B2%93-150x150.png"
|
3038 |
+
streaming_chatbot_description = """Hi,我是【飛特音速】, \n
|
3039 |
+
說話比較快,但有什麼問題都可以問我喔! \n
|
3040 |
+
🚀 我沒有預設問題、也沒有語音輸入,適合快問快答,一起練習問出好問題吧 \n
|
3041 |
+
🔠 擅長用文字表達的你,可以用鍵盤輸入你的問題,我會盡力回答你的問題喔\n
|
3042 |
+
💤 我還在成長,體力有限,每一次學習只能回答十個問題,請讓我休息一下再問問題喔~
|
3043 |
+
"""
|
3044 |
+
chatbot_open_ai_streaming_name = gr.State("chatbot_open_ai_streaming")
|
3045 |
+
gr.Image(value=streaming_chatbot_avatar_url, height=100, width=100, show_label=False, show_download_button=False)
|
3046 |
+
chatbot_open_ai_streaming_select_btn = gr.Button("👆選擇【飛特音速】", elem_id="streaming_chatbot_btn", visible=True, variant="primary")
|
3047 |
+
with gr.Accordion("🚀 飛特音速 敘述", open=False):
|
3048 |
+
gr.Markdown(value=streaming_chatbot_description, visible=True)
|
3049 |
+
# 尚未開放
|
3050 |
+
with gr.Column(scale=1, variant="panel"):
|
3051 |
+
gr.Markdown(value="### 尚未開放", visible=True)
|
3052 |
+
|
3053 |
+
with gr.Row("飛特音速") as chatbot_open_ai_streaming:
|
3054 |
+
with gr.Column():
|
3055 |
+
streaming_chat_greeting = """
|
3056 |
+
Hi,我是【飛特音速】,說話比較快,但有什麼問題都可以問我喔! \n
|
3057 |
+
🚀 我沒有預設問題、也沒有語音輸入,適合快問快答的你 \n
|
3058 |
+
🔠 鍵盤輸入你的問題,我會盡力回答你的問題喔!\n
|
3059 |
+
💤 我還在成長,體力有限,每一次學習只能回答十個���題,請讓我休息一下再問問題喔!
|
3060 |
+
"""
|
3061 |
+
additional_inputs = [password, video_id, user_data, streaming_chat_thread_id_state, trascript_state, key_moments_state, content_subject_state, content_grade_state, ai_chatbot_socratic_mode_btn]
|
3062 |
+
streaming_chat = gr.ChatInterface(
|
3063 |
+
fn=chat_with_opan_ai_assistant_streaming,
|
3064 |
+
additional_inputs=additional_inputs,
|
3065 |
+
submit_btn="送出",
|
3066 |
+
retry_btn=None,
|
3067 |
+
undo_btn="⏪ 上一步",
|
3068 |
+
clear_btn="🗑️ 清除全部",
|
3069 |
+
stop_btn=None,
|
3070 |
+
description=streaming_chat_greeting
|
3071 |
+
)
|
3072 |
+
with gr.Row("一般精靈") as chatbot_ai:
|
3073 |
+
with gr.Column():
|
3074 |
+
ai_chatbot_greeting = [[
|
3075 |
+
"請問你是誰?",
|
3076 |
+
"""Hi,我是飛特精靈的朋友們【梨梨、麥麥、狐狸貓】,也可以陪你一起學習本次的內容,有什麼問題都可以問我喔!
|
3077 |
+
🤔 如果你不知道怎麼發問,可以點擊左下方的問題一、問題二、問題三,我會幫你生成問題!
|
3078 |
+
🗣️ 也可以點擊右下方用語音輸入,我會幫你轉換成文字,厲害吧!
|
3079 |
+
🔠 或是直接鍵盤輸入你的問題,我會盡力回答你的問題喔!
|
3080 |
+
💤 精靈們體力都有限,每一次學習只能回答十個問題,請讓我休息一下再問問題喔!
|
3081 |
+
""",
|
3082 |
+
]]
|
3083 |
+
with gr.Row():
|
3084 |
+
ai_chatbot = gr.Chatbot(label="ai_chatbot", show_share_button=False, likeable=True, show_label=False, latex_delimiters=latex_delimiters, value=ai_chatbot_greeting)
|
3085 |
+
with gr.Row():
|
3086 |
+
with gr.Accordion("你也有類似的問題想問嗎? 請按下 ◀︎", open=False) as ask_questions_accordion_2:
|
3087 |
+
ai_chatbot_question_1 = gr.Button("問題一")
|
3088 |
+
ai_chatbot_question_2 = gr.Button("問題一")
|
3089 |
+
ai_chatbot_question_3 = gr.Button("問題一")
|
3090 |
+
create_questions_btn = gr.Button("生成問題", variant="primary")
|
3091 |
+
ai_chatbot_audio_input = gr.Audio(sources=["microphone"], type="filepath", max_length=60, label="語音輸入")
|
3092 |
+
with gr.Row():
|
3093 |
+
ai_msg = gr.Textbox(label="訊息輸入",scale=3)
|
3094 |
+
ai_send_button = gr.Button("送出", variant="primary",scale=1)
|
3095 |
+
ai_send_feedback_btn = gr.Button("提問力回饋", variant="primary", scale=1, visible=False)
|
3096 |
with gr.Tab("文章模式"):
|
3097 |
with gr.Row():
|
3098 |
reading_passage = gr.Markdown(show_label=False, latex_delimiters = [{"left": "$", "right": "$", "display": False}])
|
|
|
3104 |
with gr.Tab("關鍵時刻"):
|
3105 |
with gr.Row():
|
3106 |
key_moments_html = gr.HTML(value="")
|
3107 |
+
with gr.Tab("教學備課"):
|
3108 |
+
with gr.Row():
|
3109 |
+
content_subject = gr.Dropdown(label="選擇主題", choices=["數學", "自然", "國文", "英文", "社會","物理", "化學", "生物", "地理", "歷史", "公民"], value="", visible=False)
|
3110 |
+
content_grade = gr.Dropdown(label="選擇年級", choices=["一年級", "二年級", "三年級", "四年級", "五年級", "六年級", "七年級", "八年級", "九年級", "十年級", "十一年級", "十二年級"], value="", visible=False)
|
3111 |
+
content_level = gr.Dropdown(label="差異化教學", choices=["基礎", "中級", "進階"], value="基礎")
|
3112 |
+
with gr.Row():
|
3113 |
+
with gr.Tab("學習單"):
|
3114 |
+
with gr.Row():
|
3115 |
+
with gr.Column(scale=1):
|
3116 |
+
with gr.Row():
|
3117 |
+
worksheet_content_type_name = gr.Textbox(value="worksheet", visible=False)
|
3118 |
+
worksheet_algorithm = gr.Dropdown(label="選擇教學策略或理論", choices=["Bloom認知階層理論", "Polya數學解題法", "CRA教學法"], value="Bloom認知階層理論", visible=False)
|
3119 |
+
worksheet_content_btn = gr.Button("生成學習單 📄", variant="primary", visible=True)
|
3120 |
+
with gr.Accordion("微調", open=False):
|
3121 |
+
worksheet_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
3122 |
+
worksheet_result_fine_tune_btn = gr.Button("微調結果", variant="primary")
|
3123 |
+
worksheet_result_retrun_original = gr.Button("返回原始結果")
|
3124 |
+
with gr.Accordion("prompt", open=False) as worksheet_accordion:
|
3125 |
+
worksheet_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
3126 |
+
with gr.Column(scale=2):
|
3127 |
+
# 生成對應不同模式的結果
|
3128 |
+
worksheet_result_prompt = gr.Textbox(visible=False)
|
3129 |
+
worksheet_result_original = gr.Textbox(visible=False)
|
3130 |
+
worksheet_result = gr.Markdown(label="初次生成結果", latex_delimiters = [{"left": "$", "right": "$", "display": False}])
|
3131 |
+
worksheet_download_button = gr.Button("轉成 word,完成後請點擊右下角 download 按鈕", variant="primary")
|
3132 |
+
worksheet_result_word_link = gr.File(label="Download Word")
|
3133 |
+
with gr.Tab("教案"):
|
3134 |
+
with gr.Row():
|
3135 |
+
with gr.Column(scale=1):
|
3136 |
+
with gr.Row():
|
3137 |
+
lesson_plan_content_type_name = gr.Textbox(value="lesson_plan", visible=False)
|
3138 |
+
lesson_plan_time = gr.Slider(label="選擇課程時間(分鐘)", minimum=10, maximum=120, step=5, value=40)
|
3139 |
+
lesson_plan_btn = gr.Button("生成教案 📕", variant="primary", visible=True)
|
3140 |
+
with gr.Accordion("微調", open=False):
|
3141 |
+
lesson_plan_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
3142 |
+
lesson_plan_result_fine_tune_btn = gr.Button("微調結果", variant="primary")
|
3143 |
+
lesson_plan_result_retrun_original = gr.Button("返回原始結果")
|
3144 |
+
with gr.Accordion("prompt", open=False) as lesson_plan_accordion:
|
3145 |
+
lesson_plan_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
3146 |
+
with gr.Column(scale=2):
|
3147 |
+
# 生成對應不同模式的結果
|
3148 |
+
lesson_plan_result_prompt = gr.Textbox(visible=False)
|
3149 |
+
lesson_plan_result_original = gr.Textbox(visible=False)
|
3150 |
+
lesson_plan_result = gr.Markdown(label="初次生成結果", latex_delimiters = [{"left": "$", "right": "$", "display": False}])
|
3151 |
|
3152 |
+
lesson_plan_download_button = gr.Button("轉成 word,完成後請點擊右下角 download 按鈕", variant="primary")
|
3153 |
+
lesson_plan_result_word_link = gr.File(label="Download Word")
|
3154 |
+
with gr.Tab("出場券"):
|
3155 |
+
with gr.Row():
|
3156 |
+
with gr.Column(scale=1):
|
3157 |
+
with gr.Row():
|
3158 |
+
exit_ticket_content_type_name = gr.Textbox(value="exit_ticket", visible=False)
|
3159 |
+
exit_ticket_time = gr.Slider(label="選擇出場券時間(分鐘)", minimum=5, maximum=10, step=1, value=8)
|
3160 |
+
exit_ticket_btn = gr.Button("生成出場券 🎟️", variant="primary", visible=True)
|
3161 |
+
with gr.Accordion("微調", open=False):
|
3162 |
+
exit_ticket_result_fine_tune_prompt = gr.Textbox(label="根據結果,輸入你想更改的想法")
|
3163 |
+
exit_ticket_result_fine_tune_btn = gr.Button("微調結果", variant="primary")
|
3164 |
+
exit_ticket_result_retrun_original = gr.Button("返回原始結果")
|
3165 |
+
with gr.Accordion("prompt", open=False) as exit_ticket_accordion:
|
3166 |
+
exit_ticket_prompt = gr.Textbox(label="worksheet_prompt", show_copy_button=True, lines=40)
|
3167 |
+
with gr.Column(scale=2):
|
3168 |
+
# 生成對應不同模式的結果
|
3169 |
+
exit_ticket_result_prompt = gr.Textbox(visible=False)
|
3170 |
+
exit_ticket_result_original = gr.Textbox(visible=False)
|
3171 |
+
exit_ticket_result = gr.Markdown(label="初次生成結果", latex_delimiters = [{"left": "$", "right": "$", "display": False}])
|
3172 |
|
3173 |
+
exit_ticket_download_button = gr.Button("轉成 word,完成後請點擊右下角 download 按鈕", variant="primary")
|
3174 |
+
exit_ticket_result_word_link = gr.File(label="Download Word")
|
3175 |
+
|
3176 |
+
|
3177 |
+
# with gr.Tab("素養導向閱讀題組"):
|
3178 |
+
# literacy_oriented_reading_content = gr.Textbox(label="輸入閱讀材料")
|
3179 |
+
# literacy_oriented_reading_content_btn = gr.Button("生成閱讀理解題")
|
3180 |
+
|
3181 |
+
# with gr.Tab("自我評估"):
|
3182 |
+
# self_assessment_content = gr.Textbox(label="輸入自評問卷或檢查表")
|
3183 |
+
# self_assessment_content_btn = gr.Button("生成自評問卷")
|
3184 |
+
# with gr.Tab("自我反思評量"):
|
3185 |
+
# self_reflection_content = gr.Textbox(label="輸入自我反思活動")
|
3186 |
+
# self_reflection_content_btn = gr.Button("生成自我反思活動")
|
3187 |
+
# with gr.Tab("後設認知"):
|
3188 |
+
# metacognition_content = gr.Textbox(label="輸入後設認知相關問題")
|
3189 |
+
# metacognition_content_btn = gr.Button("生成後設認知問題")
|
3190 |
|
3191 |
with gr.Accordion("See Details", open=False) as see_details:
|
3192 |
with gr.Row():
|