Add 3 files
Browse files- README.md +7 -5
- index.html +845 -19
- prompts.txt +1 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: kf-v1
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: gray
|
5 |
+
colorTo: purple
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,845 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Knowledge Factory</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
.sidebar {
|
11 |
+
transition: all 0.3s;
|
12 |
+
}
|
13 |
+
.sidebar.collapsed {
|
14 |
+
width: 70px;
|
15 |
+
}
|
16 |
+
.sidebar.collapsed .sidebar-text {
|
17 |
+
display: none;
|
18 |
+
}
|
19 |
+
.sidebar.collapsed .sidebar-icon {
|
20 |
+
margin-right: 0;
|
21 |
+
}
|
22 |
+
.main-content {
|
23 |
+
transition: all 0.3s;
|
24 |
+
}
|
25 |
+
.sidebar.collapsed + .main-content {
|
26 |
+
margin-left: 70px;
|
27 |
+
}
|
28 |
+
.knowledge-card {
|
29 |
+
transition: all 0.2s;
|
30 |
+
}
|
31 |
+
.knowledge-card:hover {
|
32 |
+
transform: translateY(-2px);
|
33 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
34 |
+
}
|
35 |
+
.tab-content {
|
36 |
+
display: none;
|
37 |
+
}
|
38 |
+
.tab-content.active {
|
39 |
+
display: block;
|
40 |
+
}
|
41 |
+
.progress-bar {
|
42 |
+
transition: width 0.3s ease;
|
43 |
+
}
|
44 |
+
.json-viewer {
|
45 |
+
background-color: #f5f5f5;
|
46 |
+
border-radius: 4px;
|
47 |
+
padding: 10px;
|
48 |
+
font-family: monospace;
|
49 |
+
white-space: pre-wrap;
|
50 |
+
max-height: 300px;
|
51 |
+
overflow-y: auto;
|
52 |
+
}
|
53 |
+
</style>
|
54 |
+
</head>
|
55 |
+
<body class="bg-gray-50">
|
56 |
+
<div class="flex h-screen overflow-hidden">
|
57 |
+
<!-- Sidebar -->
|
58 |
+
<div class="sidebar bg-indigo-800 text-white w-64 flex-shrink-0 flex flex-col">
|
59 |
+
<div class="p-4 flex items-center justify-between border-b border-indigo-700">
|
60 |
+
<div class="flex items-center">
|
61 |
+
<i class="fas fa-industry text-2xl sidebar-icon mr-3"></i>
|
62 |
+
<span class="text-xl font-semibold sidebar-text">Knowledge Factory</span>
|
63 |
+
</div>
|
64 |
+
<button id="toggleSidebar" class="text-white focus:outline-none">
|
65 |
+
<i class="fas fa-bars"></i>
|
66 |
+
</button>
|
67 |
+
</div>
|
68 |
+
<div class="flex-grow overflow-y-auto">
|
69 |
+
<nav class="p-2">
|
70 |
+
<div class="mb-4">
|
71 |
+
<div class="text-xs uppercase text-indigo-300 px-4 py-2 sidebar-text">Document Processing</div>
|
72 |
+
<a href="#" class="block px-4 py-2 rounded hover:bg-indigo-700 flex items-center" onclick="showTab('document-understander')">
|
73 |
+
<i class="fas fa-file-alt sidebar-icon mr-3"></i>
|
74 |
+
<span class="sidebar-text">Document Understanders</span>
|
75 |
+
</a>
|
76 |
+
<a href="#" class="block px-4 py-2 rounded hover:bg-indigo-700 flex items-center" onclick="showTab('knowledge-extractor')">
|
77 |
+
<i class="fas fa-brain sidebar-icon mr-3"></i>
|
78 |
+
<span class="sidebar-text">Knowledge Extractors</span>
|
79 |
+
</a>
|
80 |
+
<a href="#" class="block px-4 py-2 rounded hover:bg-indigo-700 flex items-center" onclick="showTab('processing-tasks')">
|
81 |
+
<i class="fas fa-tasks sidebar-icon mr-3"></i>
|
82 |
+
<span class="sidebar-text">Processing Tasks</span>
|
83 |
+
</a>
|
84 |
+
</div>
|
85 |
+
<div class="mb-4">
|
86 |
+
<div class="text-xs uppercase text-indigo-300 px-4 py-2 sidebar-text">Knowledge Management</div>
|
87 |
+
<a href="#" class="block px-4 py-2 rounded hover:bg-indigo-700 flex items-center" onclick="showTab('knowledge-review')">
|
88 |
+
<i class="fas fa-check-circle sidebar-icon mr-3"></i>
|
89 |
+
<span class="sidebar-text">Knowledge Review</span>
|
90 |
+
</a>
|
91 |
+
<a href="#" class="block px-4 py-2 rounded hover:bg-indigo-700 flex items-center" onclick="showTab('knowledge-base')">
|
92 |
+
<i class="fas fa-database sidebar-icon mr-3"></i>
|
93 |
+
<span class="sidebar-text">Knowledge Bases</span>
|
94 |
+
</a>
|
95 |
+
<a href="#" class="block px-4 py-2 rounded hover:bg-indigo-700 flex items-center" onclick="showTab('knowledge-entries')">
|
96 |
+
<i class="fas fa-boxes sidebar-icon mr-3"></i>
|
97 |
+
<span class="sidebar-text">Knowledge Entries</span>
|
98 |
+
</a>
|
99 |
+
</div>
|
100 |
+
<div class="mb-4">
|
101 |
+
<div class="text-xs uppercase text-indigo-300 px-4 py-2 sidebar-text">System</div>
|
102 |
+
<a href="#" class="block px-4 py-2 rounded hover:bg-indigo-700 flex items-center" onclick="showTab('users')">
|
103 |
+
<i class="fas fa-users sidebar-icon mr-3"></i>
|
104 |
+
<span class="sidebar-text">Users & Roles</span>
|
105 |
+
</a>
|
106 |
+
<a href="#" class="block px-4 py-2 rounded hover:bg-indigo-700 flex items-center" onclick="showTab('logs')">
|
107 |
+
<i class="fas fa-clipboard-list sidebar-icon mr-3"></i>
|
108 |
+
<span class="sidebar-text">System Logs</span>
|
109 |
+
</a>
|
110 |
+
<a href="#" class="block px-4 py-2 rounded hover:bg-indigo-700 flex items-center" onclick="showTab('settings')">
|
111 |
+
<i class="fas fa-cog sidebar-icon mr-3"></i>
|
112 |
+
<span class="sidebar-text">Settings</span>
|
113 |
+
</a>
|
114 |
+
</div>
|
115 |
+
</nav>
|
116 |
+
</div>
|
117 |
+
<div class="p-4 border-t border-indigo-700 flex items-center">
|
118 |
+
<img src="https://ui-avatars.com/api/?name=Admin+User&background=random" class="w-8 h-8 rounded-full mr-3">
|
119 |
+
<div class="sidebar-text">
|
120 |
+
<div class="font-medium">Admin User</div>
|
121 |
+
<div class="text-xs text-indigo-300">Knowledge Engineer</div>
|
122 |
+
</div>
|
123 |
+
</div>
|
124 |
+
</div>
|
125 |
+
|
126 |
+
<!-- Main Content -->
|
127 |
+
<div class="main-content flex-1 flex flex-col overflow-hidden ml-64">
|
128 |
+
<!-- Header -->
|
129 |
+
<header class="bg-white shadow-sm py-4 px-6 flex items-center justify-between">
|
130 |
+
<h1 class="text-2xl font-semibold text-gray-800" id="pageTitle">Document Understanders</h1>
|
131 |
+
<div class="flex items-center space-x-4">
|
132 |
+
<div class="relative">
|
133 |
+
<input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
134 |
+
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
|
135 |
+
</div>
|
136 |
+
<button class="p-2 text-gray-500 hover:text-gray-700 focus:outline-none">
|
137 |
+
<i class="fas fa-bell"></i>
|
138 |
+
</button>
|
139 |
+
<button class="p-2 text-gray-500 hover:text-gray-700 focus:outline-none">
|
140 |
+
<i class="fas fa-question-circle"></i>
|
141 |
+
</button>
|
142 |
+
</div>
|
143 |
+
</header>
|
144 |
+
|
145 |
+
<!-- Main Content Area -->
|
146 |
+
<div class="flex-1 overflow-y-auto p-6 bg-gray-50">
|
147 |
+
<!-- Document Understander Tab -->
|
148 |
+
<div id="document-understander" class="tab-content active">
|
149 |
+
<div class="flex justify-between items-center mb-6">
|
150 |
+
<h2 class="text-xl font-semibold text-gray-800">Document Understander Configurations</h2>
|
151 |
+
<button onclick="showModal('createUnderstanderModal')" class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg flex items-center">
|
152 |
+
<i class="fas fa-plus mr-2"></i> New Understander
|
153 |
+
</button>
|
154 |
+
</div>
|
155 |
+
|
156 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
157 |
+
<div class="p-4 border-b flex justify-between items-center">
|
158 |
+
<div class="flex items-center space-x-4">
|
159 |
+
<div class="relative">
|
160 |
+
<select class="appearance-none bg-gray-100 border border-gray-300 rounded-lg px-4 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
161 |
+
<option>All Status</option>
|
162 |
+
<option>Active</option>
|
163 |
+
<option>Inactive</option>
|
164 |
+
</select>
|
165 |
+
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
166 |
+
<i class="fas fa-chevron-down"></i>
|
167 |
+
</div>
|
168 |
+
</div>
|
169 |
+
<input type="text" placeholder="Filter by name..." class="px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
170 |
+
</div>
|
171 |
+
<button class="text-gray-500 hover:text-gray-700">
|
172 |
+
<i class="fas fa-sync-alt"></i>
|
173 |
+
</button>
|
174 |
+
</div>
|
175 |
+
<div class="overflow-x-auto">
|
176 |
+
<table class="min-w-full divide-y divide-gray-200">
|
177 |
+
<thead class="bg-gray-50">
|
178 |
+
<tr>
|
179 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
|
180 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
|
181 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">API Endpoint</th>
|
182 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
|
183 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Last Tested</th>
|
184 |
+
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
185 |
+
</tr>
|
186 |
+
</thead>
|
187 |
+
<tbody class="bg-white divide-y divide-gray-200">
|
188 |
+
<tr>
|
189 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
190 |
+
<div class="font-medium text-gray-900">PDF Parser v1</div>
|
191 |
+
</td>
|
192 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
193 |
+
<div class="text-gray-500">Extracts text from PDF documents</div>
|
194 |
+
</td>
|
195 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
196 |
+
<div class="text-gray-500">https://api.docparser.com/v1/pdf</div>
|
197 |
+
</td>
|
198 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
199 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Active</span>
|
200 |
+
</td>
|
201 |
+
<td class="px-6 py-4 whitespace-nowrap text-gray-500">
|
202 |
+
2023-06-15 14:30
|
203 |
+
</td>
|
204 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
205 |
+
<button onclick="showModal('testUnderstanderModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Test</button>
|
206 |
+
<button onclick="showModal('editUnderstanderModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Edit</button>
|
207 |
+
<button class="text-red-600 hover:text-red-900">Delete</button>
|
208 |
+
</td>
|
209 |
+
</tr>
|
210 |
+
<tr>
|
211 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
212 |
+
<div class="font-medium text-gray-900">PPTX Extractor</div>
|
213 |
+
</td>
|
214 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
215 |
+
<div class="text-gray-500">Extracts text and metadata from PowerPoint files</div>
|
216 |
+
</td>
|
217 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
218 |
+
<div class="text-gray-500">https://api.docparser.com/v1/pptx</div>
|
219 |
+
</td>
|
220 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
221 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Active</span>
|
222 |
+
</td>
|
223 |
+
<td class="px-6 py-4 whitespace-nowrap text-gray-500">
|
224 |
+
2023-06-10 09:15
|
225 |
+
</td>
|
226 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
227 |
+
<button onclick="showModal('testUnderstanderModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Test</button>
|
228 |
+
<button onclick="showModal('editUnderstanderModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Edit</button>
|
229 |
+
<button class="text-red-600 hover:text-red-900">Delete</button>
|
230 |
+
</td>
|
231 |
+
</tr>
|
232 |
+
<tr>
|
233 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
234 |
+
<div class="font-medium text-gray-900">Image OCR</div>
|
235 |
+
</td>
|
236 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
237 |
+
<div class="text-gray-500">Optical Character Recognition for PNG/JPG</div>
|
238 |
+
</td>
|
239 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
240 |
+
<div class="text-gray-500">https://api.docparser.com/v1/ocr</div>
|
241 |
+
</td>
|
242 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
243 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">Inactive</span>
|
244 |
+
</td>
|
245 |
+
<td class="px-6 py-4 whitespace-nowrap text-gray-500">
|
246 |
+
2023-05-28 16:45
|
247 |
+
</td>
|
248 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
249 |
+
<button onclick="showModal('testUnderstanderModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Test</button>
|
250 |
+
<button onclick="showModal('editUnderstanderModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Edit</button>
|
251 |
+
<button class="text-red-600 hover:text-red-900">Delete</button>
|
252 |
+
</td>
|
253 |
+
</tr>
|
254 |
+
</tbody>
|
255 |
+
</table>
|
256 |
+
</div>
|
257 |
+
<div class="bg-gray-50 px-6 py-3 flex items-center justify-between border-t border-gray-200">
|
258 |
+
<div class="flex-1 flex justify-between sm:hidden">
|
259 |
+
<a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Previous </a>
|
260 |
+
<a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Next </a>
|
261 |
+
</div>
|
262 |
+
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
|
263 |
+
<div>
|
264 |
+
<p class="text-sm text-gray-700">
|
265 |
+
Showing <span class="font-medium">1</span> to <span class="font-medium">3</span> of <span class="font-medium">3</span> results
|
266 |
+
</p>
|
267 |
+
</div>
|
268 |
+
<div>
|
269 |
+
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
|
270 |
+
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
271 |
+
<span class="sr-only">Previous</span>
|
272 |
+
<i class="fas fa-chevron-left"></i>
|
273 |
+
</a>
|
274 |
+
<a href="#" aria-current="page" class="z-10 bg-indigo-50 border-indigo-500 text-indigo-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 1 </a>
|
275 |
+
<a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 2 </a>
|
276 |
+
<a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 3 </a>
|
277 |
+
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
278 |
+
<span class="sr-only">Next</span>
|
279 |
+
<i class="fas fa-chevron-right"></i>
|
280 |
+
</a>
|
281 |
+
</nav>
|
282 |
+
</div>
|
283 |
+
</div>
|
284 |
+
</div>
|
285 |
+
</div>
|
286 |
+
</div>
|
287 |
+
|
288 |
+
<!-- Knowledge Extractor Tab -->
|
289 |
+
<div id="knowledge-extractor" class="tab-content">
|
290 |
+
<div class="flex justify-between items-center mb-6">
|
291 |
+
<h2 class="text-xl font-semibold text-gray-800">Knowledge Extractor Configurations</h2>
|
292 |
+
<button onclick="showModal('createExtractorModal')" class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg flex items-center">
|
293 |
+
<i class="fas fa-plus mr-2"></i> New Extractor
|
294 |
+
</button>
|
295 |
+
</div>
|
296 |
+
|
297 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
298 |
+
<div class="p-4 border-b flex justify-between items-center">
|
299 |
+
<div class="flex items-center space-x-4">
|
300 |
+
<div class="relative">
|
301 |
+
<select class="appearance-none bg-gray-100 border border-gray-300 rounded-lg px-4 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
302 |
+
<option>All Status</option>
|
303 |
+
<option>Active</option>
|
304 |
+
<option>Inactive</option>
|
305 |
+
</select>
|
306 |
+
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
307 |
+
<i class="fas fa-chevron-down"></i>
|
308 |
+
</div>
|
309 |
+
</div>
|
310 |
+
<input type="text" placeholder="Filter by name..." class="px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
311 |
+
</div>
|
312 |
+
<button class="text-gray-500 hover:text-gray-700">
|
313 |
+
<i class="fas fa-sync-alt"></i>
|
314 |
+
</button>
|
315 |
+
</div>
|
316 |
+
<div class="overflow-x-auto">
|
317 |
+
<table class="min-w-full divide-y divide-gray-200">
|
318 |
+
<thead class="bg-gray-50">
|
319 |
+
<tr>
|
320 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
|
321 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
|
322 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">API Endpoint</th>
|
323 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
|
324 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Last Tested</th>
|
325 |
+
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
326 |
+
</tr>
|
327 |
+
</thead>
|
328 |
+
<tbody class="bg-white divide-y divide-gray-200">
|
329 |
+
<tr>
|
330 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
331 |
+
<div class="font-medium text-gray-900">Key Concept Extractor</div>
|
332 |
+
</td>
|
333 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
334 |
+
<div class="text-gray-500">Extracts key concepts from text</div>
|
335 |
+
</td>
|
336 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
337 |
+
<div class="text-gray-500">https://api.knowledge.com/v1/extract</div>
|
338 |
+
</td>
|
339 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
340 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Active</span>
|
341 |
+
</td>
|
342 |
+
<td class="px-6 py-4 whitespace-nowrap text-gray-500">
|
343 |
+
2023-06-14 11:20
|
344 |
+
</td>
|
345 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
346 |
+
<button onclick="showModal('testExtractorModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Test</button>
|
347 |
+
<button onclick="showModal('editExtractorModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Edit</button>
|
348 |
+
<button class="text-red-600 hover:text-red-900">Delete</button>
|
349 |
+
</td>
|
350 |
+
</tr>
|
351 |
+
<tr>
|
352 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
353 |
+
<div class="font-medium text-gray-900">Technical Doc Parser</div>
|
354 |
+
</td>
|
355 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
356 |
+
<div class="text-gray-500">Specialized for technical documentation</div>
|
357 |
+
</td>
|
358 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
359 |
+
<div class="text-gray-500">https://api.knowledge.com/v1/tech</div>
|
360 |
+
</td>
|
361 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
362 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Active</span>
|
363 |
+
</td>
|
364 |
+
<td class="px-6 py-4 whitespace-nowrap text-gray-500">
|
365 |
+
2023-06-08 15:45
|
366 |
+
</td>
|
367 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
368 |
+
<button onclick="showModal('testExtractorModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Test</button>
|
369 |
+
<button onclick="showModal('editExtractorModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Edit</button>
|
370 |
+
<button class="text-red-600 hover:text-red-900">Delete</button>
|
371 |
+
</td>
|
372 |
+
</tr>
|
373 |
+
</tbody>
|
374 |
+
</table>
|
375 |
+
</div>
|
376 |
+
<div class="bg-gray-50 px-6 py-3 flex items-center justify-between border-t border-gray-200">
|
377 |
+
<div class="flex-1 flex justify-between sm:hidden">
|
378 |
+
<a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Previous </a>
|
379 |
+
<a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Next </a>
|
380 |
+
</div>
|
381 |
+
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
|
382 |
+
<div>
|
383 |
+
<p class="text-sm text-gray-700">
|
384 |
+
Showing <span class="font-medium">1</span> to <span class="font-medium">2</span> of <span class="font-medium">2</span> results
|
385 |
+
</p>
|
386 |
+
</div>
|
387 |
+
<div>
|
388 |
+
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
|
389 |
+
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
390 |
+
<span class="sr-only">Previous</span>
|
391 |
+
<i class="fas fa-chevron-left"></i>
|
392 |
+
</a>
|
393 |
+
<a href="#" aria-current="page" class="z-10 bg-indigo-50 border-indigo-500 text-indigo-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 1 </a>
|
394 |
+
<a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 2 </a>
|
395 |
+
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
396 |
+
<span class="sr-only">Next</span>
|
397 |
+
<i class="fas fa-chevron-right"></i>
|
398 |
+
</a>
|
399 |
+
</nav>
|
400 |
+
</div>
|
401 |
+
</div>
|
402 |
+
</div>
|
403 |
+
</div>
|
404 |
+
</div>
|
405 |
+
|
406 |
+
<!-- Processing Tasks Tab -->
|
407 |
+
<div id="processing-tasks" class="tab-content">
|
408 |
+
<div class="flex justify-between items-center mb-6">
|
409 |
+
<h2 class="text-xl font-semibold text-gray-800">Knowledge Processing Tasks</h2>
|
410 |
+
<button onclick="showModal('createTaskModal')" class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg flex items-center">
|
411 |
+
<i class="fas fa-plus mr-2"></i> New Task
|
412 |
+
</button>
|
413 |
+
</div>
|
414 |
+
|
415 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
416 |
+
<div class="bg-white p-4 rounded-lg shadow">
|
417 |
+
<div class="flex items-center justify-between">
|
418 |
+
<div>
|
419 |
+
<p class="text-sm font-medium text-gray-500">Pending Tasks</p>
|
420 |
+
<p class="text-2xl font-semibold text-gray-800">5</p>
|
421 |
+
</div>
|
422 |
+
<div class="bg-indigo-100 p-3 rounded-full">
|
423 |
+
<i class="fas fa-clock text-indigo-600"></i>
|
424 |
+
</div>
|
425 |
+
</div>
|
426 |
+
</div>
|
427 |
+
<div class="bg-white p-4 rounded-lg shadow">
|
428 |
+
<div class="flex items-center justify-between">
|
429 |
+
<div>
|
430 |
+
<p class="text-sm font-medium text-gray-500">In Progress</p>
|
431 |
+
<p class="text-2xl font-semibold text-gray-800">3</p>
|
432 |
+
</div>
|
433 |
+
<div class="bg-yellow-100 p-3 rounded-full">
|
434 |
+
<i class="fas fa-spinner text-yellow-600"></i>
|
435 |
+
</div>
|
436 |
+
</div>
|
437 |
+
</div>
|
438 |
+
<div class="bg-white p-4 rounded-lg shadow">
|
439 |
+
<div class="flex items-center justify-between">
|
440 |
+
<div>
|
441 |
+
<p class="text-sm font-medium text-gray-500">Completed Today</p>
|
442 |
+
<p class="text-2xl font-semibold text-gray-800">12</p>
|
443 |
+
</div>
|
444 |
+
<div class="bg-green-100 p-3 rounded-full">
|
445 |
+
<i class="fas fa-check-circle text-green-600"></i>
|
446 |
+
</div>
|
447 |
+
</div>
|
448 |
+
</div>
|
449 |
+
</div>
|
450 |
+
|
451 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
452 |
+
<div class="p-4 border-b flex justify-between items-center">
|
453 |
+
<div class="flex items-center space-x-4">
|
454 |
+
<div class="relative">
|
455 |
+
<select class="appearance-none bg-gray-100 border border-gray-300 rounded-lg px-4 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
456 |
+
<option>All Status</option>
|
457 |
+
<option>Pending</option>
|
458 |
+
<option>In Progress</option>
|
459 |
+
<option>Completed</option>
|
460 |
+
<option>Failed</option>
|
461 |
+
</select>
|
462 |
+
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
463 |
+
<i class="fas fa-chevron-down"></i>
|
464 |
+
</div>
|
465 |
+
</div>
|
466 |
+
<input type="text" placeholder="Filter by name..." class="px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
467 |
+
</div>
|
468 |
+
<button class="text-gray-500 hover:text-gray-700">
|
469 |
+
<i class="fas fa-sync-alt"></i>
|
470 |
+
</button>
|
471 |
+
</div>
|
472 |
+
<div class="overflow-x-auto">
|
473 |
+
<table class="min-w-full divide-y divide-gray-200">
|
474 |
+
<thead class="bg-gray-50">
|
475 |
+
<tr>
|
476 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Task ID</th>
|
477 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
|
478 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Understander</th>
|
479 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Extractor</th>
|
480 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
|
481 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Progress</th>
|
482 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Created</th>
|
483 |
+
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
484 |
+
</tr>
|
485 |
+
</thead>
|
486 |
+
<tbody class="bg-white divide-y divide-gray-200">
|
487 |
+
<tr>
|
488 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
489 |
+
<div class="text-sm text-gray-900">#TASK-001</div>
|
490 |
+
</td>
|
491 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
492 |
+
<div class="font-medium text-gray-900">Product Docs Batch</div>
|
493 |
+
</td>
|
494 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
495 |
+
<div class="text-sm text-gray-500">PDF Parser v1</div>
|
496 |
+
</td>
|
497 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
498 |
+
<div class="text-sm text-gray-500">Key Concept Extractor</div>
|
499 |
+
</td>
|
500 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
501 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Completed</span>
|
502 |
+
</td>
|
503 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
504 |
+
<div class="w-full bg-gray-200 rounded-full h-2">
|
505 |
+
<div class="bg-green-600 h-2 rounded-full" style="width: 100%"></div>
|
506 |
+
</div>
|
507 |
+
</td>
|
508 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
509 |
+
2023-06-15 09:30
|
510 |
+
</td>
|
511 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
512 |
+
<button onclick="showModal('taskDetailsModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Details</button>
|
513 |
+
<button class="text-red-600 hover:text-red-900">Cancel</button>
|
514 |
+
</td>
|
515 |
+
</tr>
|
516 |
+
<tr>
|
517 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
518 |
+
<div class="text-sm text-gray-900">#TASK-002</div>
|
519 |
+
</td>
|
520 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
521 |
+
<div class="font-medium text-gray-900">Technical Whitepapers</div>
|
522 |
+
</td>
|
523 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
524 |
+
<div class="text-sm text-gray-500">PDF Parser v1</div>
|
525 |
+
</td>
|
526 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
527 |
+
<div class="text-sm text-gray-500">Technical Doc Parser</div>
|
528 |
+
</td>
|
529 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
530 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">In Progress</span>
|
531 |
+
</td>
|
532 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
533 |
+
<div class="w-full bg-gray-200 rounded-full h-2">
|
534 |
+
<div class="bg-yellow-500 h-2 rounded-full" style="width: 65%"></div>
|
535 |
+
</div>
|
536 |
+
</td>
|
537 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
538 |
+
2023-06-15 11:45
|
539 |
+
</td>
|
540 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
541 |
+
<button onclick="showModal('taskDetailsModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Details</button>
|
542 |
+
<button class="text-red-600 hover:text-red-900">Cancel</button>
|
543 |
+
</td>
|
544 |
+
</tr>
|
545 |
+
<tr>
|
546 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
547 |
+
<div class="text-sm text-gray-900">#TASK-003</div>
|
548 |
+
</td>
|
549 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
550 |
+
<div class="font-medium text-gray-900">Marketing Materials</div>
|
551 |
+
</td>
|
552 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
553 |
+
<div class="text-sm text-gray-500">PPTX Extractor</div>
|
554 |
+
</td>
|
555 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
556 |
+
<div class="text-sm text-gray-500">Key Concept Extractor</div>
|
557 |
+
</td>
|
558 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
559 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">Pending</span>
|
560 |
+
</td>
|
561 |
+
<td class="px-6 py-4 whitespace-nowrap">
|
562 |
+
<div class="w-full bg-gray-200 rounded-full h-2">
|
563 |
+
<div class="bg-blue-500 h-2 rounded-full" style="width: 0%"></div>
|
564 |
+
</div>
|
565 |
+
</td>
|
566 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
567 |
+
2023-06-15 14:20
|
568 |
+
</td>
|
569 |
+
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
570 |
+
<button onclick="showModal('taskDetailsModal')" class="text-indigo-600 hover:text-indigo-900 mr-3">Details</button>
|
571 |
+
<button class="text-red-600 hover:text-red-900">Cancel</button>
|
572 |
+
</td>
|
573 |
+
</tr>
|
574 |
+
</tbody>
|
575 |
+
</table>
|
576 |
+
</div>
|
577 |
+
<div class="bg-gray-50 px-6 py-3 flex items-center justify-between border-t border-gray-200">
|
578 |
+
<div class="flex-1 flex justify-between sm:hidden">
|
579 |
+
<a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Previous </a>
|
580 |
+
<a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Next </a>
|
581 |
+
</div>
|
582 |
+
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
|
583 |
+
<div>
|
584 |
+
<p class="text-sm text-gray-700">
|
585 |
+
Showing <span class="font-medium">1</span> to <span class="font-medium">3</span> of <span class="font-medium">8</span> results
|
586 |
+
</p>
|
587 |
+
</div>
|
588 |
+
<div>
|
589 |
+
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
|
590 |
+
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
591 |
+
<span class="sr-only">Previous</span>
|
592 |
+
<i class="fas fa-chevron-left"></i>
|
593 |
+
</a>
|
594 |
+
<a href="#" aria-current="page" class="z-10 bg-indigo-50 border-indigo-500 text-indigo-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 1 </a>
|
595 |
+
<a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 2 </a>
|
596 |
+
<a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 3 </a>
|
597 |
+
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
598 |
+
<span class="sr-only">Next</span>
|
599 |
+
<i class="fas fa-chevron-right"></i>
|
600 |
+
</a>
|
601 |
+
</nav>
|
602 |
+
</div>
|
603 |
+
</div>
|
604 |
+
</div>
|
605 |
+
</div>
|
606 |
+
</div>
|
607 |
+
|
608 |
+
<!-- Knowledge Review Tab -->
|
609 |
+
<div id="knowledge-review" class="tab-content">
|
610 |
+
<div class="flex justify-between items-center mb-6">
|
611 |
+
<h2 class="text-xl font-semibold text-gray-800">Knowledge Review</h2>
|
612 |
+
<div class="flex space-x-2">
|
613 |
+
<button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg flex items-center">
|
614 |
+
<i class="fas fa-filter mr-2"></i> Filter
|
615 |
+
</button>
|
616 |
+
<button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg flex items-center">
|
617 |
+
<i class="fas fa-download mr-2"></i> Export
|
618 |
+
</button>
|
619 |
+
</div>
|
620 |
+
</div>
|
621 |
+
|
622 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
623 |
+
<div class="bg-white p-4 rounded-lg shadow">
|
624 |
+
<div class="flex items-center justify-between">
|
625 |
+
<div>
|
626 |
+
<p class="text-sm font-medium text-gray-500">Pending Review</p>
|
627 |
+
<p class="text-2xl font-semibold text-gray-800">24</p>
|
628 |
+
</div>
|
629 |
+
<div class="bg-yellow-100 p-3 rounded-full">
|
630 |
+
<i class="fas fa-exclamation-circle text-yellow-600"></i>
|
631 |
+
</div>
|
632 |
+
</div>
|
633 |
+
</div>
|
634 |
+
<div class="bg-white p-4 rounded-lg shadow">
|
635 |
+
<div class="flex items-center justify-between">
|
636 |
+
<div>
|
637 |
+
<p class="text-sm font-medium text-gray-500">Approved Today</p>
|
638 |
+
<p class="text-2xl font-semibold text-gray-800">15</p>
|
639 |
+
</div>
|
640 |
+
<div class="bg-green-100 p-3 rounded-full">
|
641 |
+
<i class="fas fa-check-circle text-green-600"></i>
|
642 |
+
</div>
|
643 |
+
</div>
|
644 |
+
</div>
|
645 |
+
<div class="bg-white p-4 rounded-lg shadow">
|
646 |
+
<div class="flex items-center justify-between">
|
647 |
+
<div>
|
648 |
+
<p class="text-sm font-medium text-gray-500">Rejected Today</p>
|
649 |
+
<p class="text-2xl font-semibold text-gray-800">3</p>
|
650 |
+
</div>
|
651 |
+
<div class="bg-red-100 p-3 rounded-full">
|
652 |
+
<i class="fas fa-times-circle text-red-600"></i>
|
653 |
+
</div>
|
654 |
+
</div>
|
655 |
+
</div>
|
656 |
+
</div>
|
657 |
+
|
658 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
659 |
+
<div class="p-4 border-b flex justify-between items-center">
|
660 |
+
<div class="flex items-center space-x-4">
|
661 |
+
<div class="relative">
|
662 |
+
<select class="appearance-none bg-gray-100 border border-gray-300 rounded-lg px-4 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
663 |
+
<option>All Status</option>
|
664 |
+
<option>Pending Review</option>
|
665 |
+
<option>Approved</option>
|
666 |
+
<option>Rejected</option>
|
667 |
+
</select>
|
668 |
+
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
669 |
+
<i class="fas fa-chevron-down"></i>
|
670 |
+
</div>
|
671 |
+
</div>
|
672 |
+
<input type="text" placeholder="Search knowledge..." class="px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
673 |
+
</div>
|
674 |
+
<div class="flex space-x-2">
|
675 |
+
<button class="text-gray-500 hover:text-gray-700">
|
676 |
+
<i class="fas fa-sync-alt"></i>
|
677 |
+
</button>
|
678 |
+
<button class="text-gray-500 hover:text-gray-700">
|
679 |
+
<i class="fas fa-columns"></i>
|
680 |
+
</button>
|
681 |
+
</div>
|
682 |
+
</div>
|
683 |
+
<div class="p-4">
|
684 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
685 |
+
<!-- Knowledge Card 1 -->
|
686 |
+
<div class="knowledge-card bg-white border border-gray-200 rounded-lg overflow-hidden shadow-sm">
|
687 |
+
<div class="p-4">
|
688 |
+
<div class="flex justify-between items-start mb-2">
|
689 |
+
<h3 class="text-lg font-semibold text-gray-800">Product Architecture</h3>
|
690 |
+
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-yellow-100 text-yellow-800">Pending</span>
|
691 |
+
</div>
|
692 |
+
<p class="text-sm text-gray-600 mb-3">Overview of the main components and their interactions in our product ecosystem.</p>
|
693 |
+
<div class="flex justify-between items-center text-xs text-gray-500 mb-3">
|
694 |
+
<span>From: Technical Whitepaper.pdf</span>
|
695 |
+
<span>2023-06-15</span>
|
696 |
+
</div>
|
697 |
+
<div class="flex space-x-2">
|
698 |
+
<button class="flex-1 bg-green-100 hover:bg-green-200 text-green-800 py-1 px-3 rounded text-sm font-medium">
|
699 |
+
Approve
|
700 |
+
</button>
|
701 |
+
<button onclick="showModal('rejectModal')" class="flex-1 bg-red-100 hover:bg-red-200 text-red-800 py-1 px-3 rounded text-sm font-medium">
|
702 |
+
Reject
|
703 |
+
</button>
|
704 |
+
<button onclick="showModal('knowledgePreviewModal')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 py-1 px-3 rounded text-sm font-medium">
|
705 |
+
<i class="fas fa-eye"></i>
|
706 |
+
</button>
|
707 |
+
</div>
|
708 |
+
</div>
|
709 |
+
</div>
|
710 |
+
|
711 |
+
<!-- Knowledge Card 2 -->
|
712 |
+
<div class="knowledge-card bg-white border border-gray-200 rounded-lg overflow-hidden shadow-sm">
|
713 |
+
<div class="p-4">
|
714 |
+
<div class="flex justify-between items-start mb-2">
|
715 |
+
<h3 class="text-lg font-semibold text-gray-800">API Rate Limits</h3>
|
716 |
+
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-yellow-100 text-yellow-800">Pending</span>
|
717 |
+
</div>
|
718 |
+
<p class="text-sm text-gray-600 mb-3">Detailed information about API rate limits and throttling policies for all endpoints.</p>
|
719 |
+
<div class="flex justify-between items-center text-xs text-gray-500 mb-3">
|
720 |
+
<span>From: API_Documentation_v2.pdf</span>
|
721 |
+
<span>2023-06-15</span>
|
722 |
+
</div>
|
723 |
+
<div class="flex space-x-2">
|
724 |
+
<button class="flex-1 bg-green-100 hover:bg-green-200 text-green-800 py-1 px-3 rounded text-sm font-medium">
|
725 |
+
Approve
|
726 |
+
</button>
|
727 |
+
<button onclick="showModal('rejectModal')" class="flex-1 bg-red-100 hover:bg-red-200 text-red-800 py-1 px-3 rounded text-sm font-medium">
|
728 |
+
Reject
|
729 |
+
</button>
|
730 |
+
<button onclick="showModal('knowledgePreviewModal')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 py-1 px-3 rounded text-sm font-medium">
|
731 |
+
<i class="fas fa-eye"></i>
|
732 |
+
</button>
|
733 |
+
</div>
|
734 |
+
</div>
|
735 |
+
</div>
|
736 |
+
|
737 |
+
<!-- Knowledge Card 3 -->
|
738 |
+
<div class="knowledge-card bg-white border border-gray-200 rounded-lg overflow-hidden shadow-sm">
|
739 |
+
<div class="p-4">
|
740 |
+
<div class="flex justify-between items-start mb-2">
|
741 |
+
<h3 class="text-lg font-semibold text-gray-800">Data Retention Policy</h3>
|
742 |
+
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Approved</span>
|
743 |
+
</div>
|
744 |
+
<p class="text-sm text-gray-600 mb-3">Company policies regarding data retention periods and deletion procedures.</p>
|
745 |
+
<div class="flex justify-between items-center text-xs text-gray-500 mb-3">
|
746 |
+
<span>From: Compliance_Guidelines.pdf</span>
|
747 |
+
<span>2023-06-14</span>
|
748 |
+
</div>
|
749 |
+
<div class="flex space-x-2">
|
750 |
+
<button class="flex-1 bg-indigo-100 hover:bg-indigo-200 text-indigo-800 py-1 px-3 rounded text-sm font-medium">
|
751 |
+
Add to KB
|
752 |
+
</button>
|
753 |
+
<button onclick="showModal('knowledgePreviewModal')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 py-1 px-3 rounded text-sm font-medium">
|
754 |
+
<i class="fas fa-eye"></i>
|
755 |
+
</button>
|
756 |
+
</div>
|
757 |
+
</div>
|
758 |
+
</div>
|
759 |
+
|
760 |
+
<!-- Knowledge Card 4 -->
|
761 |
+
<div class="knowledge-card bg-white border border-gray-200 rounded-lg overflow-hidden shadow-sm">
|
762 |
+
<div class="p-4">
|
763 |
+
<div class="flex justify-between items-start mb-2">
|
764 |
+
<h3 class="text-lg font-semibold text-gray-800">Troubleshooting Guide</h3>
|
765 |
+
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">Rejected</span>
|
766 |
+
</div>
|
767 |
+
<p class="text-sm text-gray-600 mb-3">Common issues and solutions for product installation and configuration.</p>
|
768 |
+
<div class="flex justify-between items-center text-xs text-gray-500 mb-3">
|
769 |
+
<span>From: Support_Handbook.pdf</span>
|
770 |
+
<span>2023-06-14</span>
|
771 |
+
</div>
|
772 |
+
<div class="text-xs bg-red-50 text-red-700 p-2 rounded mb-3">
|
773 |
+
<strong>Rejection Reason:</strong> Incomplete information, missing critical steps.
|
774 |
+
</div>
|
775 |
+
<div class="flex space-x-2">
|
776 |
+
<button class="flex-1 bg-gray-100 hover:bg-gray-200 text-gray-800 py-1 px-3 rounded text-sm font-medium">
|
777 |
+
Edit
|
778 |
+
</button>
|
779 |
+
<button onclick="showModal('knowledgePreviewModal')" class="bg-gray-100 hover:bg-gray-200 text-gray-800 py-1 px-3 rounded text-sm font-medium">
|
780 |
+
<i class="fas fa-eye"></i>
|
781 |
+
</button>
|
782 |
+
</div>
|
783 |
+
</div>
|
784 |
+
</div>
|
785 |
+
</div>
|
786 |
+
</div>
|
787 |
+
<div class="bg-gray-50 px-6 py-3 flex items-center justify-between border-t border-gray-200">
|
788 |
+
<div class="flex-1 flex justify-between sm:hidden">
|
789 |
+
<a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Previous </a>
|
790 |
+
<a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50"> Next </a>
|
791 |
+
</div>
|
792 |
+
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
|
793 |
+
<div>
|
794 |
+
<p class="text-sm text-gray-700">
|
795 |
+
Showing <span class="font-medium">1</span> to <span class="font-medium">4</span> of <span class="font-medium">24</span> results
|
796 |
+
</p>
|
797 |
+
</div>
|
798 |
+
<div>
|
799 |
+
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
|
800 |
+
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
801 |
+
<span class="sr-only">Previous</span>
|
802 |
+
<i class="fas fa-chevron-left"></i>
|
803 |
+
</a>
|
804 |
+
<a href="#" aria-current="page" class="z-10 bg-indigo-50 border-indigo-500 text-indigo-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 1 </a>
|
805 |
+
<a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 2 </a>
|
806 |
+
<a href="#" class="bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border text-sm font-medium"> 3 </a>
|
807 |
+
<a href="#" class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
|
808 |
+
<span class="sr-only">Next</span>
|
809 |
+
<i class="fas fa-chevron-right"></i>
|
810 |
+
</a>
|
811 |
+
</nav>
|
812 |
+
</div>
|
813 |
+
</div>
|
814 |
+
</div>
|
815 |
+
</div>
|
816 |
+
</div>
|
817 |
+
|
818 |
+
<!-- Knowledge Base Tab -->
|
819 |
+
<div id="knowledge-base" class="tab-content">
|
820 |
+
<div class="flex justify-between items-center mb-6">
|
821 |
+
<h2 class="text-xl font-semibold text-gray-800">Knowledge Bases</h2>
|
822 |
+
<button onclick="showModal('createKBModal')" class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg flex items-center">
|
823 |
+
<i class="fas fa-plus mr-2"></i> New Knowledge Base
|
824 |
+
</button>
|
825 |
+
</div>
|
826 |
+
|
827 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
|
828 |
+
<div class="bg-white p-4 rounded-lg shadow">
|
829 |
+
<div class="flex items-center justify-between">
|
830 |
+
<div>
|
831 |
+
<p class="text-sm font-medium text-gray-500">Total Knowledge Bases</p>
|
832 |
+
<p class="text-2xl font-semibold text-gray-800">8</p>
|
833 |
+
</div>
|
834 |
+
<div class="bg-indigo-100 p-3 rounded-full">
|
835 |
+
<i class="fas fa-database text-indigo-600"></i>
|
836 |
+
</div>
|
837 |
+
</div>
|
838 |
+
</div>
|
839 |
+
<div class="bg-white p-4 rounded-lg shadow">
|
840 |
+
<div class="flex items-center justify-between">
|
841 |
+
<div>
|
842 |
+
<p class="text-sm font-medium text-gray-500">Active Knowledge</p>
|
843 |
+
<p class="text-2xl font-semibold text-gray-800">1,245</p>
|
844 |
+
|
845 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
请帮忙完成下面的产品的开发,要求:生成完整版本。 # 知识工厂 - 产品需求文档 (PRD) ## 1. 产品目标与定位 ### 1.1 产品定位 知识工厂是一个端到端的知识处理平台,旨在帮助企业实现从原始文档到结构化知识的高效转化和管理,提升知识资产的价值和可用性。 ## 3. 功能详细说明 ### 3.1 统一术语定义 | 术语 | 定义 | | :------------- | :------------------------------------------------------------------- | | 源文件 | 输入到系统的原始文档,包括 PDF、PPT、TXT、Markdown、PNG 等格式 | | **文档理解器配置** | **指向外部文档处理服务 API 的配置信息,包含 URL、认证方式等** | | 解析结果 | 调用外部文档理解器 API 后,系统获取并标准化处理后的 Markdown 格式输出 | | **知识提取器配置** | **指向外部知识提取服务 API 的配置信息,包含 URL、认证方式等** | | 知识条目 | 调用外部知识提取器 API 后,系统获取并映射到内部标准结构的结构化知识单元(JSON) | | 知识库 | 存储和管理知识条目的集合,具有特定业务属性 | | 审核知识 | 经过人工审核流程(通过/不通过)的知识条目 | | 入库知识 | 已通过审核并添加到指定知识库的知识条目,具有“未上架”、“已上架”、“已下架”等状态 | ### 3.2 文档理解器管理 #### 3.2.1 功能描述 文档理解器在本系统中**代表一个外部的文档处理服务接口配置**。系统负责管理这些配置,并在处理文档时调用相应的外部 API,将返回结果(如 Markdown)标准化,为后续知识提取提供输入。 #### 3.2.2 详细需求 1. **理解器配置管理 (需要专门的管理页面)** * **创建文档理解器配置**: 配置名称、描述、**处理接口 URL (指向外部文档处理服务的 API 端点)**、必要的认证信息(如 API Key、请求头)、以及接口的预期输入输出规范(如支持的文件类型、请求体格式、预期响应格式)。记录创建人信息。 * 查看、更新和删除已有文档理解器配置。 * 支持对理解器配置进行**在线测试**: 上传一个样本文件,系统调用配置的外部 API,并显示调用是否成功及返回结果,以验证配置的正确性。 * **UI 需求**: 提供专门的“文档理解器管理”页面,允许用户执行上述创建、查看、编辑、删除和测试配置的操作。 2. **文件处理功能** * 支持 PDF、PPT、TXT、Markdown、PNG 等格式源文件的上传。 * 支持单个或批量上传文件,并在上传后**选择一个已配置的文档理解器**进行处理。 * **调用外部 API**: 提交处理请求后,系统后台异步**调用所选理解器配置中指定的外部 API**,并将源文件内容或引用传递给该 API。 * 并行处理多个调用任务,显示实时处理进度(调用中、调用成功、调用失败)。 * **结果标准化**: 系统接收外部 API 的返回结果,并将其处理/转换为标准化的 Markdown 格式解析结果。一个源文件对应一个解析结果。 * **UI 需求**: 在文档列表或上传界面,提供选择已配置理解器并提交处理的功能。 3. **处理状态和日志** * 实时显示对外部 API 的调用状态和系统内部处理进度(待处理、调用中、处理完成、处理失败)。 * 提供详细处理日志查询,包括输入文件名、选择的理解器配置、**调用外部 API 的时间、请求参数、响应状态码、部分响应内容或错误信息**、系统内部处理耗时等。 * 支持对调用失败的任务进行重试操作。 * **UI 需求**: 在任务列表或文档详情中展示处理状态和日志信息,并提供重试按钮。 #### 3.2.3 用户权限 * 知识工程师:完整配置管理权限(创建、配置、测试、使用)。 * 知识审核员和管理员:查看和使用权限(选择已配置的理解器处理文档)。 ### 3.3 知识提取器管理 #### 3.3.1 功能描述 知识提取器在本系统中**代表一个外部的知识提取服务接口配置**。系统负责管理这些配置,并在需要时调用相应的外部 API,从输入的文本(如文档理解器生成的 Markdown)中提取结构化的知识条目。 #### 3.3.2 详细需求 1. **提取器配置管理 (需要专门的管理页面)** * 创建知识提取器配置:配置名称、描述、**接口地址 URL (指向外部知识提取服务的 API 端点)**、必要的认证信息、接口的预期输入输出规范(如输入文本格式、预期返回的知识条目 JSON 结构)。记录创建人信息。 * 查看、更新和删除已有知识提取器配置。 * 支持对提取器配置进行**在线测试**: 输入一段样本文本,系统调用配置的外部 API,并显示调用是否成功及返回的知识条目(或错误信息),以验证配置正确性。 * **UI 需求**: 提供专门的“知识提取器管理”页面,允许用户执行上述创建、查看、编辑、删除和测试配置的操作。 2. **知识结构定义** * 定义系统内部存储知识条目的标准结构:知识 ID、标题、内容、摘要、关键点、二级分类、来源文件、提取时间等。**系统需要能解析和映射外部 API 返回的结果到这个内部标准结构**。 * 支持配置内部字段是否必填、字段最大长度等基本约束,用于验证映射后的数据。 #### 3.3.3 用户权限 * 知识工程师:完整配置管理权限(创建、配置、测试、使用)。 * 知识审核员和管理员:查看和使用权限(在知识加工任务中选择已配置的提取器)。 ### 3.4 知识加工任务 #### 3.4.1 功能描述 知识加工任务是一个**编排和监控**功能,允许用户将文档理解(调用外部 API)和知识提取(调用外部 API)串联起来,实现从源文件到知识条目的端到端自动化处理。 #### 3.4.2 详细需求 1. **任务创建与配置 (需要专门的任务创建页面)** * **创建新任务**: 提供专门的页面或表单来创建知识加工任务。 * 上传一个或多个源文件(支持批量上传)。 * **选择文档理解器配置**: 从已配置的理解器列表中选择一个(指向外部 API)。 * **选择知识提取器配置**: 从已配置的提取器列表中选择一个(指向外部 API)。 * **指定输出目录 (逻辑)**: 用户可以指定一个逻辑上的输出标识或关联到某个项目/批次,便于后续查找和管理(后端实现上可能仍是将结果关联到任务或源文档 ID)。 * 提交任务,后台**异步编排**处理流程。 * **UI 需求**: 需要专门的“创建知识加工任务”页面,包含文件上传、选择器配置下拉列表、输出标识输入等控件。 2. **任务监控与管理 (需要专门的任务列表和详情页面)** * 显示任务列表,包含任务名称、状态、创建时间、进度等。 * 显示任务整体进度和状态(排队中、文档理解中、知识提取中、已完成、失败)。 * 提供任务详情,展示各环节的处理状态和耗时(调用文档理解 API 状态/耗时、调用知识提取 API 状态/耗时)。 * 查询处理日志,包括任务配置、各阶段对外部 API 的**调用详情(请求、响应状态、错误)**、系统内部处理信息。 * 支持中止运行中的任务(需要尝试取消后台的异步编排)或删除已完成/失败的任务记录。 * **UI 需求**: 需要任务列表页面(支持筛选、排序)和任务详情页面来展示上述监控信息和日志,并提供中止/删除操作按钮。 3. **结果管理** * 任务完成后,从该任务关联的源文件提取的知识条目应该可以被方便地查看。 * 知识条目以内部标准 JSON 格式存储在数据库中,初始状态为"**未审核**"。 * 支持在任务详情页面或专门的结果页面**在线预览**该任务生成的知识条目内容,前端能根据 JSON 数据自适应地展示。 * 提供将任务生成的知识条目进行批量导出的功能。 * **UI 需求**: 在任务详情页或结果页提供知识条目列表和预览功能,以及导出按钮。 #### 3.4.3 处理流程 (系统编排) 1. 用户通过 UI 创建并提交知识加工任务。 2. 后台任务调度器接收任务。 3. **步骤 1**: 调用选定文档理解器配置对应的**外部 API** 处理源文件。 4. 获取并标准化解析结果 (Markdown)。 5. **步骤 2**: 调用选定知识提取器配置对应的**外部 API** 处理上一步的解析结果。 6. 获取知识条目结果,映射到内部标准结构,并存入数据库(状态:**未审核**)。 7. 更新任务状态和进度。 8. 记录各步骤日志。 #### 3.4.4 用户权限 * 知识工程师和知识管理员:完整权限(创建、监控、管理任务)。 * 知识审核员:查看任务列表和结果的权限。 ### 3.5 知识审核 #### 3.5.1 功能描述 知识审核模块提供对**知识提取器(外部 API)生成**的知识条目的质量控制机制,确保入库知识满足质量标准。 #### 3.5.2 详细需求 1. **审核操作** * 支持对单个或批量知识条目进行审核。 * 提供批量选中或全选功能,支持批量审核通过。 * 审核操作包括:通过、不通过(需填写原因)。 * 审核结果影响知识状态:未审核 → 已审核(通过/不通过)。 2. **审核界面 (需要专门的审核页面/工作台)** * 提供清晰直观的审核工作台页面。 * 显示状态为“**未审核**”的知识条目列表,支持按来源任务、时间等进行筛选、排序和搜索。 * 知识内容预览���能,包括标题、内容、摘要、关键点等字段,前端能根据 JSON 数据自适应地展示。 * 提供审核操作按钮(通过、不通过)和填写不通过原因的输入框。 * **UI 需求**: **必须提供**专门的“知识审核”页面来实现上述功能。 3. **审核日志** * 记录所有审核操作(审核人、审核时间、审核结果、原因等),应使用 `AuditLog` 模型或类似机制。 * 提供审核历史查询功能。 * 支持按知识条目、审核批次、审核人等维度查询。 * **UI 需求**: 在审核页面或独立的日志查询页面提供审核历史查看功能。 #### 3.5.3 用户权限 * 知识审核员:完整审核权限。 * 知识管理员:查看和有限审核权限。 * 知识工程师:查看权限。 ### 3.6 知识库管理 #### 3.6.1 功能描述 知识库管理模块负责知识库的创建和维护,以及将**审核通过**的知识条目进行入库、查询和生命周期管理(上架/下架等)。 #### 3.6.2 详细需求 1. **知识库管理 (需要专门的管理页面)** * 创建知识库,配置知识库元信息:名称、渠道、业务属主、描述等。 * 查看、更新和下架知识库(逻辑删除或状态变更)。 * 配置知识库访问权限和使用范围。 * **UI 需求**: 提供“知识库管理”页面执行上述操作。 2. **知识入库管理 (需要在审核页面或专门的入库页面支持)** * 将状态为“**已审核(通过)**”的知识添加到指定的知识库。 * 支持从知识审核列表或知识条目搜索结果中**选择一个或多个审核通过的知识条目**。 * 提供**选择目标知识库**的功能。 * 提交入库请求后,系统处理入库逻辑(创建 `KnowledgeBaseItem` 关联记录),并将这些知识条目在知识库中的状态标记为“**未上架**”。 * **UI 需求**: 在审核页面提供“添加到知识库”的批量操作按钮,或者提供单独的“知识入库”页面,允许用户筛选审核通过的知识并将其添加到选定知识库。 3. **知识生命周期管理 (需要在知识库详情页面或专门的页面支持)** * **知识上架**: * 选择状态为“**未上架**”的入库知识(单条或批量)。 * 执行上架操作。 * 系统**调用外部接口**(例如,配置好的推送到 Elasticsearch、向量库的 API)处理上架。 * 上架成功后,将知识状态更新为“**已上架**”。 * 记录上架日志。 * **知识下架**: * 选择状态为“**已上架**”的入库知识(单条或批量)。 * 执行下架操作。 * 系统**调用外部接口**从 Elasticsearch、向量库中删除或标记知识。 * 下架成功后,将知识状态更新为“**已下架**”。 * 记录下架日志。 * 支持单条或批量设置知识有效期(默认长期有效),需要数据库模型支持有效期字段。 * 支持基于多个条件(状态、来源、时间等)对知识库中的知识进行筛选,执行批量上架、下架、删除(从知识库移除关联或彻底删除知识条目)操作。 * **UI 需求**: 在知识库内容列表页面提供筛选功能和批量操作按钮(上架、下架、设置有效期、移除等)。 4. **知识库查询与统计 (需要在知识库页面和仪表板支持)** * 提供知识库内容查询功能,支持多维度筛选和搜索(需要与上架到的外部系统如 ES 集成)。 * 提供知识库统计功能:知识总量、有效知识数、各状态(未上架/已上架/已下架)知识数量等。 * 支持知识使用情况分析:访问频率、命中率等(依赖外部系统数据)。 * **UI 需求**: 知识库列表和详情页应展示统计信息。可能需要专门的仪表板展示全局或单个知识库的统计与分析数据。 #### 3.6.3 知识库元信息 * 知识库 ID(自动生成) * 知识库名称 * 渠道 * 业务属主 * 描述 * 创建时间 * 更新时间 * 状态(活跃/下架) #### 3.6.4 入库知识结构 入库知识包含以下字段: * 知识 ID * 标题 * 内容 * 摘要 * 关键点(单个文本字段,非列表) * 二级分类 * 知识库 ID * **状态(未上架/已上架/已下架)** * **有效期(默认永久)** * 来源文件 * 提取时间 * 入库时间 * 上架时间 * 下架时间 #### 3.6.5 用户权限 * 知识库管理员:完整权限。 * 知识工程师和审核员:查看权限。 ## 4. 用户流程图(业务闭环) ### 4.1 文档理解流程 (调用外部 API) ```mermaid graph LR A[用户在 UI 上传源文件] --> B(用户在 UI 选择文档理解器配置); B --> C(用户在 UI 提交处理); C --> D{系统后台异步调用外部 API}; D --> E[系统获取并标准化解析结果]; E --> F(用户在 UI 查看处理日志和结果); ``` ### 4.2 知识提取流程 (调用外部 API) ```mermaid graph LR A[用户在 UI 选择解析结果] --> B(用户在 UI 选择知识提取器配置); B --> C(用户在 UI 提交处理); C --> D{系统后台异步调用外部 API}; D --> E[系统获取并映射知识条目]; E --> F(用户在 UI 查看处理日志和知识条目<br/>状态: 未审核); ``` ### 4.3 知识加工任务流程(端到端编排) ```mermaid graph LR A[用户在 UI 上传源文件] --> B(用户在 UI 选择文档理解器配置); B --> C(用户在 UI 选择知识提取器配置); C --> D(用户在 UI 指定输出目录/标识); D --> E(用户在 UI 提交任务); E --> F{系统后台异步编排处理}; F -- 调用外部理解API --> G[获取解析结果]; G -- 调用外部提取API --> H[获取并存储知识条目]; H --> I(用户在 UI 监控任务进度); I --> J(用户在 UI 查看最终知识条目<br/>状态: 未审核); F --> I; ``` ### 4.4 知识审核流程 (需要 UI 支持) ```mermaid graph LR A[审核员在 UI 查看待审核知识] --> B(审核员在 UI 选择单个/批量知识); B --> C{审核员在 UI 操作审核}; C -- 通过 --> E(提交审核结果); C -- 不通过 --> D(审核员在 UI 填写原因); D --> E; E --> F[系统后台更新知识状态]; F --> G[系统后台记录审核日志]; ``` ### 4.5 知识入库流程 (需要 UI 支持) ```mermaid graph LR A[用户在 UI 选择审核通过的知识] --> B(用户在 UI 选择目标知识库); B --> C(用户在 UI 提交入库请求); C --> D{系统后台处理入库<br/>(创建关联)}; D --> E[知识进入知识库<br/>状态: 未上架]; ``` ### 4.6 知识上架流程 (需要 UI 支持) ```mermaid graph LR A[用户在 UI 选择入库知识<br/>状态: 未上架] --> B(用户在 UI 执行上架操作); B --> C{系统后台调用外部上架接口}; C --> D[系统后台更新知识状态<br/>状态: 已上架]; D --> E[系统后台记录上架日志]; ``` ### 4.7 完整知识生命周期流程 (状态明确) ```mermaid graph LR A(源文件) --> B(解析结果); B --> C(知识条目 <br/> [未审核]); C -- 审核流程 --> D(知识条目<br/>[已审核]); D -- 入库流程 --> E(入库知识<br/>[未上架]); E -- 上架流程 --> F(入库知识<br/>[已上架]); F -- 下架流程 --> G(入库知识<br/>[已下架]); F -- 失效逻辑 --> H(知识失效); G -- 失效逻辑 --> H; ```
|