main
HuangHai 4 weeks ago
parent 6eb444deb5
commit 969b46452d

@ -183,18 +183,6 @@ async def generate_stream(client, es_pool, collection_manager, query, documents)
logger.info("Elasticsearch连接已释放")
"""
http://10.10.21.22:8000/static/ai.html
知识库中有的内容
小学数学中有哪些模型
帮我写一下 如何理解点线的教学设计
知识库中没有的内容
你知道黄海是谁吗
"""
class QueryRequest(BaseModel):
query: str = Field(..., description="用户查询的问题")
documents: List[str] = Field(..., description="用户上传的文档")
@ -225,7 +213,7 @@ async def save_to_word(request: Request):
f.write(html_content)
# 使用pandoc转换
output_file = os.path.join(tempfile.gettempdir(), "小学数学问答.docx")
output_file = os.path.join(tempfile.gettempdir(), "理想大模型问答.docx")
subprocess.run(['pandoc', temp_html, '-o', output_file], check=True)
# 读取生成的Word文件
@ -233,7 +221,7 @@ async def save_to_word(request: Request):
stream = BytesIO(f.read())
# 返回响应
encoded_filename = urllib.parse.quote("小学数学问答.docx")
encoded_filename = urllib.parse.quote("理想大模型问答.docx")
return StreamingResponse(
stream,
media_type="application/vnd.openxmlformats-officedocument.wordprocessingml.document",

@ -219,15 +219,15 @@
<h3>知识库范围</h3>
<div class="doc-checkboxes">
<label>
<input type="checkbox" name="documents" value="MATH_DATA_1">
<input type="checkbox" name="documents" value="MATH_1">
小学数学教学中的若干问题
</label>
<label>
<input type="checkbox" name="documents" value="MATH_DATA_2">
<input type="checkbox" name="documents" value="MATH_2">
小学数学知识点
</label>
<label>
<input type="checkbox" name="documents" value="CHINESE_DATA_1">
<input type="checkbox" name="documents" value="CHINESE_1">
高中语文文言文
</label>
</div>

Loading…
Cancel
Save