Spaces:
Running
Running
- if user say hi or hello or any greeting, just say hi back and introduce yourself. Then ask user to ask question in context.
Browse files
app.py
CHANGED
@@ -1862,6 +1862,7 @@ def get_instructions(content_subject, content_grade, key_moments):
|
|
1862 |
Method: Socratic style, guide thinking, no direct answers. this is very important, please be seriously following.
|
1863 |
Language: Traditional Chinese ZH-TW (it's very important), suitable for {content_grade} th-grade level.
|
1864 |
Response:
|
|
|
1865 |
- Single question, under 100 characters
|
1866 |
- include math symbols (use LaTeX $ to cover before and after, ex: $x^2$)
|
1867 |
- hint with video timestamp which format ใๅ่๏ผ00:00:00ใ.
|
@@ -2123,13 +2124,13 @@ def poll_run_status(run_id, thread_id, timeout=600, poll_interval=5):
|
|
2123 |
|
2124 |
return run.status
|
2125 |
|
2126 |
-
def
|
2127 |
verify_password(password)
|
2128 |
|
2129 |
print("=====user_data=====")
|
2130 |
print(f"user_data: {user_data}")
|
2131 |
|
2132 |
-
print("===
|
2133 |
print(thread_id)
|
2134 |
|
2135 |
# ๅ
่จ็ฎ user_message ๆฏๅฆ่ถ
้ 500 ๅๅญ
|
@@ -2489,7 +2490,7 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
2489 |
"""
|
2490 |
additional_inputs = [password, video_id, user_data, streaming_chat_thread_id_state, trascript_state, key_moments_state, content_subject_state, content_grade_state]
|
2491 |
streaming_chat = gr.ChatInterface(
|
2492 |
-
fn=
|
2493 |
additional_inputs=additional_inputs,
|
2494 |
submit_btn="้ๅบ",
|
2495 |
retry_btn=None,
|
|
|
1862 |
Method: Socratic style, guide thinking, no direct answers. this is very important, please be seriously following.
|
1863 |
Language: Traditional Chinese ZH-TW (it's very important), suitable for {content_grade} th-grade level.
|
1864 |
Response:
|
1865 |
+
- if user say hi or hello or any greeting, just say hi back and introduce yourself. Then ask user to ask question in context.
|
1866 |
- Single question, under 100 characters
|
1867 |
- include math symbols (use LaTeX $ to cover before and after, ex: $x^2$)
|
1868 |
- hint with video timestamp which format ใๅ่๏ผ00:00:00ใ.
|
|
|
2124 |
|
2125 |
return run.status
|
2126 |
|
2127 |
+
def chat_with_opan_ai_assistant_streaming(user_message, chat_history, password, video_id, user_data, thread_id, trascript, key_moments, content_subject, content_grade):
|
2128 |
verify_password(password)
|
2129 |
|
2130 |
print("=====user_data=====")
|
2131 |
print(f"user_data: {user_data}")
|
2132 |
|
2133 |
+
print("===chat_with_opan_ai_assistant_streaming===")
|
2134 |
print(thread_id)
|
2135 |
|
2136 |
# ๅ
่จ็ฎ user_message ๆฏๅฆ่ถ
้ 500 ๅๅญ
|
|
|
2490 |
"""
|
2491 |
additional_inputs = [password, video_id, user_data, streaming_chat_thread_id_state, trascript_state, key_moments_state, content_subject_state, content_grade_state]
|
2492 |
streaming_chat = gr.ChatInterface(
|
2493 |
+
fn=chat_with_opan_ai_assistant_streaming,
|
2494 |
additional_inputs=additional_inputs,
|
2495 |
submit_btn="้ๅบ",
|
2496 |
retry_btn=None,
|