fixbug:解决抢答和获取任务的问题

This commit is contained in:
2025-02-21 20:00:43 +08:00
parent 17c44d2c22
commit 8954fc5a7f
3 changed files with 36 additions and 7 deletions
+3 -2
View File
@@ -8,6 +8,7 @@ def extract_content(data_string):
data = json.loads(data_string)
# 提取content字段
content = data["choices"][0]["message"].get("content", "")
print(content)
return content
except json.JSONDecodeError:
print("Invalid JSON")
@@ -57,14 +58,14 @@ def game_question_json(question):
每个问题都应当独立,问题之间不应具有连贯性或延续性。
避免重复提问或相似问题,确保每个问题都是全新的。
,问题需要有一定的难度,回答完毕之后用户能有所收获,并且对问题进行打分,同时根据问题难度告知答对之后给多少分(1-10)请只返回JSON格式的内容:
格式要求如下:{\"question\": \"哪个国家最早将玫瑰与爱情联系起来?\", \"score\":\"1\", \"answer\": \"波斯\",\"description\":\"描述问题答案的原因\"}
格式要求如下(请不要加上markdown 的符号){\"question\": \"哪个国家最早将玫瑰与爱情联系起来?\", \"score\":\"1\", \"answer\": \"波斯\",\"description\":\"描述问题答案的原因\"}
"""
return message_task_json(prompt, question)
def game_answer_json(answar):
prompt = "你是一个益智百科问答大师,可以根据用户回答的答案进行判断,并且对问题(question)答案(answer)进行打分,打分时请参考最高分要求(top_score),告知用户能获得多少分,请在description中描述打分理由,请只返回JSON格式的内容:格式要求如下:{\"question\": \"哪个国家最早将玫瑰与爱情联系起来?\", \"score\":\"1\", \"answer\": \"波斯\",\"description\":\"描述问题答案的原因\"}"
prompt = "你是一个益智百科问答大师,可以根据用户回答的答案进行判断,并且对问题(question)答案(answer)进行打分,打分时请参考最高分要求(top_score),告知用户能获得多少分,请在description中描述打分理由,请只返回JSON格式的内容:格式要求如下(请不要加上markdown 的符号){\"question\": \"哪个国家最早将玫瑰与爱情联系起来?\", \"score\":\"1\", \"answer\": \"波斯\",\"description\":\"描述问题答案的原因\"}"
return message_task_json(prompt, answar)