feat(documents): 支持文档上传与本地RAG入库

This commit is contained in:
2026-05-30 00:10:05 +08:00
parent 7a6c110103
commit 4a831ee2c5
13 changed files with 403 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>上传文件</title>
</head>
<body>
<h1>上传文件</h1>
<nav><a href="{% url 'documents:list' %}">返回文件列表</a></nav>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
<p>
<label for="id_scenario_id">场景</label>
<select name="scenario_id" id="id_scenario_id">
{% for scenario in scenarios %}
<option value="{{ scenario.id }}">{{ scenario.name }}</option>
{% endfor %}
</select>
</p>
<p>{{ form.file.label_tag }} {{ form.file }}</p>
{{ form.errors }}
<p>支持 .txt、.md、.pdf 和 .docx 文件。</p>
<button type="submit">上传</button>
</form>
</body>
</html>