main
HuangHai 2 weeks ago
parent 5932dfa187
commit 15107185d8

@ -54,10 +54,11 @@ async def rag(request: fastapi.Request):
# 查询的问题
query = data.get("query")
# 关闭参考资料
user_prompt = "\n 1、不要输出参考资料 或者 References "
user_prompt = user_prompt + "\n 2、资料中提供化学反应方程式的一定要严格按提供的Latex公式输出绝对不允许对Latex公式进行修改 "
#user_prompt = "\n 1、不要输出参考资料 或者 References "
user_prompt = "\n 2、资料中提供化学反应方程式的一定要严格按提供的Latex公式输出绝对不允许对Latex公式进行修改 "
user_prompt = user_prompt + "\n 3、如果资料中提供了图片的一定要严格按照原文提供图片输出不允许省略或不输出"
user_prompt = user_prompt + "\n 4、资料中提到的知识内容需要判断是否与本次问题相关不相关的绝对不要输出"
#user_prompt = user_prompt + "\n 4、资料中提到的知识内容需要判断是否与本次问题相关不相关的绝对不要输出"
user_prompt = user_prompt + "\n 4、根据资料回答问题可以适当拓展一下内容进行回答"
user_prompt = user_prompt + "\n 5、如果问题与提供的知识库内容不符则明确告诉未在知识库范围内提到"
user_prompt = user_prompt + "\n 6、发现输出内容中包含Latex公式的一定要检查是不是包含了$$或$的包含符号,不能让Latex无包含符号出现"
# 使用PG库后这个是没有用的,但目前的项目代码要求必传,就写一个吧。

@ -175,7 +175,7 @@
</head>
<body>
<div class="container">
<h1>【少年读史记】大模型</h1>
<h1>少惠林2025暑期读书营【少年读史记】知识问答</h1>
<div class="data-area" id="answerArea">
<div style="color:#666; padding:20px; text-align:center;">
<p>请在下方输入您的问题,答案将在此处显示</p>
@ -193,6 +193,13 @@
<div class="example-item" onclick="fillExample('本书主要讲了哪些内容?')">
本书主要讲了哪些内容?
</div>
<div class="example-item" onclick="fillExample('“先写后编”的历史写作方式是什么意思?')">
“先写后编”的历史写作方式是什么意思?
</div>
<div class="example-item" onclick="fillExample('“皇帝”称号的由来')">
“皇帝”称号的由来
</div>
</div>
</div>
@ -257,8 +264,8 @@
function submitQuestion() {
const question = document.getElementById('questionInput').value.trim();
const answerArea = document.getElementById('answerArea');
const topic = document.querySelector('input[name="topic"]:checked').value;
const mode = document.querySelector('input[name="mode"]:checked').value;
const topic = 'ShiJi';
const mode = 'hybrid';
if (!question) {
alert('请输入问题!');

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Loading…
Cancel
Save