Spaces:
Sleeping
Sleeping
user_content
Browse files
app.py
CHANGED
@@ -35,10 +35,11 @@ def update_buttons(df_string):
|
|
35 |
def generate_questions(df_string):
|
36 |
# 使用 OpenAI 生成基于上传数据的问题
|
37 |
|
38 |
-
sys_content =
|
|
|
39 |
messages = [
|
40 |
{"role": "system", "content": sys_content},
|
41 |
-
{"role": "user", "content":
|
42 |
]
|
43 |
response_format = { "type": "json_object" }
|
44 |
|
|
|
35 |
def generate_questions(df_string):
|
36 |
# 使用 OpenAI 生成基于上传数据的问题
|
37 |
|
38 |
+
sys_content = "你是一個資料分析師,user為老師,請精讀資料,並用既有資料為本質猜測用戶可能會問的問題,使用 zh-TW"
|
39 |
+
user_content = f"請根據 {df_string} 生成三個問題,並用 JSON 格式返回 questions:[q1, q2, q3]"
|
40 |
messages = [
|
41 |
{"role": "system", "content": sys_content},
|
42 |
+
{"role": "user", "content": user_content}
|
43 |
]
|
44 |
response_format = { "type": "json_object" }
|
45 |
|