Spaces:
Running
Running
with gr.Accordion("選擇 AI 小精靈", open=True):
Browse files
app.py
CHANGED
@@ -2177,6 +2177,48 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
2177 |
key_moments_state = gr.State() # 使用 gr.State 存储 key_moments
|
2178 |
streaming_chat_thread_id_state = gr.State() # 使用 gr.State 存储 streaming_chat_thread_id
|
2179 |
with gr.Tab("AI小精靈"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2180 |
with gr.Row():
|
2181 |
with gr.Tab("飛特精靈"):
|
2182 |
user_avatar = "https://em-content.zobj.net/source/google/263/flushed-face_1f633.png"
|
@@ -2223,8 +2265,7 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
2223 |
clear_btn="🗑️ 清除全部",
|
2224 |
stop_btn=None,
|
2225 |
description=streaming_chat_greeting
|
2226 |
-
)
|
2227 |
-
|
2228 |
with gr.Tab("其他精靈"):
|
2229 |
ai_chatbot_greeting = [[
|
2230 |
None,
|
|
|
2177 |
key_moments_state = gr.State() # 使用 gr.State 存储 key_moments
|
2178 |
streaming_chat_thread_id_state = gr.State() # 使用 gr.State 存储 streaming_chat_thread_id
|
2179 |
with gr.Tab("AI小精靈"):
|
2180 |
+
with gr.Accordion("選擇 AI 小精靈", open=True):
|
2181 |
+
with gr.Row():
|
2182 |
+
with gr.Column(scale=1):
|
2183 |
+
chatbot_avatar_url = "https://junyitopicimg.s3.amazonaws.com/s4byy--icon.jpe?v=20200513013523726"
|
2184 |
+
chatbot_description = """Hi,我是你的AI學伴【飛特精靈】,我可以陪你一起學習本次的內容,有什麼問題都可以問我喔!
|
2185 |
+
🤔 如果你不知道怎麼發問,可以點擊左下方的問題一、問題二、問題三,我會幫你生成問題!
|
2186 |
+
🗣️ 也可以點擊右下方用語音輸入,我會幫你轉換成文字,厲害吧!
|
2187 |
+
🔠 或是直接鍵盤輸入你的問題,我會盡力回答你的問題喔!
|
2188 |
+
💤 但我還在成長,體力有限,每一次學習只能回答十個問題,請讓我休息一下再問問題喔!
|
2189 |
+
🦄 如果達到上限,或是遇到精靈很累,請問問其他朋友,像是飛特音速說話的速度比較快,你是否跟得上呢?你也可以和其他精靈互動看看喔!
|
2190 |
+
"""
|
2191 |
+
|
2192 |
+
gr.Image(value=chatbot_avatar_url, height=100, width=100, show_label=False, show_download_button=False)
|
2193 |
+
gr.Button("👆選擇【飛特精靈】", elem_id="chatbot_btn", visible=True, variant="primary")
|
2194 |
+
gr.Textbox(label="Chatbot Description", value=chatbot_description, visible=True)
|
2195 |
+
with gr.Column(scale=1):
|
2196 |
+
streaming_chatbot_avatar_url = "https://junyitopicimg.s3.amazonaws.com/s4byy--icon.jpe?v=20200513013523726"
|
2197 |
+
streaming_chatbot_description = """Hi,我是你的AI學伴【飛特精靈】,我可以陪你一起學習本次的內容,有什麼問題都可以問我喔!
|
2198 |
+
🤔 如果你不知道怎麼發問,可以點擊左下方的問題一、問題二、問題三,我會幫你生成問題!
|
2199 |
+
🗣️ 也可以點擊右下方用語音輸入,我會幫你轉換成文字,厲害吧!
|
2200 |
+
🔠 或是直接鍵盤輸入你的問題,我會盡力回答你的問題喔!
|
2201 |
+
💤 但我還在成長,體力有限,每一次學習只能回答十個問題,請讓我休息一下再問問題喔!
|
2202 |
+
🦄 如果達到上限,或是遇到精靈很累,請問問其他朋友,像是飛特音速說話的速度比較快,你是否跟得上呢?你也可以和其他精靈互動看看喔!
|
2203 |
+
"""
|
2204 |
+
gr.Image(value=streaming_chatbot_avatar_url, height=100, width=100, show_label=False, show_download_button=False)
|
2205 |
+
gr.Button("👆選擇【飛特音速】", elem_id="streaming_chatbot_btn", visible=True, variant="primary")
|
2206 |
+
gr.Textbox(label="Chatbot Description", value=streaming_chatbot_description, visible=True)
|
2207 |
+
with gr.Column(scale=1):
|
2208 |
+
jutor_chatbot_avatar_url = "https://junyitopicimg.s3.amazonaws.com/s4byy--icon.jpe?v=20200513013523726"
|
2209 |
+
jutor_chatbot_description = """Hi,我是你的AI學伴【飛特精靈】,我可以陪你一起學習本次的內容,有什麼問題都可以問我喔!
|
2210 |
+
🤔 如果你不知道怎麼發問,可以點擊左下方的問題一、問題二、問題三,我會幫你生成問題!
|
2211 |
+
🗣️ 也可以點擊右下方用語音輸入,我會幫你轉換成文字,厲害吧!
|
2212 |
+
🔠 或是直接鍵盤輸入你的問題,我會盡力回答你的問題喔!
|
2213 |
+
💤 但我還在成長,體力有限,每一次學習只能回答十個問題,請讓我休息一下再問問題喔!
|
2214 |
+
🦄 如果達到上限,或是遇到精靈很累,請問問其他朋友,像是飛特音速說話的速度比較快,你是否跟得上呢?你也可以和其他精靈互動看看喔!
|
2215 |
+
"""
|
2216 |
+
gr.Image(value=jutor_chatbot_avatar_url, height=100, width=100, show_label=False, show_download_button=False)
|
2217 |
+
gr.Button("👆選擇【梨梨】", elem_id="jutor_chatbot_btn", visible=True, variant="primary")
|
2218 |
+
gr.Textbox(label="Chatbot Description", value=jutor_chatbot_description, visible=True)
|
2219 |
+
|
2220 |
+
|
2221 |
+
|
2222 |
with gr.Row():
|
2223 |
with gr.Tab("飛特精靈"):
|
2224 |
user_avatar = "https://em-content.zobj.net/source/google/263/flushed-face_1f633.png"
|
|
|
2265 |
clear_btn="🗑️ 清除全部",
|
2266 |
stop_btn=None,
|
2267 |
description=streaming_chat_greeting
|
2268 |
+
)
|
|
|
2269 |
with gr.Tab("其他精靈"):
|
2270 |
ai_chatbot_greeting = [[
|
2271 |
None,
|