feat(documents): 支持文档上传与本地RAG入库
This commit is contained in:
26
templates/documents/upload.html
Normal file
26
templates/documents/upload.html
Normal 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>
|
||||
Reference in New Issue
Block a user